[PATCH 4/4] perf: nvidia_t410_c2c: handle PERF_EF_UPDATE in stop

Besar Wicaksono bwicaksono at nvidia.com
Thu May 14 09:00:28 PDT 2026



> -----Original Message-----
> From: Saurav Sachidanand <sauravsc at amazon.com>
> Sent: Wednesday, May 13, 2026 8:06 PM
> To: Will Deacon <will at kernel.org>
> Cc: Mark Rutland <mark.rutland at arm.com>; Besar Wicaksono
> <bwicaksono at nvidia.com>; Ilkka Koskinen
> <ilkka at os.amperecomputing.com>; Andi Shyti <andi.shyti at kernel.org>; linux-
> arm-kernel at lists.infradead.org; linux-perf-users at vger.kernel.org; linux-
> kernel at vger.kernel.org; aghayev at amazon.com; juew at amazon.com; Saurav
> Sachidanand <sauravsc at amazon.com>
> Subject: [PATCH 4/4] perf: nvidia_t410_c2c: handle PERF_EF_UPDATE in stop
> 
> External email: Use caution opening links or attachments
> 
> 
> nv_c2c_pmu_stop() does not read the final counter value when called
> with PERF_EF_UPDATE. The last counter delta is lost when perf core
> removes the event.
> 
> Add the standard PMU stop pattern: bail out if already stopped, call
> nv_c2c_pmu_event_update() when PERF_EF_UPDATE is requested, then mark
> the event stopped.
> 
> Fixes: 2f89b7f78c50 ("perf: add NVIDIA Tegra410 C2C PMU")
> Signed-off-by: Saurav Sachidanand <sauravsc at amazon.com>
> ---
>  drivers/perf/nvidia_t410_c2c_pmu.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/perf/nvidia_t410_c2c_pmu.c
> b/drivers/perf/nvidia_t410_c2c_pmu.c
> index 662fa1bc833a5..39d0e661e4c5c 100644
> --- a/drivers/perf/nvidia_t410_c2c_pmu.c
> +++ b/drivers/perf/nvidia_t410_c2c_pmu.c
> @@ -394,6 +394,12 @@ static void nv_c2c_pmu_start(struct perf_event
> *event, int pmu_flags)
> 
>  static void nv_c2c_pmu_stop(struct perf_event *event, int pmu_flags)
>  {
> +       if (event->hw.state & PERF_HES_STOPPED)
> +               return;
> +
> +       if (pmu_flags & PERF_EF_UPDATE)
> +               nv_c2c_pmu_event_update(event);
> +

Hi Saurav,

This call is not needed since the driver called it on pmu_disable callback.
Adding it on stop callback would be redundant.

Regards,
Besar



More information about the linux-arm-kernel mailing list