diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-05-28 13:57:14 +0200 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-17 19:05:18 +0200 |
commit | df0ae2497ddefd72a87f3a3b34ff32455d7d4ae0 (patch) | |
tree | 552e02a44a21bd38db91729c85219542c2930ae2 /drivers/scsi/eata.c | |
parent | [SCSI] allow sleeping in ->eh_bus_reset_handler() (diff) | |
download | linux-df0ae2497ddefd72a87f3a3b34ff32455d7d4ae0.tar.xz linux-df0ae2497ddefd72a87f3a3b34ff32455d7d4ae0.zip |
[SCSI] allow sleeping in ->eh_host_reset_handler()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/eata.c')
-rw-r--r-- | drivers/scsi/eata.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index 8394529ba552..1bb8727eea3e 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c @@ -1948,16 +1948,20 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg) ha->board_name, SCarg->device->channel, SCarg->device->id, SCarg->device->lun, SCarg->pid); + spin_lock_irq(shost->host_lock); + if (SCarg->host_scribble == NULL) printk("%s: reset, pid %ld inactive.\n", ha->board_name, SCarg->pid); if (ha->in_reset) { printk("%s: reset, exit, already in reset.\n", ha->board_name); + spin_unlock_irq(shost->host_lock); return FAILED; } if (wait_on_busy(shost->io_port, MAXLOOP)) { printk("%s: reset, exit, timeout error.\n", ha->board_name); + spin_unlock_irq(shost->host_lock); return FAILED; } @@ -2012,6 +2016,7 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg) if (do_dma(shost->io_port, 0, RESET_PIO)) { printk("%s: reset, cannot reset, timeout error.\n", ha->board_name); + spin_unlock_irq(shost->host_lock); return FAILED; } @@ -2024,9 +2029,12 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg) ha->in_reset = 1; spin_unlock_irq(shost->host_lock); + + /* FIXME: use a sleep instead */ time = jiffies; while ((jiffies - time) < (10 * HZ) && limit++ < 200000) udelay(100L); + spin_lock_irq(shost->host_lock); printk("%s: reset, interrupts disabled, loops %d.\n", ha->board_name, limit); @@ -2076,6 +2084,7 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg) else printk("%s: reset, exit.\n", ha->board_name); + spin_unlock_irq(shost->host_lock); return SUCCESS; } |