aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_nx.c
diff options
context:
space:
mode:
authorChad Dupuis <chad.dupuis@qlogic.com>2011-11-18 12:02:17 -0500
committerJames Bottomley <JBottomley@Parallels.com>2011-12-12 03:37:58 -0500
commitc8f6544e6d831f05720687f3536d5cbc290ff181 (patch)
treeface048ae4d833ebcc2e9629090f146533ce4d6c /drivers/scsi/qla2xxx/qla_nx.c
parent10a340e6415d938939724743a4da71fd63f5a95c (diff)
[SCSI] qla2xxx: Encapsulate prematurely completing mailbox commands during ISP82xx firmware hang.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_nx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index 8dd96da78704..60d999d335c5 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -3817,6 +3817,19 @@ exit:
3817 return rval; 3817 return rval;
3818} 3818}
3819 3819
3820void qla82xx_clear_pending_mbx(scsi_qla_host_t *vha)
3821{
3822 struct qla_hw_data *ha = vha->hw;
3823
3824 if (ha->flags.mbox_busy) {
3825 ha->flags.mbox_int = 1;
3826 ql_log(ql_log_warn, vha, 0x6010,
3827 "Doing premature completion of mbx command.\n");
3828 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags))
3829 complete(&ha->mbx_intr_comp);
3830 }
3831}
3832
3820void qla82xx_watchdog(scsi_qla_host_t *vha) 3833void qla82xx_watchdog(scsi_qla_host_t *vha)
3821{ 3834{
3822 uint32_t dev_state, halt_status; 3835 uint32_t dev_state, halt_status;
@@ -3874,16 +3887,8 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
3874 } 3887 }
3875 qla2xxx_wake_dpc(vha); 3888 qla2xxx_wake_dpc(vha);
3876 ha->flags.isp82xx_fw_hung = 1; 3889 ha->flags.isp82xx_fw_hung = 1;
3877 if (ha->flags.mbox_busy) { 3890 ql_log(ql_log_warn, vha, 0x6007, "Firmware hung.\n");
3878 ha->flags.mbox_int = 1; 3891 qla82xx_clear_pending_mbx(vha);
3879 ql_log(ql_log_warn, vha, 0x6007,
3880 "Due to FW hung, doing "
3881 "premature completion of mbx "
3882 "command.\n");
3883 if (test_bit(MBX_INTR_WAIT,
3884 &ha->mbx_cmd_flags))
3885 complete(&ha->mbx_intr_comp);
3886 }
3887 } 3892 }
3888 } 3893 }
3889 } 3894 }
@@ -4078,13 +4083,7 @@ qla82xx_chip_reset_cleanup(scsi_qla_host_t *vha)
4078 msleep(1000); 4083 msleep(1000);
4079 if (qla82xx_check_fw_alive(vha)) { 4084 if (qla82xx_check_fw_alive(vha)) {
4080 ha->flags.isp82xx_fw_hung = 1; 4085 ha->flags.isp82xx_fw_hung = 1;
4081 if (ha->flags.mbox_busy) { 4086 qla82xx_clear_pending_mbx(vha);
4082 ha->flags.mbox_int = 1;
4083 if (test_bit(MBX_INTR_WAIT,
4084 &ha->mbx_cmd_flags)) {
4085 complete(&ha->mbx_intr_comp);
4086 }
4087 }
4088 break; 4087 break;
4089 } 4088 }
4090 } 4089 }