diff options
Diffstat (limited to 'drivers/scsi/eata.c')
-rw-r--r-- | drivers/scsi/eata.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index 81d16cfbe69e..1bb8727eea3e 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c | |||
@@ -518,8 +518,6 @@ static struct scsi_host_template driver_template = { | |||
518 | .release = eata2x_release, | 518 | .release = eata2x_release, |
519 | .queuecommand = eata2x_queuecommand, | 519 | .queuecommand = eata2x_queuecommand, |
520 | .eh_abort_handler = eata2x_eh_abort, | 520 | .eh_abort_handler = eata2x_eh_abort, |
521 | .eh_device_reset_handler = NULL, | ||
522 | .eh_bus_reset_handler = NULL, | ||
523 | .eh_host_reset_handler = eata2x_eh_host_reset, | 521 | .eh_host_reset_handler = eata2x_eh_host_reset, |
524 | .bios_param = eata2x_bios_param, | 522 | .bios_param = eata2x_bios_param, |
525 | .slave_configure = eata2x_slave_configure, | 523 | .slave_configure = eata2x_slave_configure, |
@@ -1950,16 +1948,20 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg) | |||
1950 | ha->board_name, SCarg->device->channel, SCarg->device->id, | 1948 | ha->board_name, SCarg->device->channel, SCarg->device->id, |
1951 | SCarg->device->lun, SCarg->pid); | 1949 | SCarg->device->lun, SCarg->pid); |
1952 | 1950 | ||
1951 | spin_lock_irq(shost->host_lock); | ||
1952 | |||
1953 | if (SCarg->host_scribble == NULL) | 1953 | if (SCarg->host_scribble == NULL) |
1954 | 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); |
1955 | 1955 | ||
1956 | if (ha->in_reset) { | 1956 | if (ha->in_reset) { |
1957 | 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); | ||
1958 | return FAILED; | 1959 | return FAILED; |
1959 | } | 1960 | } |
1960 | 1961 | ||
1961 | if (wait_on_busy(shost->io_port, MAXLOOP)) { | 1962 | if (wait_on_busy(shost->io_port, MAXLOOP)) { |
1962 | 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); | ||
1963 | return FAILED; | 1965 | return FAILED; |
1964 | } | 1966 | } |
1965 | 1967 | ||
@@ -2014,6 +2016,7 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg) | |||
2014 | 2016 | ||
2015 | if (do_dma(shost->io_port, 0, RESET_PIO)) { | 2017 | if (do_dma(shost->io_port, 0, RESET_PIO)) { |
2016 | 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); | ||
2017 | return FAILED; | 2020 | return FAILED; |
2018 | } | 2021 | } |
2019 | 2022 | ||
@@ -2026,9 +2029,12 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg) | |||
2026 | ha->in_reset = 1; | 2029 | ha->in_reset = 1; |
2027 | 2030 | ||
2028 | spin_unlock_irq(shost->host_lock); | 2031 | spin_unlock_irq(shost->host_lock); |
2032 | |||
2033 | /* FIXME: use a sleep instead */ | ||
2029 | time = jiffies; | 2034 | time = jiffies; |
2030 | while ((jiffies - time) < (10 * HZ) && limit++ < 200000) | 2035 | while ((jiffies - time) < (10 * HZ) && limit++ < 200000) |
2031 | udelay(100L); | 2036 | udelay(100L); |
2037 | |||
2032 | spin_lock_irq(shost->host_lock); | 2038 | spin_lock_irq(shost->host_lock); |
2033 | 2039 | ||
2034 | 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); |
@@ -2078,6 +2084,7 @@ static int eata2x_eh_host_reset(struct scsi_cmnd *SCarg) | |||
2078 | else | 2084 | else |
2079 | printk("%s: reset, exit.\n", ha->board_name); | 2085 | printk("%s: reset, exit.\n", ha->board_name); |
2080 | 2086 | ||
2087 | spin_unlock_irq(shost->host_lock); | ||
2081 | return SUCCESS; | 2088 | return SUCCESS; |
2082 | } | 2089 | } |
2083 | 2090 | ||