[PATCH v5] introduce macro spin_event_timeout()

Timur Tabi timur at freescale.com
Thu Mar 12 06:14:59 EST 2009


On Wed, Mar 11, 2009 at 11:51 AM, Scott Wood <scottwood at freescale.com> wrote:

> One jiffy is fine, but two is just too long?

Any number of jiffies is *not* too long if a timeout occurs.  However,
I think even one jiffy is too long if that's the normal condition.
Unfortunately, the driver may not have any choice in some
circumstances.  If the hardware is just too slow to respond, and it
doesn't provide interrupts, but the code is running in atomic context,
and the function what else can it do?

> Disallow that, enforced with a call to might_sleep().

I think we need to be able to allow this function to work in atomic
context.  Is jiffies updated in atomic context?

> Alternatively, do something with get_cycles(), and have some sort of #define
> by which arches can say if get_cycles actually works.  In the absence of a
> working get_cycles() or equivalent, timeouts with interrupts disabled aren't
> going to happen whether we abstract it with a macro or not.

I think I can live with that.

-- 
Timur Tabi
Linux kernel developer at Freescale



More information about the Linuxppc-dev mailing list