[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fb3b495a-3e04-417f-a674-e1753fd85177@arm.com>
Date: Thu, 4 Dec 2025 18:27:27 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Leo Yan <leo.yan@....com>, Suzuki K Poulose <suzuki.poulose@....com>,
Mike Leach <mike.leach@...aro.org>, James Clark <james.clark@...aro.org>,
Yeoreum Yun <yeoreum.yun@....com>, Will Deacon <will@...nel.org>,
Mark Rutland <mark.rutland@....com>, Tamas Petz <tamas.petz@....com>,
Tamas Zsoldos <tamas.zsoldos@....com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>
Cc: coresight@...ts.linaro.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 05/19] coresight: trbe: Refactor status clearing
On 01/12/25 4:51 PM, Leo Yan wrote:
> If the driver does not clear the status when disabling the trace buffer
> unit, stale state will carry over to the next enable, though the driver
> clears it again on enable.
There is no problem now ! Because trbe_enable_hw() calls clr_trbe_status().
>
> Explicitly clear status after the trace is disabled in the interrupt
> handling and when a perf session ends. Keep the status for spurious
> interrupts for continuous tracing.
But is not that the behaviour already without this change ?
clr_trbe_status() in trbe_enable_hw() ensures that no TRBE session can be
started without first clearing the existing status. Still wondering what
is the purpose of this change ?
>
> Signed-off-by: Leo Yan <leo.yan@....com>
> ---
> drivers/hwtracing/coresight/coresight-trbe.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
> index e426991e2c2c398a9d3982e9d0f7f542e404cbab..9e565122816949b37b8ff5e4ba04cfbc317c6f25 100644
> --- a/drivers/hwtracing/coresight/coresight-trbe.c
> +++ b/drivers/hwtracing/coresight/coresight-trbe.c
> @@ -629,7 +629,6 @@ static void trbe_enable_hw(struct trbe_buf *buf)
> WARN_ON(buf->trbe_hw_base < buf->trbe_base);
> WARN_ON(buf->trbe_write < buf->trbe_hw_base);
> WARN_ON(buf->trbe_write >= buf->trbe_limit);
> - clr_trbe_status();
> set_trbe_base_pointer(buf->trbe_hw_base);
> set_trbe_write_pointer(buf->trbe_write);
>
> @@ -1036,6 +1035,8 @@ static int arm_trbe_disable(struct coresight_device *csdev)
> return -EINVAL;
>
> trbe_drain_and_disable_local(cpudata);
> + clr_trbe_status();
> +
> buf->cpudata = NULL;
> cpudata->buf = NULL;
> cpudata->mode = CS_MODE_DISABLED;
> @@ -1151,6 +1152,10 @@ static irqreturn_t arm_trbe_irq_handler(int irq, void *dev)
> return IRQ_NONE;
>
> act = trbe_get_fault_act(handle, status);
> +
> + if (act != TRBE_FAULT_ACT_SPURIOUS)
> + clr_trbe_status();
> +
> switch (act) {
> case TRBE_FAULT_ACT_WRAP:
> truncated = !!trbe_handle_overflow(handle);
>
Powered by blists - more mailing lists