From patchwork Fri Nov 13 18:45:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 56551 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1215725lbb; Fri, 13 Nov 2015 10:51:45 -0800 (PST) X-Received: by 10.68.203.233 with SMTP id kt9mr9464980pbc.39.1447440705705; Fri, 13 Nov 2015 10:51:45 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ph4si28937197pbb.177.2015.11.13.10.51.45; Fri, 13 Nov 2015 10:51:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755088AbbKMSvn (ORCPT + 28 others); Fri, 13 Nov 2015 13:51:43 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:36426 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754886AbbKMSqf (ORCPT ); Fri, 13 Nov 2015 13:46:35 -0500 Received: by pacdm15 with SMTP id dm15so107586337pac.3 for ; Fri, 13 Nov 2015 10:46:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XU9aN9LaMJiyyrlFifbwqbrmv90C2HDPwO5wDUD78D4=; b=WXRjJ/YANv4LCRWqEcSqWBWRlpZ6XDoH+FPuPJ5DTClCyJ3wNhHJ1gT6qJAYt+TXQr tYrhU06B/Z4ExRG/t7BdQSRXLca9b8nw3+6J0uA5w6Z0TDXsvmAuEp5Rj/4l/krBWaSN gr7bGID+IuvqSmRNEDyp/0yB02azf01Ro0+rzC49842L0C7BsH2dN+n0PZAWVZHxnUeZ dsQ9TRJ829HvfZxLrmuJ4JoOjOyCOnXUvFuFfcaUqpFzZ7TY0d7RVuTsPso5Ru52jnvy jutUk6dhJppVGg+GthaTMMJx4gVFsKGsW+Z7CCYIWr3tJ5uSvPYZa0m7/gLo6IjY2lIw 6WZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XU9aN9LaMJiyyrlFifbwqbrmv90C2HDPwO5wDUD78D4=; b=Dsb+F9iIA5Nk3SyxWu3yQUDLAUaugHn7TipDc8g3vtxR6kNFDApMwTMVJXCAMuPIgQ esnoRsIY0WW18N6XHq9qZTW6OyiS57fxyvF6wykX7q6Wu9uyAnDhcB10RzIXLMvUcuXN RRcd21C45BAQcp9pkiDQEWJLD/NbGvjU4qO4WYPBLU2Dno6e/6Sj7VVw5wxgUfjlCSkM 5+K1mtmUbXjiNvG2lILgQmpeAzTOEcVIcIhxz46xz7BfksKsjFxqsBUqdCbXF/qzljve Frf2LLNoMG+PJg043VG2Q83aRPVmsajvV3L/+HKBfUg0nZMLveSoc9bf16QmUMjc8kPE WYzQ== X-Gm-Message-State: ALoCoQmS0gDNMEnGtQliEmRLazeC4/tOAprRxW89NvCppp+ys8b7zkYZ5Csb4WPUZs4r+5uFML9g X-Received: by 10.68.219.3 with SMTP id pk3mr34609554pbc.85.1447440394845; Fri, 13 Nov 2015 10:46:34 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id xi7sm21737967pbc.56.2015.11.13.10.46.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 10:46:34 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, alexander.shishkin@linux.intel.com, acme@kernel.org, mingo@redhat.com, corbet@lwn.net, nicolas.pitre@linaro.org Cc: adrian.hunter@intel.com, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, pawel.moll@arm.com, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH V4 12/26] coresight: etm3x: consolidating initial config Date: Fri, 13 Nov 2015 11:45:03 -0700 Message-Id: <1447440317-1977-13-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> References: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is really no point in having two functions to take care of doing the initials tracer configuration. As such moving everything to 'etm_set_default()'. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm3x.c | 37 ++++++++++----------------- 1 file changed, 14 insertions(+), 23 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index 4c54e104b610..e973e4d13bcb 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -41,7 +41,6 @@ module_param_named(boot_enable, boot_enable, int, S_IRUGO); /* The number of ETM/PTM currently registered */ static int etm_count; static struct etm_drvdata *etmdrvdata[NR_CPUS]; -static void etm_init_default_data(struct etm_config *config); /* * Memory mapped writes to clear os lock are not supported on some processors @@ -199,7 +198,7 @@ struct etm_config *get_etm_config(struct etm_drvdata *drvdata) return NULL; /* Set default config */ - etm_init_default_data(config); + etm_set_default(config); drvdata->config = config; out: return drvdata->config; @@ -212,6 +211,19 @@ void etm_set_default(struct etm_config *config) if (WARN_ON_ONCE(!config)) return; + /* + * Taken verbatim from the TRM: + * + * To trace all memory: + * set bit [24] in register 0x009, the ETMTECR1, to 1 + * set all other bits in register 0x009, the ETMTECR1, to 0 + * set all bits in register 0x007, the ETMTECR2, to 0 + * set register 0x008, the ETMTEEVR, to 0x6F (TRUE). + */ + config->enable_ctrl1 = BIT(24); + config->enable_ctrl2 = 0x0; + config->enable_event = ETM_HARD_WIRE_RES_A; + config->trigger_event = ETM_DEFAULT_EVENT_VAL; config->enable_event = ETM_HARD_WIRE_RES_A; @@ -605,27 +617,6 @@ static void etm_init_arch_data(void *info) CS_LOCK(drvdata->base); } -static void etm_init_default_data(struct etm_config *config) -{ - if (WARN_ON_ONCE(!config)) - return; - - etm_set_default(config); - - /* - * Taken verbatim from the TRM: - * - * To trace all memory: - * set bit [24] in register 0x009, the ETMTECR1, to 1 - * set all other bits in register 0x009, the ETMTECR1, to 0 - * set all bits in register 0x007, the ETMTECR2, to 0 - * set register 0x008, the ETMTEEVR, to 0x6F (TRUE). - */ - config->enable_ctrl1 = BIT(24); - config->enable_ctrl2 = 0x0; - config->enable_event = ETM_HARD_WIRE_RES_A; -} - static void etm_init_trace_id(struct etm_drvdata *drvdata) { /*