aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xd.c
diff options
context:
space:
mode:
authorGreg KH <gregkh@suse.de>2005-09-12 15:45:04 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-12 15:45:04 -0400
commitd58dde0f552a5c5c4485b962d8b6e9dd54fefb30 (patch)
treed9a7e35eb88fea6265d5aadcc3d4ed39122b052a /drivers/block/xd.c
parent877599fdef5ea4a7dd1956e22fa9d6923add97f8 (diff)
parent2ade81473636b33aaac64495f89a7dc572c529f0 (diff)
Merge ../torvalds-2.6/
Diffstat (limited to 'drivers/block/xd.c')
-rw-r--r--drivers/block/xd.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 1676033da6c6..68b6d7b154cf 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 */
@@ -529,10 +530,8 @@ static inline u_char xd_waitport (u_short port,u_char flags,u_char mask,u_long t
529 int success; 530 int success;
530 531
531 xdc_busy = 1; 532 xdc_busy = 1;
532 while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry)) { 533 while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry))
533 set_current_state(TASK_UNINTERRUPTIBLE); 534 schedule_timeout_uninterruptible(1);
534 schedule_timeout(1);
535 }
536 xdc_busy = 0; 535 xdc_busy = 0;
537 return (success); 536 return (success);
538} 537}
@@ -633,14 +632,12 @@ static u_char __init xd_initdrives (void (*init_drive)(u_char drive))
633 for (i = 0; i < XD_MAXDRIVES; i++) { 632 for (i = 0; i < XD_MAXDRIVES; i++) {
634 xd_build(cmdblk,CMD_TESTREADY,i,0,0,0,0,0); 633 xd_build(cmdblk,CMD_TESTREADY,i,0,0,0,0,0);
635 if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT*8)) { 634 if (!xd_command(cmdblk,PIO_MODE,NULL,NULL,NULL,XD_TIMEOUT*8)) {
636 set_current_state(TASK_INTERRUPTIBLE); 635 msleep_interruptible(XD_INIT_DISK_DELAY);
637 schedule_timeout(XD_INIT_DISK_DELAY);
638 636
639 init_drive(count); 637 init_drive(count);
640 count++; 638 count++;
641 639
642 set_current_state(TASK_INTERRUPTIBLE); 640 msleep_interruptible(XD_INIT_DISK_DELAY);
643 schedule_timeout(XD_INIT_DISK_DELAY);
644 } 641 }
645 } 642 }
646 return (count); 643 return (count);
@@ -761,8 +758,7 @@ static void __init xd_wd_init_controller (unsigned int address)
761 758
762 outb(0,XD_RESET); /* reset the controller */ 759 outb(0,XD_RESET); /* reset the controller */
763 760
764 set_current_state(TASK_UNINTERRUPTIBLE); 761 msleep(XD_INIT_DISK_DELAY);
765 schedule_timeout(XD_INIT_DISK_DELAY);
766} 762}
767 763
768static void __init xd_wd_init_drive (u_char drive) 764static void __init xd_wd_init_drive (u_char drive)
@@ -936,8 +932,7 @@ If you need non-standard settings use the xd=... command */
936 xd_maxsectors = 0x01; 932 xd_maxsectors = 0x01;
937 outb(0,XD_RESET); /* reset the controller */ 933 outb(0,XD_RESET); /* reset the controller */
938 934
939 set_current_state(TASK_UNINTERRUPTIBLE); 935 msleep(XD_INIT_DISK_DELAY);
940 schedule_timeout(XD_INIT_DISK_DELAY);
941} 936}
942 937
943static void __init xd_xebec_init_drive (u_char drive) 938static void __init xd_xebec_init_drive (u_char drive)