Commit ced54c08 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

cpuidle/powernv: avoid double irq enable coming out of idle

Since e1689795 ("cpuidle: Add common time keeping and irq enabling"),
cpuidle drivers are expected to return from ->enter with irqs disabled.

Update the cpuidle-powernv snooze and cede loops to disable irqs before
returning.
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent f1343d04
...@@ -51,8 +51,6 @@ static inline void idle_loop_epilog(unsigned long in_purr) ...@@ -51,8 +51,6 @@ static inline void idle_loop_epilog(unsigned long in_purr)
get_lppaca()->wait_state_cycles = cpu_to_be64(wait_cycles); get_lppaca()->wait_state_cycles = cpu_to_be64(wait_cycles);
get_lppaca()->idle = 0; get_lppaca()->idle = 0;
if (irqs_disabled())
local_irq_enable();
ppc64_runlatch_on(); ppc64_runlatch_on();
} }
...@@ -87,6 +85,8 @@ static int snooze_loop(struct cpuidle_device *dev, ...@@ -87,6 +85,8 @@ static int snooze_loop(struct cpuidle_device *dev,
HMT_medium(); HMT_medium();
clear_thread_flag(TIF_POLLING_NRFLAG); clear_thread_flag(TIF_POLLING_NRFLAG);
local_irq_disable();
idle_loop_epilog(in_purr); idle_loop_epilog(in_purr);
return index; return index;
...@@ -121,6 +121,7 @@ static int dedicated_cede_loop(struct cpuidle_device *dev, ...@@ -121,6 +121,7 @@ static int dedicated_cede_loop(struct cpuidle_device *dev,
HMT_medium(); HMT_medium();
check_and_cede_processor(); check_and_cede_processor();
local_irq_disable();
get_lppaca()->donate_dedicated_cpu = 0; get_lppaca()->donate_dedicated_cpu = 0;
idle_loop_epilog(in_purr); idle_loop_epilog(in_purr);
...@@ -145,6 +146,7 @@ static int shared_cede_loop(struct cpuidle_device *dev, ...@@ -145,6 +146,7 @@ static int shared_cede_loop(struct cpuidle_device *dev,
*/ */
check_and_cede_processor(); check_and_cede_processor();
local_irq_disable();
idle_loop_epilog(in_purr); idle_loop_epilog(in_purr);
return index; return index;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment