[PATCH 1/2] [PATCH 1/2 v9] powerpc: introduce macro spin_event_timeout()
Geoff Thorpe
Geoff.Thorpe at freescale.com
Wed May 27 05:25:23 EST 2009
Acked-by: Geoff Thorpe <Geoff.Thorpe at freescale.com>
Not sure that it's the most consistent formulation, but it's definitely
better than debating indefinitely.
Cheers,
Geoff
Timur Tabi wrote:
> The macro spin_event_timeout() takes a condition and timeout value
> (in microseconds) as parameters. It spins until either the condition is true
> or the timeout expires. It returns the result of the condition when the loop
> was terminated.
>
> This primary purpose of this macro is to poll on a hardware register until a
> status bit changes. The timeout ensures that the loop still terminates if the
> bit doesn't change as expected. This macro makes it easier for driver
> developers to perform this kind of operation properly.
>
> Signed-off-by: Timur Tabi <timur at freescale.com>
> ---
>
> v9: changed the macro to return the value, instead of having it passed in
[snip]
More information about the Linuxppc-dev
mailing list