diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-02-08 19:34:13 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-02-14 15:01:38 +1100 |
commit | 6fe5f5f3ffade25aa94526010f219df3be521bf7 (patch) | |
tree | 08b4148aad720793b37564c8ef8cdef0aea10241 /arch/powerpc/kernel/irq.c | |
parent | 7a768d30caa30e66ba89659f1845cc35b1bfc715 (diff) | |
download | lwn-6fe5f5f3ffade25aa94526010f219df3be521bf7.tar.gz lwn-6fe5f5f3ffade25aa94526010f219df3be521bf7.zip |
powerpc: Fix WARN_ON in decrementer_check_overflow
We use __get_cpu_var() which triggers a false positive warning
in smp_processor_id() thinking interrupts are enabled (at this
point, they are soft-enabled but hard-disabled).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/irq.c')
-rw-r--r-- | arch/powerpc/kernel/irq.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 701d4aceb4f4..01e2877e8e04 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -118,10 +118,14 @@ static inline notrace void set_soft_enabled(unsigned long enable) static inline notrace void decrementer_check_overflow(void) { u64 now = get_tb_or_rtc(); - u64 *next_tb = &__get_cpu_var(decrementers_next_tb); + u64 *next_tb; + + preempt_disable(); + next_tb = &__get_cpu_var(decrementers_next_tb); if (now >= *next_tb) set_dec(1); + preempt_enable(); } notrace void arch_local_irq_restore(unsigned long en) |