[PATCH 1/2] perf/arm_cspmu: nvidia: Reject missing TGT address-filter resource

Besar Wicaksono bwicaksono at nvidia.com
Tue Dec 1 17:15:06 PST 2026


Thanks for the fix Jiangtian.

Reviewed-by: Besar Wicaksono bwicaksono at nvidia.com

Regards,
Besar

> -----Original Message-----
> From: Jiangtian Feng <jiangtianfeng at linux.alibaba.com>
> Sent: Friday, November 27, 2026 7:10 AM
> To: Will Deacon <will at kernel.org>; Mark Rutland <mark.rutland at arm.com>;
> Besar Wicaksono <bwicaksono at nvidia.com>
> Cc: Robin Murphy <robin.murphy at arm.com>; linux-arm-
> kernel at lists.infradead.org; linux-perf-users at vger.kernel.org; linux-
> kernel at vger.kernel.org; jiangtianfeng at linux.alibaba.com
> Subject: [PATCH 1/2] perf/arm_cspmu: nvidia: Reject missing TGT address-
> filter resource
> 
> External email: Use caution opening links or attachments
> 
> 
> acpi_dev_get_memory_resources() can return 0 with an empty resource list.
> In that case pcie_tgt_init_data() leaves addr_filter_reg as NULL but
> returns success. A later address-filter event then writes to registers
> computed from that NULL base.
> 
> Reject an empty resource list with -ENODEV and keep the existing ioremap
> error propagation. This turns missing firmware resources into a probe
> failure instead of a runtime invalid MMIO access.
> 
> Qoder, an AI coding assistant, helped analyze the issue, develop the fix
> and source-derived state model, and draft this description.
> 
> Fixes: 3dd73022306b ("perf/arm_cspmu: nvidia: Add Tegra410 PCIE-TGT
> PMU")
> Signed-off-by: Jiangtian Feng <jiangtianfeng at linux.alibaba.com>
> ---
>  drivers/perf/arm_cspmu/nvidia_cspmu.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/perf/arm_cspmu/nvidia_cspmu.c
> b/drivers/perf/arm_cspmu/nvidia_cspmu.c
> index af256f662731..a0257dc3249d 100644
> --- a/drivers/perf/arm_cspmu/nvidia_cspmu.c
> +++ b/drivers/perf/arm_cspmu/nvidia_cspmu.c
> @@ -555,7 +555,10 @@ static int pcie_tgt_init_data(struct arm_cspmu
> *cspmu)
> 
>         rentry = list_first_entry_or_null(
>                 &resource_list, struct resource_entry, node);
> -       if (rentry) {
> +       if (!rentry) {
> +               dev_err(dev, "no address filter resource\n");
> +               ret = -ENODEV;
> +       } else {
>                 data->addr_filter_reg = devm_ioremap_resource(dev, rentry->res);
>                 ret = 0;
>         }
> --
> 2.47.3




More information about the linux-arm-kernel mailing list