Skip to contentSkip to conversation

paride/pg: replace pg_sleep() with msleep()

PATCH New Nishanth Aravamudan 1 participant 1 message Mar 2, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 paride/pg: replace pg_sleep() with msleep()

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.

drivers/block/paride/pg.c +2 -8
@@ -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);

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors