diff options
author | Peter Zijlstra <[email protected]> | 2023-01-12 20:43:35 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2023-01-13 11:48:15 +0100 |
commit | 89b3098703bd2aa3237ef10a704e6a5838e6ea69 (patch) | |
tree | 10d881133134e9ead2c7478b2d353a958f5f7c0f /arch/sparc/kernel/leon_pmc.c | |
parent | 9b461a6faae7b220c32466261965778b10189e54 (diff) |
arch/idle: Change arch_cpu_idle() behavior: always exit with IRQs disabled
Current arch_cpu_idle() is called with IRQs disabled, but will return
with IRQs enabled.
However, the very first thing the generic code does after calling
arch_cpu_idle() is raw_local_irq_disable(). This means that
architectures that can idle with IRQs disabled end up doing a
pointless 'enable-disable' dance.
Therefore, push this IRQ disabling into the idle function, meaning
that those architectures can avoid the pointless IRQ state flipping.
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Tested-by: Tony Lindgren <[email protected]>
Tested-by: Ulf Hansson <[email protected]>
Reviewed-by: Gautham R. Shenoy <[email protected]>
Acked-by: Mark Rutland <[email protected]> [arm64]
Acked-by: Rafael J. Wysocki <[email protected]>
Acked-by: Guo Ren <[email protected]>
Acked-by: Frederic Weisbecker <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'arch/sparc/kernel/leon_pmc.c')
-rw-r--r-- | arch/sparc/kernel/leon_pmc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sparc/kernel/leon_pmc.c b/arch/sparc/kernel/leon_pmc.c index 396f46bca52e..6c00cbad7fb5 100644 --- a/arch/sparc/kernel/leon_pmc.c +++ b/arch/sparc/kernel/leon_pmc.c @@ -57,6 +57,8 @@ static void pmc_leon_idle_fixup(void) "lda [%0] %1, %%g0\n" : : "r"(address), "i"(ASI_LEON_BYPASS)); + + raw_local_irq_disable(); } /* @@ -70,6 +72,8 @@ static void pmc_leon_idle(void) /* For systems without power-down, this will be no-op */ __asm__ __volatile__ ("wr %g0, %asr19\n\t"); + + raw_local_irq_disable(); } /* Install LEON Power Down function */ |