[Cbe-oss-dev] No Subject
Benjamin Herrenschmidt
benh at kernel.crashing.org
Tue Feb 26 16:43:05 EST 2008
On Tue, 2008-02-26 at 06:14 +0100, Arnd Bergmann wrote:
> There is a small race between the context save procedure
> and the SPU interrupt handling, where we expect all interrupt
> processing to have finished after disabling them, while
> an interrupt is still being processed on another CPU.
>
> The obvious fix is to call synchronize_irq() after disabling
> the interrupts at the start of the context save procedure
> to make sure we never access the SPU any more during an
> ongoing save or even after that.
>
> Thanks to Benjamin Herrenschmidt for pointing this out.
For those really curious... the interrupt might -still- be latched in
the PIC and thus might still fire. However, we know that any previously
started interrupt is completed. The context switch code will clear the
chip irq mask with a lock and the interrupt code will check that mask
with the same lock, and not do any damage if the mask is clear.
Thus we can still get a stale interrupt, but it will be harmless.
Without the patch, we could race with a concurrently started interrupt
which is what synchronize_irq() is fixing.
Ben.
More information about the cbe-oss-dev
mailing list