All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 04/12] block/xd: replace schedule_timeout() with msleep()
@ 2005-06-20 21:51 domen
  2005-06-21 11:39 ` Maciej W. Rozycki
  0 siblings, 1 reply; 7+ messages in thread
From: domen @ 2005-06-20 21:51 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel, Nishanth Aravamudan, domen

[-- Attachment #1: msleep-drivers_block_xd2.patch --]
[-- Type: text/plain, Size: 1323 bytes --]

From: Nishanth Aravamudan <nacc@us.ibm.com>



Use msleep() instead of schedule_timeout() to guarantee the task
delays as expected. The current code wishes to sleep for 1 jiffy, but I am not
sure if this is actually intended, as with the change to HZ=1000, the time
equivalent of 1 jiffy changed from 10ms to 1ms. I have assumed the former in
this case; however the patch can be easily changed to assume the latter.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---
 xd.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Index: quilt/drivers/block/xd.c
===================================================================
--- quilt.orig/drivers/block/xd.c
+++ quilt/drivers/block/xd.c
@@ -47,6 +47,7 @@
 #include <linux/wait.h>
 #include <linux/blkdev.h>
 #include <linux/blkpg.h>
+#include <linux/delay.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -529,10 +530,8 @@ static inline u_char xd_waitport (u_shor
 	int success;
 
 	xdc_busy = 1;
-	while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry)) {
-		set_current_state(TASK_UNINTERRUPTIBLE);
-		schedule_timeout(1);
-	}
+	while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry))
+		msleep(10);
 	xdc_busy = 0;
 	return (success);
 }

--

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-06-21 18:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-20 21:51 [patch 04/12] block/xd: replace schedule_timeout() with msleep() domen
2005-06-21 11:39 ` Maciej W. Rozycki
2005-06-21 13:21   ` Domen Puncer
2005-06-21 13:53     ` Maciej W. Rozycki
2005-06-21 16:14       ` Nishanth Aravamudan
2005-06-21 16:43         ` Maciej W. Rozycki
2005-06-21 18:29           ` Nishanth Aravamudan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.