Skip to content

Commit

Permalink
powerpc: Make decrementer interrupt robust against offlined CPUs
Browse files Browse the repository at this point in the history
With some implementations, it is possible that a timer interrupt
occurs every few seconds on an offline CPU. In this case, just
re-arm the decrementer and return immediately

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
ozbenh committed Apr 1, 2011
1 parent ecb78ab commit 963e5d3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,21 @@ void timer_interrupt(struct pt_regs * regs)
struct clock_event_device *evt = &decrementer->event;
u64 now;

/* Ensure a positive value is written to the decrementer, or else
* some CPUs will continue to take decrementer exceptions.
*/
set_dec(DECREMENTER_MAX);

/* Some implementations of hotplug will get timer interrupts while
* offline, just ignore these
*/
if (!cpu_online(smp_processor_id()))
return;

trace_timer_interrupt_entry(regs);

__get_cpu_var(irq_stat).timer_irqs++;

/* Ensure a positive value is written to the decrementer, or else
* some CPUs will continuue to take decrementer exceptions */
set_dec(DECREMENTER_MAX);

#if defined(CONFIG_PPC32) && defined(CONFIG_PMAC)
if (atomic_read(&ppc_n_lost_interrupts) != 0)
do_IRQ(regs);
Expand Down

0 comments on commit 963e5d3

Please sign in to comment.