Commit 61d9a2b6 authored by Tej Parkash's avatar Tej Parkash Committed by James Bottomley

[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: default avatarTej Parkash <tej.parkash@qlogic.com>
Signed-off-by: default avatarVikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 1b3d399c
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
#define ADAPTER_INIT_TOV 30 #define ADAPTER_INIT_TOV 30
#define ADAPTER_RESET_TOV 180 #define ADAPTER_RESET_TOV 180
#define EXTEND_CMD_TOV 60 #define EXTEND_CMD_TOV 60
#define WAIT_CMD_TOV 30 #define WAIT_CMD_TOV 5
#define EH_WAIT_CMD_TOV 120 #define EH_WAIT_CMD_TOV 120
#define FIRMWARE_UP_TOV 60 #define FIRMWARE_UP_TOV 60
#define RESET_FIRMWARE_TOV 30 #define RESET_FIRMWARE_TOV 30
......
...@@ -4561,11 +4561,19 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha) ...@@ -4561,11 +4561,19 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha)
uint32_t index = 0; uint32_t index = 0;
unsigned long flags; unsigned long flags;
struct scsi_cmnd *cmd; 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 " wtime = jiffies + (wtmo * HZ);
"complete\n", WAIT_CMD_TOV));
DEBUG2(ql4_printk(KERN_INFO, ha,
"Wait up to %u seconds for cmds to complete\n",
wtmo));
while (!time_after_eq(jiffies, wtime)) { while (!time_after_eq(jiffies, wtime)) {
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
...@@ -4868,11 +4876,11 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha) ...@@ -4868,11 +4876,11 @@ static int qla4xxx_recover_adapter(struct scsi_qla_host *ha)
qla4xxx_cmd_wait(ha); qla4xxx_cmd_wait(ha);
qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS); qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS);
qla4xxx_abort_active_cmds(ha, DID_RESET << 16);
DEBUG2(ql4_printk(KERN_INFO, ha, DEBUG2(ql4_printk(KERN_INFO, ha,
"scsi%ld: %s - Performing chip reset..\n", "scsi%ld: %s - Performing chip reset..\n",
ha->host_no, __func__)); ha->host_no, __func__));
status = ha->isp_ops->reset_chip(ha); status = ha->isp_ops->reset_chip(ha);
qla4xxx_abort_active_cmds(ha, DID_RESET << 16);
} }
/* Flush any pending ddb changed AENs */ /* Flush any pending ddb changed AENs */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment