Skip to contentSkip to conversation

drivers/perf: arm-pmu: Fix handling of SPI lacking "interrupt-affinity" property

PATCH New Marc Zyngier 3 participants 4 messages Jul 19, 2016 – Aug 30, 2016 Arm PMU profiling and debugging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/perf: arm-pmu: Fix handling of SPI lacking "interrupt-affinity" property

Patch 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt affinity mask") added support for partitionned PPI setups, but inadvertently broke setups using SPIs without the "interrupt-affinity" property (which is the case for UP platforms).

This patch restore the broken functionnality by testing whether the interrupt is percpu or not instead of relying on the using_spi flag that really means "SPI *and* interrupt-affinity property".

Fixes 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt affinity mask")
---
 drivers/perf/arm_pmu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/perf/arm_pmu.c +4 -3
index 2513365..9275e08 100644
@@ -958,11 +958,12 @@ static int of_pmu_irq_cfg(struct arm_pmu *pmu)
 
 	/* If we didn't manage to parse anything, try the interrupt affinity */
 	if (cpumask_weight(&pmu->supported_cpus) == 0) {
-		if (!using_spi) {
+		int irq = platform_get_irq(pdev, 0);
+
+		if (irq_is_percpu(irq)) {
 			/* If using PPIs, check the affinity of the partition */
-			int ret, irq;
+			int ret;
 
-			irq = platform_get_irq(pdev, 0);
 			ret = irq_get_percpu_devid_partition(irq, &pmu->supported_cpus);
 			if (ret) {
 				kfree(irqs);
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 drivers/perf: arm-pmu: Fix handling of SPI lacking "interrupt-affinity" property

Quoted 9 lines · Marc Zyngier

Patch 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt affinity mask") added support for partitionned PPI setups, but inadvertently broke setups using SPIs without the "interrupt-affinity" property (which is the case for UP platforms).

This patch restore the broken functionnality by testing whether the interrupt is percpu or not instead of relying on the using_spi flag that really means "SPI *and* interrupt-affinity property".

Quoted 7 lines
Fixes 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt affinity mask")
---
 drivers/perf/arm_pmu.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Thanks, looks good to me:

Catalin, can you pick this up, please?

Will

#2 lore raw

PATCH 1/1 drivers/perf: arm-pmu: Fix handling of SPI lacking "interrupt-affinity" property

In reply to Marc Zyngier

Hi Marc,

Quoted 5 lines · Marc Zyngier

Patch 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt affinity mask") added support for partitionned PPI setups, but inadvertently broke setups using SPIs without the "interrupt-affinity" property (which is the case for UP platforms).

Quoted 8 lines

This patch restore the broken functionnality by testing whether the interrupt is percpu or not instead of relying on the using_spi flag that really means "SPI *and* interrupt-affinity property".

Fixes 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt affinity mask")

kernelci.org detected boot failures on bcm2835-rpi-b in mainline[1] and was bisected down to this patch. I verified that reverting this patch on top of mainline gets bcm2835-rpi-b booting again.

I haven't been closely tracking this change, but a quick glance and it looks like this platform is possibly missing IRQ properties from its PMU node? The DT for this platform simply has:

        arm-pmu {
            compatible = "arm,arm1176-pmu";
        };

Kevin

[1] https://kernelci.org/boot/id/57bb4d9259b514895348b564/

#3 lore raw

PATCH 1/1 drivers/perf: arm-pmu: Fix handling of SPI lacking "interrupt-affinity" property

Hi Kevin,

Thanks for reporting this.

Quoted 19 lines · Kevin Hilman
Quoted 5 lines · Marc Zyngier

Patch 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt affinity mask") added support for partitionned PPI setups, but inadvertently broke setups using SPIs without the "interrupt-affinity" property (which is the case for UP platforms).

Quoted 8 lines

This patch restore the broken functionnality by testing whether the interrupt is percpu or not instead of relying on the using_spi flag that really means "SPI *and* interrupt-affinity property".

Fixes 19a469a58720 ("drivers/perf: arm-pmu: Handle per-interrupt affinity mask")

kernelci.org detected boot failures on bcm2835-rpi-b in mainline[1] and was bisected down to this patch. I verified that reverting this patch on top of mainline gets bcm2835-rpi-b booting again.

Quoted 7 lines

I haven't been closely tracking this change, but a quick glance and it looks like this platform is possibly missing IRQ properties from its PMU node? The DT for this platform simply has:

        arm-pmu {
            compatible = "arm,arm1176-pmu";
        };

Stefan Wahren posted a fix for this, so I've queued it locally and plan to send via Catalin:

http://lists.infradead.org/pipermail/linux-arm-kernel/2016-August/452475.html

Will