[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ed82fe3e0903120854r2d8f23d8r249a8e510a2fbc4c@mail.gmail.com>
Date: Thu, 12 Mar 2009 10:54:47 -0500
From: Timur Tabi <timur@...escale.com>
To: Grant Likely <grant.likely@...retlab.ca>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
linux-kernel@...r.kernel.org, rdreier@...co.com,
jirislaby@...il.com, peterz@...radead.org, will.newton@...il.com,
hancockrwd@...il.com, jeremy@...p.org
Subject: Re: [PATCH v4] introduce macro spin_event_timeout()
On Wed, Mar 11, 2009 at 9:45 PM, Grant Likely <grant.likely@...retlab.ca> wrote:
>> The other big advantage of that approach is that drivers that aren't in
>> an atomic section can use msleep() and allow the kernel to schedule on
>> that processor.
>
> Ack! I totally agree.
I'm glad everyone agrees. I still don't know how to solve the
problem, though. I came up with this:
#define spin_until_timeout(condition, timeout) \
for (unsigned long __timeout = jiffies + (timeout); \
(!(condition) && time_after(jiffies, __timeout)); )
Now how do I modify this so that the caller knows whether the loop
terminated because of a timeout or the condition became true?
--
Timur Tabi
Linux kernel developer at Freescale
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists