Skip to contentSkip to conversation

irqchip/gic-v3-its: protect reference to cpus_booted_once_mask

PATCH In review Randy Dunlap 2 participants 2 messages Jan 22, 2022 – Jan 23, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip/gic-v3-its: protect reference to cpus_booted_once_mask

When CONFIG_SMP is not set/enabled, the reference in irq-gic-v3-its.c to 'cpus_booted_once_mask' causes a build error. Fix this by first checking for !CONFIG_SMP in the 'if' test.

Fixes this build error:

arm-linux-gnueabi-ld: drivers/irqchip/irq-gic-v3-its.o: in function `its_cpu_memreserve_lpi':
irq-gic-v3-its.c:(.text+0x45d0): undefined reference to `cpus_booted_once_mask'

Fixes 835f442fdbce3 ("irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime")
Cc Valentin Schneider <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 drivers/irqchip/irq-gic-v3-its.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +2 -1
@@ -5241,7 +5241,8 @@ static int its_cpu_memreserve_lpi(unsign
 
 out:
 	/* Last CPU being brought up gets to issue the cleanup */
-	if (cpumask_equal(&cpus_booted_once_mask, cpu_possible_mask))
+	if (!IS_ENABLED(CONFIG_SMP) ||
+	    cpumask_equal(&cpus_booted_once_mask, cpu_possible_mask))
 		schedule_work(&rdist_memreserve_cpuhp_cleanup_work);
 
 	gic_data_rdist()->flags |= RD_LOCAL_MEMRESERVE_DONE;
maintainer
#1 lore raw
Quoted 24 lines · Randy Dunlap

When CONFIG_SMP is not set/enabled, the reference in irq-gic-v3-its.c to 'cpus_booted_once_mask' causes a build error. Fix this by first checking for !CONFIG_SMP in the 'if' test.

Fixes this build error:

arm-linux-gnueabi-ld: drivers/irqchip/irq-gic-v3-its.o: in function `its_cpu_memreserve_lpi':
irq-gic-v3-its.c:(.text+0x45d0): undefined reference to `cpus_booted_once_mask'

Fixes 835f442fdbce3 ("irqchip/gic-v3-its: Limit memreserve cpuhp

state lifetime")

Cc Valentin Schneider <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 drivers/irqchip/irq-gic-v3-its.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

drivers/irqchip/irq-gic-v3-its.c static int its_cpu_memreserve_lpi(unsign · line 5248

Quoted 9 lines
drivers/irqchip/irq-gic-v3-its.c +2 -1
@@ -5241,7 +5241,8 @@ static int its_cpu_memreserve_lpi(unsign
 
 out:
 	/* Last CPU being brought up gets to issue the cleanup */
-	if (cpumask_equal(&cpus_booted_once_mask, cpu_possible_mask))
+	if (!IS_ENABLED(CONFIG_SMP) ||
+	    cpumask_equal(&cpus_booted_once_mask, cpu_possible_mask))
 		schedule_work(&rdist_memreserve_cpuhp_cleanup_work);
 
 	gic_data_rdist()->flags |= RD_LOCAL_MEMRESERVE_DONE;

This exact patch[1] has been queued yesterday.

Thanks,

        M.

[1] https://lore.kernel.org/r/[email protected]

Signature · 1 line
Jazz is not dead. It just smells funny...