On Fri, Mar 6, 2009 at 7:11 PM, Roland Dreier <rdreier@xxxxxxxxx> wrote:
> The function spin_event_timeout() takes a condition and timeout value
> (in jiffies) as parameters. It spins until either the condition is true
> or the timeout expires. It returns non-zero if the condition is true,
> zero otherwise.
What's the motivation for this? Where do you plan to use it?
I expect it would be useful for drivers that need to wait until a
specific register has changed its value, but don't want to risk an
infinite loop if the hardware is not functioning. For example, to
replace the while loop and subsequent check in this code: