Re: [PATCH v6] introduce macro spin_event_timeout()

2009-05-01 Thread Kumar Gala
On Apr 27, 2009, at 2:05 PM, 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.

Re: [PATCH v6] introduce macro spin_event_timeout()

2009-05-01 Thread Scott Wood
Kumar Gala wrote: I wouldn't call it spin_event_timeout as its a bit too generic of a name for something that is arch specific. The concept is not arch-specific -- ideally, other architectures could add their own implementations (or it could be made non-architecture-specific in the future).

Re: [PATCH v6] introduce macro spin_event_timeout()

2009-05-01 Thread Timur Tabi
Kumar Gala wrote: I wouldn't call it spin_event_timeout as its a bit too generic of a name for something that is arch specific. Well, I'm hoping it won't be arch-specific forever. I'd like to see other architectures implement something like tb_ticks_per_usec. I'm only tackling PowerPC for

Re: [PATCH v6] introduce macro spin_event_timeout()

2009-05-01 Thread Timur Tabi
Sean MacLennan wrote: Would cpu_relax be a good thing to put here? Something like: while (!(rc = (condition)) (tb_ticks_since(__start) = __loops)) \ if (delay) \ udelay(delay); \ else \ cpu_relax(); \ I had that at one point, but then I

Re: [PATCH v6] introduce macro spin_event_timeout()

2009-04-29 Thread Timur Tabi
On Mon, Apr 27, 2009 at 2:05 PM, Timur Tabi ti...@freescale.com 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

[PATCH v6] introduce macro spin_event_timeout()

2009-04-27 Thread Timur Tabi
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