Re: [PATCH 1/1] Char: ds1286, eliminate busy waiting

From: Jiri Slaby
Date: Tue Jul 29 2008 - 05:42:23 EST


Ralf Baechle napsal(a):
On Fri, Jul 25, 2008 at 07:49:58PM +0200, Jiri Slaby wrote:

ds1286_get_time(); is not called from atomic context, sleep for 20 ms is
better choice than a (home-made) busy waiting for such a situation.

Looks ok to me I guess. Though I don't really think it matters ...

I think RT people has different opinion ;).

The same condition also appears in drivers/char/rtc.c and maybe a few
others. Rtc.c has been copies and modified several times.

In rtc.c there is something completely different:
while (rtc_is_updating() != 0 &&
time_before(jiffies, uip_watchdog + 2*HZ/100))
cpu_relax();

It's a conditional busy-waiting. It reads the rtc status after each busy cycle while in the ds1286 there was
if (ds1286_is_updating() != 0)
while (time_before(jiffies, uip_watchdog + 2*HZ/100))
barrier();
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/