diff options
Diffstat (limited to 'drivers/scsi/dc395x.c')
-rw-r--r-- | drivers/scsi/dc395x.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 694e13c45dfd..42e8624a9b9a 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c | |||
@@ -308,6 +308,8 @@ struct AdapterCtlBlk { | |||
308 | struct timer_list waiting_timer; | 308 | struct timer_list waiting_timer; |
309 | struct timer_list selto_timer; | 309 | struct timer_list selto_timer; |
310 | 310 | ||
311 | unsigned long last_reset; | ||
312 | |||
311 | u16 srb_count; | 313 | u16 srb_count; |
312 | 314 | ||
313 | u8 sel_timeout; | 315 | u8 sel_timeout; |
@@ -860,9 +862,9 @@ static void waiting_set_timer(struct AdapterCtlBlk *acb, unsigned long to) | |||
860 | init_timer(&acb->waiting_timer); | 862 | init_timer(&acb->waiting_timer); |
861 | acb->waiting_timer.function = waiting_timeout; | 863 | acb->waiting_timer.function = waiting_timeout; |
862 | acb->waiting_timer.data = (unsigned long) acb; | 864 | acb->waiting_timer.data = (unsigned long) acb; |
863 | if (time_before(jiffies + to, acb->scsi_host->last_reset - HZ / 2)) | 865 | if (time_before(jiffies + to, acb->last_reset - HZ / 2)) |
864 | acb->waiting_timer.expires = | 866 | acb->waiting_timer.expires = |
865 | acb->scsi_host->last_reset - HZ / 2 + 1; | 867 | acb->last_reset - HZ / 2 + 1; |
866 | else | 868 | else |
867 | acb->waiting_timer.expires = jiffies + to + 1; | 869 | acb->waiting_timer.expires = jiffies + to + 1; |
868 | add_timer(&acb->waiting_timer); | 870 | add_timer(&acb->waiting_timer); |
@@ -1319,7 +1321,7 @@ static int __dc395x_eh_bus_reset(struct scsi_cmnd *cmd) | |||
1319 | udelay(500); | 1321 | udelay(500); |
1320 | 1322 | ||
1321 | /* We may be in serious trouble. Wait some seconds */ | 1323 | /* We may be in serious trouble. Wait some seconds */ |
1322 | acb->scsi_host->last_reset = | 1324 | acb->last_reset = |
1323 | jiffies + 3 * HZ / 2 + | 1325 | jiffies + 3 * HZ / 2 + |
1324 | HZ * acb->eeprom.delay_time; | 1326 | HZ * acb->eeprom.delay_time; |
1325 | 1327 | ||
@@ -1462,9 +1464,9 @@ static void selto_timer(struct AdapterCtlBlk *acb) | |||
1462 | acb->selto_timer.function = selection_timeout_missed; | 1464 | acb->selto_timer.function = selection_timeout_missed; |
1463 | acb->selto_timer.data = (unsigned long) acb; | 1465 | acb->selto_timer.data = (unsigned long) acb; |
1464 | if (time_before | 1466 | if (time_before |
1465 | (jiffies + HZ, acb->scsi_host->last_reset + HZ / 2)) | 1467 | (jiffies + HZ, acb->last_reset + HZ / 2)) |
1466 | acb->selto_timer.expires = | 1468 | acb->selto_timer.expires = |
1467 | acb->scsi_host->last_reset + HZ / 2 + 1; | 1469 | acb->last_reset + HZ / 2 + 1; |
1468 | else | 1470 | else |
1469 | acb->selto_timer.expires = jiffies + HZ + 1; | 1471 | acb->selto_timer.expires = jiffies + HZ + 1; |
1470 | add_timer(&acb->selto_timer); | 1472 | add_timer(&acb->selto_timer); |
@@ -1535,7 +1537,7 @@ static u8 start_scsi(struct AdapterCtlBlk* acb, struct DeviceCtlBlk* dcb, | |||
1535 | } | 1537 | } |
1536 | /* Allow starting of SCSI commands half a second before we allow the mid-level | 1538 | /* Allow starting of SCSI commands half a second before we allow the mid-level |
1537 | * to queue them again after a reset */ | 1539 | * to queue them again after a reset */ |
1538 | if (time_before(jiffies, acb->scsi_host->last_reset - HZ / 2)) { | 1540 | if (time_before(jiffies, acb->last_reset - HZ / 2)) { |
1539 | dprintkdbg(DBG_KG, "start_scsi: Refuse cmds (reset wait)\n"); | 1541 | dprintkdbg(DBG_KG, "start_scsi: Refuse cmds (reset wait)\n"); |
1540 | return 1; | 1542 | return 1; |
1541 | } | 1543 | } |
@@ -3031,7 +3033,7 @@ static void disconnect(struct AdapterCtlBlk *acb) | |||
3031 | dprintkl(KERN_ERR, "disconnect: No such device\n"); | 3033 | dprintkl(KERN_ERR, "disconnect: No such device\n"); |
3032 | udelay(500); | 3034 | udelay(500); |
3033 | /* Suspend queue for a while */ | 3035 | /* Suspend queue for a while */ |
3034 | acb->scsi_host->last_reset = | 3036 | acb->last_reset = |
3035 | jiffies + HZ / 2 + | 3037 | jiffies + HZ / 2 + |
3036 | HZ * acb->eeprom.delay_time; | 3038 | HZ * acb->eeprom.delay_time; |
3037 | clear_fifo(acb, "disconnectEx"); | 3039 | clear_fifo(acb, "disconnectEx"); |
@@ -3053,7 +3055,7 @@ static void disconnect(struct AdapterCtlBlk *acb) | |||
3053 | waiting_process_next(acb); | 3055 | waiting_process_next(acb); |
3054 | } else if (srb->state & SRB_ABORT_SENT) { | 3056 | } else if (srb->state & SRB_ABORT_SENT) { |
3055 | dcb->flag &= ~ABORT_DEV_; | 3057 | dcb->flag &= ~ABORT_DEV_; |
3056 | acb->scsi_host->last_reset = jiffies + HZ / 2 + 1; | 3058 | acb->last_reset = jiffies + HZ / 2 + 1; |
3057 | dprintkl(KERN_ERR, "disconnect: SRB_ABORT_SENT\n"); | 3059 | dprintkl(KERN_ERR, "disconnect: SRB_ABORT_SENT\n"); |
3058 | doing_srb_done(acb, DID_ABORT, srb->cmd, 1); | 3060 | doing_srb_done(acb, DID_ABORT, srb->cmd, 1); |
3059 | waiting_process_next(acb); | 3061 | waiting_process_next(acb); |
@@ -3649,7 +3651,7 @@ static void scsi_reset_detect(struct AdapterCtlBlk *acb) | |||
3649 | /*DC395x_write8(acb, TRM_S1040_DMA_CONTROL,STOPDMAXFER); */ | 3651 | /*DC395x_write8(acb, TRM_S1040_DMA_CONTROL,STOPDMAXFER); */ |
3650 | udelay(500); | 3652 | udelay(500); |
3651 | /* Maybe we locked up the bus? Then lets wait even longer ... */ | 3653 | /* Maybe we locked up the bus? Then lets wait even longer ... */ |
3652 | acb->scsi_host->last_reset = | 3654 | acb->last_reset = |
3653 | jiffies + 5 * HZ / 2 + | 3655 | jiffies + 5 * HZ / 2 + |
3654 | HZ * acb->eeprom.delay_time; | 3656 | HZ * acb->eeprom.delay_time; |
3655 | 3657 | ||
@@ -4426,7 +4428,7 @@ static void adapter_init_scsi_host(struct Scsi_Host *host) | |||
4426 | host->dma_channel = -1; | 4428 | host->dma_channel = -1; |
4427 | host->unique_id = acb->io_port_base; | 4429 | host->unique_id = acb->io_port_base; |
4428 | host->irq = acb->irq_level; | 4430 | host->irq = acb->irq_level; |
4429 | host->last_reset = jiffies; | 4431 | acb->last_reset = jiffies; |
4430 | 4432 | ||
4431 | host->max_id = 16; | 4433 | host->max_id = 16; |
4432 | if (host->max_id - 1 == eeprom->scsi_id) | 4434 | if (host->max_id - 1 == eeprom->scsi_id) |
@@ -4484,7 +4486,7 @@ static void adapter_init_chip(struct AdapterCtlBlk *acb) | |||
4484 | /*spin_unlock_irq (&io_request_lock); */ | 4486 | /*spin_unlock_irq (&io_request_lock); */ |
4485 | udelay(500); | 4487 | udelay(500); |
4486 | 4488 | ||
4487 | acb->scsi_host->last_reset = | 4489 | acb->last_reset = |
4488 | jiffies + HZ / 2 + | 4490 | jiffies + HZ / 2 + |
4489 | HZ * acb->eeprom.delay_time; | 4491 | HZ * acb->eeprom.delay_time; |
4490 | 4492 | ||