2008-03-08 04:38:25

by David Fries

[permalink] [raw]
Subject: [W1] ds1wm: testers please, msleep not udelay

I'm working on some patches to the one wire system I just need to
split them into small logical patches. I don't have the hardware to
test this ds1wm change. I wouldn't expect the delay here to be
critical, and on a handheld platform, I wouldn't think busywaiting for
such a long time to be a good idea. I also wouldn't expect putting
off reading the battery status a timer tick to matter much, so why not
sleep?

So, if someone would try out the patch and report back or tell me why
it's wrong I would appreciate it. If it looks good I'll submit the
patch with the rest of the one wire changes I'm working on.

Index: drivers/w1/masters/ds1wm.c
===================================================================
RCS file: /home/david/kernel/k/spacedout/patches/linux/drivers/w1/masters/ds1wm.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- drivers/w1/masters/ds1wm.c 2 Feb 2008 18:37:24 -0000 1.3
+++ drivers/w1/masters/ds1wm.c 15 Feb 2008 03:42:36 -0000 1.4
@@ -159,8 +159,10 @@ static int ds1wm_reset(struct ds1wm_data
* 625 us - 60 us - 240 us - 100 ns = 324.9 us
*
* We'll wait a bit longer just to be sure.
+ * Was udelay(500), but if it is going to busywait the cpu that long,
+ * might as well come back later.
*/
- udelay(500);
+ msleep(1);

ds1wm_write_register(ds1wm_data, DS1WM_INT_EN,
DS1WM_INTEN_ERBF | DS1WM_INTEN_ETMT | DS1WM_INTEN_EPD |

--
David Fries <[email protected]>
http://fries.net/~david/ (PGP encryption key available)