aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2006-03-08 14:50:12 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-27 10:48:11 -0500
commitd7a1bb0a04ca835bffc0a91e64ab827dfba7d8f5 (patch)
treef944d6ed6ecf23c59054b7f459e88f31f8da4235 /drivers/scsi
parent[SCSI] aacraid: remove x86_64 IOMMU dependent code (diff)
downloadlinux-dev-d7a1bb0a04ca835bffc0a91e64ab827dfba7d8f5.tar.xz
linux-dev-d7a1bb0a04ca835bffc0a91e64ab827dfba7d8f5.zip
[SCSI] Block I/O while SG reset operation in progress - the midlayer patch
The scsi midlayer portion of the patch Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/scsi_error.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 6a7a60fc0a4e..6683d596234a 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1672,7 +1672,9 @@ int
scsi_reset_provider(struct scsi_device *dev, int flag)
{
struct scsi_cmnd *scmd = scsi_get_command(dev, GFP_KERNEL);
+ struct Scsi_Host *shost = dev->host;
struct request req;
+ unsigned long flags;
int rtn;
scmd->request = &req;
@@ -1699,6 +1701,10 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
*/
scmd->pid = 0;
+ spin_lock_irqsave(shost->host_lock, flags);
+ shost->tmf_in_progress = 1;
+ spin_unlock_irqrestore(shost->host_lock, flags);
+
switch (flag) {
case SCSI_TRY_RESET_DEVICE:
rtn = scsi_try_bus_device_reset(scmd);
@@ -1717,6 +1723,22 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
rtn = FAILED;
}
+ spin_lock_irqsave(shost->host_lock, flags);
+ shost->tmf_in_progress = 0;
+ spin_unlock_irqrestore(shost->host_lock, flags);
+
+ /*
+ * be sure to wake up anyone who was sleeping or had their queue
+ * suspended while we performed the TMF.
+ */
+ SCSI_LOG_ERROR_RECOVERY(3,
+ printk("%s: waking up host to restart after TMF\n",
+ __FUNCTION__));
+
+ wake_up(&shost->host_wait);
+
+ scsi_run_host_queues(shost);
+
scsi_next_command(scmd);
return rtn;
}