[PATCH 4/8] perf/arm_cspmu: nvidia: Add Tegra410 PCIE PMU

Ilkka Koskinen ilkka at os.amperecomputing.com
Thu Jan 29 14:34:56 PST 2026


Hi Besar,

On Mon, 26 Jan 2026, Besar Wicaksono wrote:
> Adds PCIE PMU support in Tegra410 SOC.
>
> Signed-off-by: Besar Wicaksono <bwicaksono at nvidia.com>
> ---
> .../admin-guide/perf/nvidia-tegra410-pmu.rst  | 162 ++++++++++++++
> drivers/perf/arm_cspmu/nvidia_cspmu.c         | 208 +++++++++++++++++-
> 2 files changed, 368 insertions(+), 2 deletions(-)
>

<snip>

> diff --git a/drivers/perf/arm_cspmu/nvidia_cspmu.c b/drivers/perf/arm_cspmu/nvidia_cspmu.c
> index c67667097a3c..3a5531d1f94c 100644
> --- a/drivers/perf/arm_cspmu/nvidia_cspmu.c
> +++ b/drivers/perf/arm_cspmu/nvidia_cspmu.c

> @@ -453,7 +645,7 @@ static const struct nv_cspmu_match nv_cspmu_match[] = {
> static char *nv_cspmu_format_name(const struct arm_cspmu *cspmu,
> 				  const struct nv_cspmu_match *match)
> {
> -	char *name;
> +	char *name = NULL;

You can remove the assignment in the default branch below now.

Otherwise, the patch looks good to me

 	Reviewed-by: Ilkka Koskinen <ilkka at os.amperecomputing.com>

Cheers, Ilkka


> 	struct device *dev = cspmu->dev;
>
> 	static atomic_t pmu_generic_idx = {0};
> @@ -467,6 +659,16 @@ static char *nv_cspmu_format_name(const struct arm_cspmu *cspmu,
> 				       socket);
> 		break;
> 	}
> +	case NAME_FMT_SOCKET_INST: {
> +		const int cpu = cpumask_first(&cspmu->associated_cpus);
> +		const int socket = cpu_to_node(cpu);
> +		u32 inst_id;
> +
> +		if (!nv_cspmu_get_inst_id(cspmu, &inst_id))
> +			name = devm_kasprintf(dev, GFP_KERNEL,
> +					match->name_pattern, socket, inst_id);
> +		break;
> +	}
> 	case NAME_FMT_GENERIC:
> 		name = devm_kasprintf(dev, GFP_KERNEL, match->name_pattern,
> 				       atomic_fetch_inc(&pmu_generic_idx));
 		break;
 	default:
                 name = NULL;
                 ^^^^^^^^^^^^

                 break;
         }




More information about the linux-arm-kernel mailing list