[Linux-parport] [PATCH] paride/pg: replace pg_sleep() with msleep()
Nishanth Aravamudan
nacc at us.ibm.com
Wed Mar 2 14:57:24 EST 2005
Hi,
Just had a quick revelation that pg_sleep()'s parameter being labelled
as ``cs'' indicated centiseconds, which is the schedular quantum when
HZ=100. But the current driver does not account for other values of HZ.
Description: Use msleep() instead of pg_sleep() to guarantee the task
delays as expected. Remove the now unused pg_sleep() definition.
pg_sleep()'s units were centiseconds, so the corresponding parameters to
msleep() were multiplied by 10. Patch is compile-tested.
Signed-off-by: Nishanth Aravamudan <nacc at us.ibm.com>
--- 2.6.11-kj-v/drivers/block/paride/pg.c 2005-03-02 11:21:41.000000000 -0800
+++ 2.6.11-kj/drivers/block/paride/pg.c 2005-03-02 11:53:36.000000000 -0800
@@ -293,12 +293,6 @@ static inline u8 DRIVE(struct pg *dev)
return 0xa0+0x10*dev->drive;
}
-static void pg_sleep(int cs)
-{
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(cs);
-}
-
static int pg_wait(struct pg *dev, int go, int stop, unsigned long tmo, char *msg)
{
int j, r, e, s, p, to;
@@ -311,7 +305,7 @@ static int pg_wait(struct pg *dev, int g
if (j++ < PG_SPIN)
udelay(PG_SPIN_DEL);
else
- pg_sleep(1);
+ msleep(10);
}
to = time_after_eq(jiffies, tmo);
@@ -413,7 +407,7 @@ static int pg_reset(struct pg *dev)
k = 0;
while ((k++ < PG_RESET_TMO) && (status_reg(dev) & STAT_BUSY))
- pg_sleep(1);
+ msleep(10);
for (i = 0; i < 5; i++)
got[i] = read_reg(dev, i + 1);
More information about the Linux-parport
mailing list