From: Chad Dupuis <cdupuis@redhat.com> Date: Fri, 3 Sep 2010 21:40:23 -0400 Subject: [scsi] qla2xxx: fix set fw hung and complete waiting mbx Message-id: <20100903214022.2767.36524.sendpatchset@localhost.localdomain> Patchwork-id: 28147 O-Subject: [RHEL 5.6 PATCH 5/9] qla2xxx: Correctly set fw hung and complete only waiting mbx. Bugzilla: 619814 RH-Acked-by: Rob Evers <revers@redhat.com> Bugzilla -------- Bug 619814 (https://bugzilla.redhat.com/show_bug.cgi?id=619814) Upstream Status --------------- Will be submitted upstream with our next patch submission. Description ----------- >From e25ca7cfad76973f6fa11cfdd8910cf6022456d9 Mon Sep 17 00:00:00 2001 From: Lalit Chandivade <lalit.chandivade@qlogic.com> Date: Sat, 10 Jul 2010 05:20:58 +0530 Subject: [PATCH] qla2xxx: Correctly set fw hung and complete only waiting mbx. The fw_hung flag should be set ir-respective of if there is a mbx command pending or not. Also the complete should be called if there is a mbx waiting. diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 8fddfb5..4beb14b 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c @@ -2512,13 +2512,15 @@ qla82xx_check_fw_alive(scsi_qla_host_t *ha) set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); } qla2xxx_wake_dpc(ha); + ha->flags.fw_hung = 1; if (ha->flags.mbox_busy) { - ha->flags.fw_hung = 1; ha->flags.mbox_int = 1; DEBUG2(qla_printk(KERN_ERR, ha, "Due to fw hung, doing premature " "completion of mbx command\n")); - complete(&ha->mbx_intr_comp); + if (test_bit(MBX_INTR_WAIT, + &ha->mbx_cmd_flags)) + complete(&ha->mbx_intr_comp); } } } else { @@ -2625,13 +2627,14 @@ void qla82xx_watchdog(scsi_qla_host_t *ha) "%s(): Adapter reset needed!\n", __func__); set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); qla2xxx_wake_dpc(ha); + ha->flags.fw_hung = 1; if (ha->flags.mbox_busy) { - ha->flags.fw_hung = 1; ha->flags.mbox_int = 1; DEBUG2(qla_printk(KERN_ERR, ha, "Need reset, doing premature " "completion of mbx command\n")); - complete(&ha->mbx_intr_comp); + if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags)) + complete(&ha->mbx_intr_comp); } } else { qla82xx_check_fw_alive(ha);