perf/arm_cspmu: Make IRQ more optional
authorRobin Murphy <robin.murphy@arm.com>
Thu, 16 Jul 2026 14:56:37 +0000 (15:56 +0100)
committerWill Deacon <will@kernel.org>
Sun, 2 Aug 2026 11:16:22 +0000 (11:16 +0000)
If we have 64-bit counters, we can reasonably assume we'll never have to
handle an overflow before the end of the universe (since we're a system
PMU with no sampling). Thus even if firmware does specify an IRQ, we can
still continue in the event of being unable to request it. This can help
systems where IRQs cannot be claimed exclusively, or are broken in other
ways.

Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm_cspmu/arm_cspmu.c

index d641119..1074225 100644 (file)
@@ -1256,8 +1256,11 @@ static int arm_cspmu_device_probe(struct platform_device *pdev)
                return ret;
 
        ret = arm_cspmu_request_irq(cspmu);
-       if (ret)
-               return ret;
+       if (ret) {
+               if (counter_size(cspmu) < 64)
+                       return ret;
+               dev_info(cspmu->dev, "Continuing without IRQ\n");
+       }
 
        ret = arm_cspmu_get_cpus(cspmu);
        if (ret)