From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com
Subject: [PATCH 5/8] coresight: etm4x: unlocking tracers in default arch init
Date: Mon, 29 Feb 2016 11:54:24 -0700 [thread overview]
Message-ID: <1456772067-18085-6-git-send-email-mathieu.poirier@linaro.org> (raw)
In-Reply-To: <1456772067-18085-1-git-send-email-mathieu.poirier@linaro.org>
As with the ETMv3.x driver, calling 'smp_call_function_single()'
twice in a row is highly ineffective. As such moving function
'etm4_os_unlock()' before the default initialisation takes
place, which results in the same outcome.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
drivers/hwtracing/coresight/coresight-etm4x.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index 6fd554f10ba5..4b83a753256b 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -45,12 +45,11 @@ module_param_named(boot_enable, boot_enable, int, S_IRUGO);
static int etm4_count;
static struct etmv4_drvdata *etmdrvdata[NR_CPUS];
-static void etm4_os_unlock(void *info)
+static void etm4_os_unlock(struct etmv4_drvdata *drvdata)
{
- struct etmv4_drvdata *drvdata = (struct etmv4_drvdata *)info;
-
/* Writing any value to ETMOSLAR unlocks the trace registers */
writel_relaxed(0x0, drvdata->base + TRCOSLAR);
+ drvdata->os_unlock = true;
isb();
}
@@ -287,6 +286,9 @@ static void etm4_init_arch_data(void *info)
u32 etmidr5;
struct etmv4_drvdata *drvdata = info;
+ /* Make sure all registers are accessible */
+ etm4_os_unlock(drvdata);
+
CS_UNLOCK(drvdata->base);
/* find all capabilities of the tracing unit */
@@ -604,9 +606,6 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
get_online_cpus();
etmdrvdata[drvdata->cpu] = drvdata;
- if (!smp_call_function_single(drvdata->cpu, etm4_os_unlock, drvdata, 1))
- drvdata->os_unlock = true;
-
if (smp_call_function_single(drvdata->cpu,
etm4_init_arch_data, drvdata, 1))
dev_err(dev, "ETM arch init failed\n");
--
2.1.4
next prev parent reply other threads:[~2016-02-29 18:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 18:54 [PATCH 0/8] coresight: etmv4: make driver usable by Perf Mathieu Poirier
2016-02-29 18:54 ` [PATCH 1/8] coresight: etm4x: moving sysFS entries to a dedicated file Mathieu Poirier
2016-02-29 18:54 ` [PATCH 2/8] coresight: etm4x: adding config and traceid registers Mathieu Poirier
2016-02-29 18:54 ` [PATCH 3/8] coresight: etm4x: splitting struct etmv4_drvdata Mathieu Poirier
2016-02-29 18:54 ` [PATCH 4/8] coresight: etm4x: splitting etmv4 default configuration Mathieu Poirier
2016-02-29 18:54 ` Mathieu Poirier [this message]
2016-02-29 18:54 ` [PATCH 6/8] coresight: etm4x: moving etm_drvdata::enable to atomic field Mathieu Poirier
2016-02-29 18:54 ` [PATCH 7/8] coresight: etm4x: implementing user/kernel mode tracing Mathieu Poirier
2016-02-29 18:54 ` [PATCH 8/8] coresight: etm4x: implementing the perf PMU API Mathieu Poirier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456772067-18085-6-git-send-email-mathieu.poirier@linaro.org \
--to=mathieu.poirier@linaro.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®