From patchwork Thu Dec 3 21:04:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 57671 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp166372lbb; Thu, 3 Dec 2015 13:06:07 -0800 (PST) X-Received: by 10.98.76.1 with SMTP id z1mr16239153pfa.115.1449176767090; Thu, 03 Dec 2015 13:06:07 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 17si14114182pfo.238.2015.12.03.13.06.06; Thu, 03 Dec 2015 13:06:07 -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 S1754376AbbLCVFs (ORCPT + 28 others); Thu, 3 Dec 2015 16:05:48 -0500 Received: from mail-io0-f177.google.com ([209.85.223.177]:33052 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754252AbbLCVFm (ORCPT ); Thu, 3 Dec 2015 16:05:42 -0500 Received: by iouu10 with SMTP id u10so97006121iou.0 for ; Thu, 03 Dec 2015 13:05:41 -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=to2iS3FFmyXZ5mFtKJIHtDJ5bGUEY24ZGOgWI36qGWw=; b=psQ5XPQp2Egwexf6UNOhh+42G2gso7wXlsR6Iru8Jer2sO8sgEptfTKKk6vH+czWd2 QUdVIgiX1tIKsH4EBDI+bV4LRv94GFmHumocG5KumtqguREeDJ3Oi6ZNGO+OixsbhbD2 CxpyhFPez1nGSCSiKmk85AFPYXCKiEpx4Io0N6ZelxCxEt4j+LixIMkF6+qqd6FR10nn stjE5yCnNXprTyLYc7og0Ia+WdPzzO2xUY9XmyeRDxrAALExgPrRPnD+1Jqj1XDiA4UV kBcmp7IB/11yYel3PCObAN9X82PnoRHzz99iz0bTEfsMb5PzfcnLOhaet35sDelw6cpS dWdA== 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=to2iS3FFmyXZ5mFtKJIHtDJ5bGUEY24ZGOgWI36qGWw=; b=SiNv701z4/Da+L550ciixjJBMZMvECpvp4+HKOlb4IFHNVJ81f4DllW/pVV2HEiLE/ tL4DAOTewWlssJMZu6RQfZVg7SH+5XgrGAoyd3mLmciDxviiABmXJVOGQVS/n9zkIwsE WEkW2jCLwfjEKlNzRII/+/Rmx9M981yrw1mJOaagyT+K/kyf3KkF/SpOouS2DJCwHrKt dAB6pGitMPRPXnOkxxGhNER/kdkQhUOGy8qZzhu1cReSOKYy0Ay8fG5tETuV6+z0Aab5 YsNIcZeE5km8Pnam4lTfQB1KlkWyaWroxXtgcZV/v3nagX7NjuZ0uzBFUtWVhko3zMYi 5i2Q== X-Gm-Message-State: ALoCoQklUAkSndR3Cz52laPt1aNZnwF1c0EmoPWFvC1po2EK7LWrxrN0fKB7qDrLDyUVgslN/Err X-Received: by 10.107.3.163 with SMTP id e35mr9887570ioi.157.1449176741896; Thu, 03 Dec 2015 13:05:41 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id d81sm3615433ioj.12.2015.12.03.13.05.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 13:05:41 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com Cc: zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu Poirier Subject: [PATCH V6 12/26] coresight: etm3x: consolidating initial config Date: Thu, 3 Dec 2015 14:04:48 -0700 Message-Id: <1449176702-13213-13-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449176702-13213-1-git-send-email-mathieu.poirier@linaro.org> References: <1449176702-13213-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(-) -- 2.1.4 -- 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 cfaf8e840bd6..14927da0f6ba 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; @@ -606,27 +618,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) { /*