From: Yicong Yang <yangyccccc@gmail.com>
To: "Pradhan, Sanman" <sanman.pradhan@hpe.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: yangyccccc@gmail.com,
"jonathan.cameron@huawei.com" <jonathan.cameron@huawei.com>,
"alexander.shishkin@linux.intel.com"
<alexander.shishkin@linux.intel.com>,
Sanman Pradhan <psanman@juniper.net>,
shenyang39@huawei.com, prime.zeng@hisilicon.com
Subject: Re: [PATCH 2/2] hwtracing: hisi_ptt: Remove unnecessary trace buffer zeroing in trace_start()
Date: Tue, 14 Apr 2026 00:19:50 +0800 [thread overview]
Message-ID: <3e45cbb7-70a6-438b-972e-f6f16a73cee5@gmail.com> (raw)
In-Reply-To: <20260409010704.383882-3-sanman.pradhan@hpe.com>
On 2026/4/9 09:07, Pradhan, Sanman wrote:
> From: Sanman Pradhan <psanman@juniper.net>
>
> 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>
> ---
> drivers/hwtracing/ptt/hisi_ptt.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c
> index 73b93df8504c4..cbfbd1f146ba3 100644
> --- a/drivers/hwtracing/ptt/hisi_ptt.c
> +++ b/drivers/hwtracing/ptt/hisi_ptt.c
> @@ -195,7 +195,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 ret;
> - int i;
>
> /* Check device idle before start trace */
> if (!hisi_ptt_wait_trace_hw_idle(hisi_ptt)) {
> @@ -221,10 +220,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);
prev parent reply other threads:[~2026-04-13 16:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 1:07 [PATCH 0/2] hwtracing: hisi_ptt: Fix reset timeout handling and clean up trace start Pradhan, Sanman
2026-04-09 1:07 ` [PATCH 1/2] hwtracing: hisi_ptt: Propagate DMA reset timeout in trace_start() Pradhan, Sanman
2026-04-13 16:17 ` Yicong Yang
2026-04-14 16:24 ` Pradhan, Sanman
2026-04-09 1:07 ` [PATCH 2/2] hwtracing: hisi_ptt: Remove unnecessary trace buffer zeroing " Pradhan, Sanman
2026-04-13 16:19 ` Yicong Yang [this message]
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=3e45cbb7-70a6-438b-972e-f6f16a73cee5@gmail.com \
--to=yangyccccc@gmail.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=prime.zeng@hisilicon.com \
--cc=psanman@juniper.net \
--cc=sanman.pradhan@hpe.com \
--cc=shenyang39@huawei.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®