summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla4xxx/ql4_os.c
diff options
context:
space:
mode:
authorTej Parkash <tej.parkash@qlogic.com>2013-12-16 06:49:43 -0500
committerJames Bottomley <JBottomley@Parallels.com>2014-03-15 10:19:14 -0700
commit61d9a2b61490f6e121abbe6275ac93cf608f087e (patch)
treedd4f5d8c80f8c25d578139239741cb1a2106537e /drivers/scsi/qla4xxx/ql4_os.c
parent1b3d399cf6877c8d9abd63a2aff41b709a38fbd1 (diff)
[SCSI] qla4xxx: Fix pending IO completion in reset path before initiating chip reset
Issue: Pending IO wait does not complete after triggering Graceful reset, causing ack timeout and call traces. Fix: 1. Reducing the IO command wait timeout before triggering reset, as logically also timeout should be less than reset timeout (10sec). 2. Moving the abort IO after chip reset, because only after chip reset, driver owns the IO otherwise it is with firmware and can still revert back with response. Signed-off-by: Tej Parkash <tej.parkash@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_os.c')
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index 3fec116e2724..a27da31c4ffd 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -4561,11 +4561,19 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha)
uint32_t index = 0;
unsigned long flags;
struct scsi_cmnd *cmd;
+ unsigned long wtime;
+ uint32_t wtmo;
- unsigned long wtime = jiffies + (WAIT_CMD_TOV * HZ);
+ if (is_qla40XX(ha))
+ wtmo = WAIT_CMD_TOV;
+ else
+ wtmo = ha->nx_reset_timeout / 2;
- DEBUG2(ql4_printk(KERN_INFO, ha, "Wait up to %d seconds for cmds to "
- "complete\n", WAIT_CMD_TOV));
+ wtime = jiffies + (wtmo * HZ);
+
+ DEBUG2(ql4_printk(KERN_INFO, ha,
+ "Wait up to %u seconds for cmds to complete\n",
+ wtmo));
while (!time_after_eq(jiffies, wtime)) {
spin_lock_irqsave(&ha->hardware_lock, flags);
@@ -4868,11 +4876,11 @@ chip_reset:
qla4xxx_cmd_wait(ha);
qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS);
- qla4xxx_abort_active_cmds(ha, DID_RESET << 16);
DEBUG2(ql4_printk(KERN_INFO, ha,
"scsi%ld: %s - Performing chip reset..\n",
ha->host_no, __func__));
status = ha->isp_ops->reset_chip(ha);
+ qla4xxx_abort_active_cmds(ha, DID_RESET << 16);
}
/* Flush any pending ddb changed AENs */