[PATCH] powerpc: Fix spin_event_timeout() to be robust over context switches

Timur Tabi timur at freescale.com
Wed Jul 1 01:02:49 EST 2009


On Mon, Jun 29, 2009 at 6:40 PM, Grant Likely<grant.likely at secretlab.ca> wrote:
> From: Grant Likely <grant.likely at secretlab.ca>
>
> Current implementation of spin_event_timeout can be interrupted by an
> IRQ or context switch after testing the condition, but before checking
> the timeout.  This can cause the loop to report a timeout when the
> condition actually became true in the middle.
>
> This patch adds one final check of the condition upon exit of the loop
> if the last test of the condition was still false.
>
> Signed-off-by: Grant Likely <grant.likely at secretlab.ca>

Acked-by: Timur Tabi <timur at freescale.com>

Ben, please pick this up for the next rc of 2.6.31.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the Linuxppc-dev mailing list