From: Yeoreum Yun <yeoreum.yun@arm.com>
To: Leo Yan <leo.yan@arm.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
Mike Leach <mike.leach@linaro.org>,
James Clark <james.clark@linaro.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Yabin Cui <yabinc@google.com>, Keita Morisaki <keyz@google.com>,
Yuanfang Zhang <quic_yuanfang@quicinc.com>,
coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 07/11] coresight: etm4x: Remove the redundant DSB
Date: Mon, 10 Nov 2025 11:47:43 +0000 [thread overview]
Message-ID: <aRHQ3/bXIBcbOkfP@e129823.arm.com> (raw)
In-Reply-To: <20251103-arm_coresight_power_management_fix-v5-7-f803c19aa153@arm.com>
Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com>
> As recommended in section 4.3.7 "Synchronization when using the
> memory-mapped interface" of ARM IHI0064H.b:
>
> When using the memory-mapped interface to program the trace unit, the
> trace analyzer must ensure that writes have completed, to ensure that
> the trace unit is fully programmed and either enabled or disabled.
>
> To ensure writes have completed, the trace analyzer can do ...
>
> If the memory marked is as Device-nGnRE or stronger, read back the
> value of any register in the trace unit. This relies on peripheral
> coherence order defined in the Arm architecture.
>
> Polling TRCSTATR ensures the previous write has completed. Therefore,
> removes the redundant DSB barrier in the enabling flow.
>
> Update the comment in the disable flow for consistency.
>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
> drivers/hwtracing/coresight/coresight-etm4x-core.c | 23 +++++++++++++++++-----
> 1 file changed, 18 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> index fdda924a2c7117a6828e5325d78586b09e75febd..bdf5ab85b2213dfd601391fdcf50960667fa7cea 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> @@ -475,10 +475,16 @@ static int etm4_enable_trace_unit(struct etmv4_drvdata *drvdata)
> }
>
> /*
> - * As recommended by section 4.3.7 ("Synchronization when using the
> - * memory-mapped interface") of ARM IHI 0064D
> + * As recommended in section 4.3.7 (Synchronization of register updates)
> + * of ARM IHI 0064H.b, the self-hosted trace analyzer always executes an
> + * ISB instruction after programming the trace unit registers.
> + *
> + * For the memory-mapped interface, the registers are mapped as Device
> + * type (Device-nGnRE). Reading back the value of any register in the
> + * trace unit ensures that all writes have completed. Therefore, polling
> + * on TRCSTATR guarantees that the writing TRCPRGCTLR is complete, and
> + * no explicit dsb() is required at here.
> */
> - dsb(sy);
> isb();
>
> return 0;
> @@ -974,8 +980,15 @@ static void etm4_disable_trace_unit(struct etmv4_drvdata *drvdata)
> 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.
> + * As recommended in section 4.3.7 (Synchronization of register updates)
> + * of ARM IHI 0064H.b, the self-hosted trace analyzer always executes an
> + * ISB instruction after programming the trace unit registers.
> + *
> + * For the memory-mapped interface, the registers are mapped as Device
> + * type (Device-nGnRE). Reading back the value of any register in the
> + * trace unit ensures that all writes have completed. Therefore, polling
> + * on TRCSTATR guarantees that the writing TRCPRGCTLR is complete, and
> + * no explicit dsb() is required at here.
> */
> isb();
> }
>
> --
> 2.34.1
>
--
Sincerely,
Yeoreum Yun
next prev parent reply other threads:[~2025-11-10 11:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 16:49 [PATCH v5 00/11] CoreSight: Refactor power management for ETMv3/4 Leo Yan
2025-11-03 16:49 ` [PATCH v5 01/11] coresight: Change device mode to atomic type Leo Yan
2025-11-03 16:49 ` [PATCH v5 02/11] coresight: etm4x: Always set tracer's device mode on target CPU Leo Yan
2025-11-03 16:49 ` [PATCH v5 03/11] coresight: etm3x: " Leo Yan
2025-11-03 16:49 ` [PATCH v5 04/11] coresight: etm4x: Correct polling IDLE bit Leo Yan
2025-11-03 16:49 ` [PATCH v5 05/11] coresight: etm4x: Add context synchronization before enabling trace Leo Yan
2025-11-03 16:49 ` [PATCH v5 06/11] coresight: etm4x: Properly control filter in CPU idle with FEAT_TRF Leo Yan
2025-11-03 16:49 ` [PATCH v5 07/11] coresight: etm4x: Remove the redundant DSB Leo Yan
2025-11-10 11:47 ` Yeoreum Yun [this message]
2025-11-03 16:49 ` [PATCH v5 08/11] coresight: etm4x: Remove the state_needs_restore flag Leo Yan
2025-11-03 16:49 ` [PATCH v5 09/11] coresight: etm4x: Add flag to control single-shot restart Leo Yan
2025-11-10 11:37 ` Suzuki K Poulose
2025-11-11 9:24 ` Leo Yan
2025-11-11 9:43 ` Suzuki K Poulose
2025-11-11 10:18 ` Leo Yan
2025-11-11 11:37 ` Suzuki K Poulose
2025-11-11 13:52 ` Leo Yan
2025-11-03 16:49 ` [PATCH v5 10/11] coresight: etm4x: Retain sequencer state Leo Yan
2025-11-03 16:49 ` [PATCH v5 11/11] coresight: etm4x: Reuse normal enable and disable logic in CPU idle Leo Yan
2025-11-10 11:44 ` Suzuki K Poulose
2025-11-11 9:25 ` Leo Yan
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=aRHQ3/bXIBcbOkfP@e129823.arm.com \
--to=yeoreum.yun@arm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=james.clark@linaro.org \
--cc=keyz@google.com \
--cc=leo.yan@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mike.leach@linaro.org \
--cc=quic_yuanfang@quicinc.com \
--cc=suzuki.poulose@arm.com \
--cc=yabinc@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.