From: Yuanfang Zhang <quic_yuanfang@quicinc.com>
To: <suzuki.poulose@arm.com>, <mike.leach@linaro.org>,
<james.clark@linaro.org>, <alexander.shishkin@linux.intel.com>
Cc: <coresight@lists.linaro.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] coresight-etm4x: add isb() before reading the TRCSTATR
Date: Tue, 14 Jan 2025 17:56:45 +0800 [thread overview]
Message-ID: <55cf5c56-3841-4b1d-9d8b-7b88b8bcff96@quicinc.com> (raw)
In-Reply-To: <20241206080240.59313-1-quic_yuanfang@quicinc.com>
On 12/6/2024 4:02 PM, yuanfang zhang wrote:
> From: Yuanfang Zhang <quic_yuanfang@quicinc.com>
>
> As recommended by section 4.3.7 ("Synchronization when using system
> instructions to progrom the trace unit") of ARM IHI 0064H.b, the
> self-hosted trace analyzer must perform a Context synchronization
> event between writing to the TRCPRGCTLR and reading the TRCSTATR.
>
> Fixes: ebddaad09e10 ("coresight: etm4x: Add missing single-shot control API to sysfs")
> Signed-off-by: Yuanfang Zhang <quic_yuanfang@quicinc.com>
> ---
> Changes in V3:
> 1. Remove dsb(sy) after polling TRCSTATR.
> 2. Add isb() after polling TRCSTATR.
> ---
> .../hwtracing/coresight/coresight-etm4x-core.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> index 66d44a404ad0..c6ea00bba0cc 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> @@ -531,7 +531,6 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata)
> * As recommended by section 4.3.7 ("Synchronization when using the
> * memory-mapped interface") of ARM IHI 0064D
> */
> - dsb(sy);
> isb();
>
> done:
> @@ -906,10 +905,25 @@ static void etm4_disable_hw(void *info)
> tsb_csync();
> etm4x_relaxed_write32(csa, control, TRCPRGCTLR);
>
> + /*
> + * As recommended by section 4.3.7 ("Synchronization when using system
> + * instructions to progrom the trace unit") of ARM IHI 0064H.b, the
> + * self-hosted trace analyzer must perform a Context synchronization
> + * event between writing to the TRCPRGCTLR and reading the TRCSTATR.
> + */
> + if (!csa->io_mem)
> + isb();
> +
> /* wait for TRCSTATR.PMSTABLE to go to '1' */
> if (coresight_timeout(csa, TRCSTATR, TRCSTATR_PMSTABLE_BIT, 1))
> dev_err(etm_dev,
> "timeout while waiting for PM stable Trace Status\n");
> + /*
> + * As recommended by section 4.3.7 (Synchronization of register updates)
> + * of ARM IHI 0064H.b.
> + */
> + isb();
> +
> /* read the status of the single shot comparators */
> for (i = 0; i < drvdata->nr_ss_cmp; i++) {
> config->ss_status[i] =
gently reminder
next prev parent reply other threads:[~2025-01-14 9:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 8:02 yuanfang zhang
2025-01-14 9:56 ` Yuanfang Zhang [this message]
2025-01-14 16:03 ` Suzuki K Poulose
2025-01-16 9:08 ` Yuanfang Zhang
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=55cf5c56-3841-4b1d-9d8b-7b88b8bcff96@quicinc.com \
--to=quic_yuanfang@quicinc.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=james.clark@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=suzuki.poulose@arm.com \
/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®