aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xd.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-09-10 03:27:14 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 13:06:34 -0400
commitf6a2f3404a3b09281a264058fa8dd318bac51178 (patch)
tree2cb7925192d25932cade9dab4715fd13ad499c83 /drivers/block/xd.c
parent31a34571e5eed7cb1d70d5e7edd013261fe602e9 (diff)
[PATCH] janitor: block/xd: replace schedule_timeout() with msleep()/msleep_interruptible()
Use msleep() or msleep_interruptible() [as appropriate] instead of schedule_timeout() to gurantee the task delays as expected. As a result changed the units of the timeout variable from jiffies to msecs. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Maximilian Attems <janitor@sternwelten.at> Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/xd.c')
-rw-r--r--drivers/block/xd.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 1676033da6c6..2c6d3423496b 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -47,6 +47,7 @@
47#include <linux/wait.h> 47#include <linux/wait.h>
48#include <linux/blkdev.h> 48#include <linux/blkdev.h>
49#include <linux/blkpg.h> 49#include <linux/blkpg.h>
50#include <linux/delay.h>
50 51
51#include <asm/system.h> 52#include <asm/system.h>
52#include <asm/io.h> 53#include <asm/io.h>
@@ -62,7 +63,7 @@ static int xd[5] = { -1,-1,-1,-1, };
62 63
63#define XD_DONT_USE_DMA 0 /* Initial value. may be overriden using 64#define XD_DONT_USE_DMA 0 /* Initial value. may be overriden using
64 "nodma" module option */ 65 "nodma" module option */
65#define XD_INIT_DISK_DELAY (30*HZ/1000) /* 30 ms delay during disk initialization */ 66#define XD_INIT_DISK_DELAY (30) /* 30 ms delay during disk initialization */
66 67
67/* Above may need to be increased if a problem with the 2nd drive detection 68/* Above may need to be increased if a problem with the 2nd drive detection
68 (ST11M controller) or resetting a controller (WD) appears */ 69 (ST11M controller) or resetting a controller (WD) appears */
@@ -633,14 +634,12 @@ static u_char __init xd_initdrives (void (*init_drive)(u_char drive))
633 for (i = 0; i < XD_MAXDRIVES; i++) { 634 for (i = 0; i < XD_MAXDRIVES; i++) {
634 xd_build(cmdblk,CMD_TESTREADY,i,0,0,0,0,0); 635 xd_build(cmdblk,CMD_TESTREADY,i,0,0,0,0,0);
635 if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT*8)) { 636 if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT*8)) {
636 set_current_state(TASK_INTERRUPTIBLE); 637 msleep_interruptible(XD_INIT_DISK_DELAY);
637 schedule_timeout(XD_INIT_DISK_DELAY);
638 638
639 init_drive(count); 639 init_drive(count);
640 count++; 640 count++;
641 641
642 set_current_state(TASK_INTERRUPTIBLE); 642 msleep_interruptible(XD_INIT_DISK_DELAY);
643 schedule_timeout(XD_INIT_DISK_DELAY);
644 } 643 }
645 } 644 }
646 return (count); 645 return (count);
@@ -761,8 +760,7 @@ static void __init xd_wd_init_controller (unsigned int address)
761 760
762 outb(0,XD_RESET); /* reset the controller */ 761 outb(0,XD_RESET); /* reset the controller */
763 762
764 set_current_state(TASK_UNINTERRUPTIBLE); 763 msleep(XD_INIT_DISK_DELAY);
765 schedule_timeout(XD_INIT_DISK_DELAY);
766} 764}
767 765
768static void __init xd_wd_init_drive (u_char drive) 766static void __init xd_wd_init_drive (u_char drive)
@@ -936,8 +934,7 @@ If you need non-standard settings use the xd=... command */
936 xd_maxsectors = 0x01; 934 xd_maxsectors = 0x01;
937 outb(0,XD_RESET); /* reset the controller */ 935 outb(0,XD_RESET); /* reset the controller */
938 936
939 set_current_state(TASK_UNINTERRUPTIBLE); 937 msleep(XD_INIT_DISK_DELAY);
940 schedule_timeout(XD_INIT_DISK_DELAY);
941} 938}
942 939
943static void __init xd_xebec_init_drive (u_char drive) 940static void __init xd_xebec_init_drive (u_char drive)