aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ide-scsi.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-05-28 07:57:14 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-17 13:05:18 -0400
commitdf0ae2497ddefd72a87f3a3b34ff32455d7d4ae0 (patch)
tree552e02a44a21bd38db91729c85219542c2930ae2 /drivers/scsi/ide-scsi.c
parent68b3aa7c9805aee9005a8ca53c5e99177961fbb9 (diff)
[SCSI] allow sleeping in ->eh_host_reset_handler()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r--drivers/scsi/ide-scsi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 83f062ed9082..3d62c9bcbff7 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -46,6 +46,7 @@
46#include <linux/slab.h> 46#include <linux/slab.h>
47#include <linux/ide.h> 47#include <linux/ide.h>
48#include <linux/scatterlist.h> 48#include <linux/scatterlist.h>
49#include <linux/delay.h>
49 50
50#include <asm/io.h> 51#include <asm/io.h>
51#include <asm/bitops.h> 52#include <asm/bitops.h>
@@ -1026,11 +1027,13 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
1026 return FAILED; 1027 return FAILED;
1027 } 1028 }
1028 1029
1029 spin_lock_irq(&ide_lock); 1030 spin_lock_irq(cmd->device->host->host_lock);
1031 spin_lock(&ide_lock);
1030 1032
1031 if (!scsi->pc || (req = scsi->pc->rq) != HWGROUP(drive)->rq || !HWGROUP(drive)->handler) { 1033 if (!scsi->pc || (req = scsi->pc->rq) != HWGROUP(drive)->rq || !HWGROUP(drive)->handler) {
1032 printk (KERN_WARNING "ide-scsi: No active request in idescsi_eh_reset\n"); 1034 printk (KERN_WARNING "ide-scsi: No active request in idescsi_eh_reset\n");
1033 spin_unlock(&ide_lock); 1035 spin_unlock(&ide_lock);
1036 spin_unlock_irq(cmd->device->host->host_lock);
1034 return FAILED; 1037 return FAILED;
1035 } 1038 }
1036 1039
@@ -1052,16 +1055,15 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
1052 HWGROUP(drive)->rq = NULL; 1055 HWGROUP(drive)->rq = NULL;
1053 HWGROUP(drive)->handler = NULL; 1056 HWGROUP(drive)->handler = NULL;
1054 HWGROUP(drive)->busy = 1; /* will set this to zero when ide reset finished */ 1057 HWGROUP(drive)->busy = 1; /* will set this to zero when ide reset finished */
1055 spin_unlock_irq(&ide_lock); 1058 spin_unlock(&ide_lock);
1056 1059
1057 ide_do_reset(drive); 1060 ide_do_reset(drive);
1058 1061
1059 /* ide_do_reset starts a polling handler which restarts itself every 50ms until the reset finishes */ 1062 /* ide_do_reset starts a polling handler which restarts itself every 50ms until the reset finishes */
1060 1063
1061 do { 1064 do {
1062 set_current_state(TASK_UNINTERRUPTIBLE);
1063 spin_unlock_irq(cmd->device->host->host_lock); 1065 spin_unlock_irq(cmd->device->host->host_lock);
1064 schedule_timeout(HZ/20); 1066 msleep(50);
1065 spin_lock_irq(cmd->device->host->host_lock); 1067 spin_lock_irq(cmd->device->host->host_lock);
1066 } while ( HWGROUP(drive)->handler ); 1068 } while ( HWGROUP(drive)->handler );
1067 1069
@@ -1072,6 +1074,7 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
1072 ret = FAILED; 1074 ret = FAILED;
1073 } 1075 }
1074 1076
1077 spin_unlock_irq(cmd->device->host->host_lock);
1075 return ret; 1078 return ret;
1076} 1079}
1077 1080