All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] irqchip: gic-v3-its: fix build for !SMP
@ 2022-01-22 15:16 Ard Biesheuvel
  2022-01-22 15:47 ` [irqchip: irq/irqchip-fixes] irqchip/gic-v3-its: Fix " irqchip-bot for Ard Biesheuvel
  2022-01-24 12:39 ` [PATCH] irqchip: gic-v3-its: fix " Valentin Schneider
  0 siblings, 2 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2022-01-22 15:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: maz, Ard Biesheuvel, Valentin Schneider

Commit 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state
lifetime") added a reference to cpus_booted_once_mask, which does not
exist on !SMP builds, breaking the build for such configurations.

Given the intent of the check, short circuit it to always pass.

Cc: Valentin Schneider <valentin.schneider@arm.com>
Fixes: 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/irqchip/irq-gic-v3-its.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index d25b7a864bbb..d2d61d89c3b8 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -5241,7 +5241,8 @@ static int its_cpu_memreserve_lpi(unsigned int cpu)
 
 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;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [irqchip: irq/irqchip-fixes] irqchip/gic-v3-its: Fix build for !SMP
  2022-01-22 15:16 [PATCH] irqchip: gic-v3-its: fix build for !SMP Ard Biesheuvel
@ 2022-01-22 15:47 ` irqchip-bot for Ard Biesheuvel
  2022-01-24 12:39 ` [PATCH] irqchip: gic-v3-its: fix " Valentin Schneider
  1 sibling, 0 replies; 3+ messages in thread
From: irqchip-bot for Ard Biesheuvel @ 2022-01-22 15:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: Valentin Schneider, Ard Biesheuvel, Marc Zyngier, tglx

The following commit has been merged into the irq/irqchip-fixes branch of irqchip:

Commit-ID:     16436f70abeebb29cd99444e27b310755806c1fa
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/16436f70abeebb29cd99444e27b310755806c1fa
Author:        Ard Biesheuvel <ardb@kernel.org>
AuthorDate:    Sat, 22 Jan 2022 16:16:14 +01:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Sat, 22 Jan 2022 15:42:49 

irqchip/gic-v3-its: Fix build for !SMP

Commit 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state
lifetime") added a reference to cpus_booted_once_mask, which does not
exist on !SMP builds, breaking the build for such configurations.

Given the intent of the check, short circuit it to always pass.

Cc: Valentin Schneider <valentin.schneider@arm.com>
Fixes: 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220122151614.133766-1-ardb@kernel.org
---
 drivers/irqchip/irq-gic-v3-its.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index ee83eb3..7b8f1ec 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -5241,7 +5241,8 @@ static int its_cpu_memreserve_lpi(unsigned int cpu)
 
 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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip: gic-v3-its: fix build for !SMP
  2022-01-22 15:16 [PATCH] irqchip: gic-v3-its: fix build for !SMP Ard Biesheuvel
  2022-01-22 15:47 ` [irqchip: irq/irqchip-fixes] irqchip/gic-v3-its: Fix " irqchip-bot for Ard Biesheuvel
@ 2022-01-24 12:39 ` Valentin Schneider
  1 sibling, 0 replies; 3+ messages in thread
From: Valentin Schneider @ 2022-01-24 12:39 UTC (permalink / raw)
  To: Ard Biesheuvel, linux-kernel; +Cc: maz, Ard Biesheuvel, Thomas Gleixner

On 22/01/22 16:16, Ard Biesheuvel wrote:
> Commit 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state
> lifetime") added a reference to cpus_booted_once_mask, which does not
> exist on !SMP builds, breaking the build for such configurations.
>
> Given the intent of the check, short circuit it to always pass.
>
> Cc: Valentin Schneider <valentin.schneider@arm.com>
> Fixes: 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime")
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Sorry about that, and thanks for the fix.

This looks fine to me, though one alternative to prevent future
IS_ENABLED() proliferations would be to make cpus_booted_once_mask exist
for !SMP - the online, active, present and possible masks exist for !SMP
already after all.

---
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 407a2568f35e..7487b7061f2c 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -84,9 +84,7 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = {
 	.fail = CPUHP_INVALID,
 };
 
-#ifdef CONFIG_SMP
 cpumask_t cpus_booted_once_mask;
-#endif
 
 #if defined(CONFIG_LOCKDEP) && defined(CONFIG_SMP)
 static struct lockdep_map cpuhp_state_up_map =
@@ -2662,9 +2660,7 @@ void __init boot_cpu_init(void)
  */
 void __init boot_cpu_hotplug_init(void)
 {
-#ifdef CONFIG_SMP
 	cpumask_set_cpu(smp_processor_id(), &cpus_booted_once_mask);
-#endif
 	this_cpu_write(cpuhp_state.state, CPUHP_ONLINE);
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-24 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-22 15:16 [PATCH] irqchip: gic-v3-its: fix build for !SMP Ard Biesheuvel
2022-01-22 15:47 ` [irqchip: irq/irqchip-fixes] irqchip/gic-v3-its: Fix " irqchip-bot for Ard Biesheuvel
2022-01-24 12:39 ` [PATCH] irqchip: gic-v3-its: fix " Valentin Schneider

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.