summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanman Pradhan <psanman@juniper.net>2026-04-14 17:25:22 +0000
committerSuzuki K Poulose <suzuki.poulose@arm.com>2026-08-07 10:45:11 +0100
commit856119909d8de99d540edbdfb5431efab936f649 (patch)
treea444655abe895217dbabef99e9cdbadd73b025b6
parent75d42d990335322852ed5f7ce324b701c0949d79 (diff)
downloadlinux-stable-856119909d8de99d540edbdfb5431efab936f649.tar.gz
linux-stable-856119909d8de99d540edbdfb5431efab936f649.zip
hwtracing: hisi_ptt: Remove unnecessary trace buffer zeroing in trace_start()
hisi_ptt_trace_start() clears all four trace buffers before enabling tracing. This is unnecessary. On trace stop, hisi_ptt_update_aux() copies only the number of bytes reported in HISI_PTT_TRACE_WR_STS. On buffer-full interrupts, it copies a full completed buffer. In both cases the driver only consumes data written by hardware. Remove the buffer clearing from the trace start path. Signed-off-by: Sanman Pradhan <psanman@juniper.net> Reviewed-by: Yicong Yang <yangyccccc@gmail.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20260414172451.14331-3-sanman.pradhan@hpe.com
-rw-r--r--drivers/hwtracing/ptt/hisi_ptt.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c
index b5d851281fbf..a8f6986c8e1f 100644
--- a/drivers/hwtracing/ptt/hisi_ptt.c
+++ b/drivers/hwtracing/ptt/hisi_ptt.c
@@ -194,7 +194,6 @@ static int hisi_ptt_trace_start(struct hisi_ptt *hisi_ptt)
{
struct hisi_ptt_trace_ctrl *ctrl = &hisi_ptt->trace_ctrl;
u32 val;
- int i;
/* Check device idle before start trace */
if (!hisi_ptt_wait_trace_hw_idle(hisi_ptt)) {
@@ -222,10 +221,6 @@ static int hisi_ptt_trace_start(struct hisi_ptt *hisi_ptt)
/* Reset the index of current buffer */
hisi_ptt->trace_ctrl.buf_index = 0;
- /* Zero the trace buffers */
- for (i = 0; i < HISI_PTT_TRACE_BUF_CNT; i++)
- memset(ctrl->trace_buf[i].addr, 0, HISI_PTT_TRACE_BUF_SIZE);
-
/* Clear the interrupt status */
writel(HISI_PTT_TRACE_INT_STAT_MASK, hisi_ptt->iobase + HISI_PTT_TRACE_INT_STAT);
writel(0, hisi_ptt->iobase + HISI_PTT_TRACE_INT_MASK);