diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-05-28 07:56:31 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-17 12:05:10 -0500 |
commit | 68b3aa7c9805aee9005a8ca53c5e99177961fbb9 (patch) | |
tree | 3f28891df0b3a1ecdfe6a98547d8f3c43b74e905 /drivers/scsi/53c700.c | |
parent | 94d0e7b805961c44e4dc486ffc21075084bb7175 (diff) | |
download | linux-next-68b3aa7c9805aee9005a8ca53c5e99177961fbb9.tar.gz |
[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.c | 9 |
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) printk(KERN_INFO "scsi%d (%d:%d) New error handler wants BUS reset, cmd %p\n\t", SCp->device->host->host_no, SCp->device->id, SCp->device->lun, SCp); scsi_print_command(SCp); + /* In theory, eh_complete should always be null because the * eh is single threaded, but just in case we're handling a * reset via sg or something */ - while(hostdata->eh_complete != NULL) { + spin_lock_irq(SCp->device->host->host_lock); + while (hostdata->eh_complete != NULL) { spin_unlock_irq(SCp->device->host->host_lock); msleep_interruptible(100); spin_lock_irq(SCp->device->host->host_lock); } + hostdata->eh_complete = &complete; NCR_700_internal_bus_reset(SCp->device->host); + spin_unlock_irq(SCp->device->host->host_lock); wait_for_completion(&complete); spin_lock_irq(SCp->device->host->host_lock); + hostdata->eh_complete = NULL; /* Revalidate the transport parameters of the failing device */ if(hostdata->fast) spi_schedule_dv_device(SCp->device); + + spin_unlock_irq(SCp->device->host->host_lock); return SUCCESS; } |