aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/eata.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/eata.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/eata.c')
-rw-r--r--drivers/scsi/eata.c9
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)
1948 ha->board_name, SCarg->device->channel, SCarg->device->id, 1948 ha->board_name, SCarg->device->channel, SCarg->device->id,
1949 SCarg->device->lun, SCarg->pid); 1949 SCarg->device->lun, SCarg->pid);
1950 1950
1951 spin_lock_irq(shost->host_lock);
1952
1951 if (SCarg->host_scribble == NULL) 1953 if (SCarg->host_scribble == NULL)
1952 printk("%s: reset, pid %ld inactive.\n", ha->board_name, SCarg->pid); 1954 printk("%s: reset, pid %ld inactive.\n", ha->board_name, SCarg->pid);
1953 1955
1954 if (ha->in_reset) { 1956 if (ha->in_reset) {
1955 printk("%s: reset, exit, already in reset.\n", ha->board_name); 1957 printk("%s: reset, exit, already in reset.\n", ha->board_name);
1958 spin_unlock_irq(shost->host_lock);
1956 return FAILED; 1959 return FAILED;
1957 } 1960 }
1958 1961
1959 if (wait_on_busy(shost->io_port, MAXLOOP)) { 1962 if (wait_on_busy(shost->io_port, MAXLOOP)) {
1960 printk("%s: reset, exit, timeout error.\n", ha->board_name); 1963 printk("%s: reset, exit, timeout error.\n", ha->board_name);
1964 spin_unlock_irq(shost->host_lock);
1961 return FAILED; 1965 return FAILED;
1962 } 1966 }
1963 1967
@@ -2012,6 +2016,7 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
2012 2016
2013 if (do_dma(shost->io_port, 0, RESET_PIO)) { 2017 if (do_dma(shost->io_port, 0, RESET_PIO)) {
2014 printk("%s: reset, cannot reset, timeout error.\n", ha->board_name); 2018 printk("%s: reset, cannot reset, timeout error.\n", ha->board_name);
2019 spin_unlock_irq(shost->host_lock);
2015 return FAILED; 2020 return FAILED;
2016 } 2021 }
2017 2022
@@ -2024,9 +2029,12 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg)
2024 ha->in_reset = 1; 2029 ha->in_reset = 1;
2025 2030
2026 spin_unlock_irq(shost->host_lock); 2031 spin_unlock_irq(shost->host_lock);
2032
2033 /* FIXME: use a sleep instead */
2027 time = jiffies; 2034 time = jiffies;
2028 while ((jiffies - time) < (10 * HZ) && limit++ < 200000) 2035 while ((jiffies - time) < (10 * HZ) && limit++ < 200000)
2029 udelay(100L); 2036 udelay(100L);
2037
2030 spin_lock_irq(shost->host_lock); 2038 spin_lock_irq(shost->host_lock);
2031 2039
2032 printk("%s: reset, interrupts disabled, loops %d.\n", ha->board_name, limit); 2040 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)
2076 else 2084 else
2077 printk("%s: reset, exit.\n", ha->board_name); 2085 printk("%s: reset, exit.\n", ha->board_name);
2078 2086
2087 spin_unlock_irq(shost->host_lock);
2079 return SUCCESS; 2088 return SUCCESS;
2080} 2089}
2081 2090