aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/53c700.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-05-28 07:56:31 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-17 13:05:10 -0400
commit68b3aa7c9805aee9005a8ca53c5e99177961fbb9 (patch)
tree3f28891df0b3a1ecdfe6a98547d8f3c43b74e905 /drivers/scsi/53c700.c
parent94d0e7b805961c44e4dc486ffc21075084bb7175 (diff)
[SCSI] allow sleeping in ->eh_bus_reset_handler()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/53c700.c')
-rw-r--r--drivers/scsi/53c700.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index 8c64212e9608..47cf9bd55d90 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -1957,23 +1957,30 @@ NCR_700_bus_reset(struct scsi_cmnd * SCp)
1957 printk(KERN_INFO "scsi%d (%d:%d) New error handler wants BUS reset, cmd %p\n\t", 1957 printk(KERN_INFO "scsi%d (%d:%d) New error handler wants BUS reset, cmd %p\n\t",
1958 SCp->device->host->host_no, SCp->device->id, SCp->device->lun, SCp); 1958 SCp->device->host->host_no, SCp->device->id, SCp->device->lun, SCp);
1959 scsi_print_command(SCp); 1959 scsi_print_command(SCp);
1960
1960 /* In theory, eh_complete should always be null because the 1961 /* In theory, eh_complete should always be null because the
1961 * eh is single threaded, but just in case we're handling a 1962 * eh is single threaded, but just in case we're handling a
1962 * reset via sg or something */ 1963 * reset via sg or something */
1963 while(hostdata->eh_complete != NULL) { 1964 spin_lock_irq(SCp->device->host->host_lock);
1965 while (hostdata->eh_complete != NULL) {
1964 spin_unlock_irq(SCp->device->host->host_lock); 1966 spin_unlock_irq(SCp->device->host->host_lock);
1965 msleep_interruptible(100); 1967 msleep_interruptible(100);
1966 spin_lock_irq(SCp->device->host->host_lock); 1968 spin_lock_irq(SCp->device->host->host_lock);
1967 } 1969 }
1970
1968 hostdata->eh_complete = &complete; 1971 hostdata->eh_complete = &complete;
1969 NCR_700_internal_bus_reset(SCp->device->host); 1972 NCR_700_internal_bus_reset(SCp->device->host);
1973
1970 spin_unlock_irq(SCp->device->host->host_lock); 1974 spin_unlock_irq(SCp->device->host->host_lock);
1971 wait_for_completion(&complete); 1975 wait_for_completion(&complete);
1972 spin_lock_irq(SCp->device->host->host_lock); 1976 spin_lock_irq(SCp->device->host->host_lock);
1977
1973 hostdata->eh_complete = NULL; 1978 hostdata->eh_complete = NULL;
1974 /* Revalidate the transport parameters of the failing device */ 1979 /* Revalidate the transport parameters of the failing device */
1975 if(hostdata->fast) 1980 if(hostdata->fast)
1976 spi_schedule_dv_device(SCp->device); 1981 spi_schedule_dv_device(SCp->device);
1982
1983 spin_unlock_irq(SCp->device->host->host_lock);
1977 return SUCCESS; 1984 return SUCCESS;
1978} 1985}
1979 1986