[SCSI] 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.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>

authored by Giridhar Malavali and committed by James Bottomley 4142b198 efa786cc

+12 -8
+12 -8
drivers/scsi/qla2xxx/qla_nx.c
··· 3307 3307 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); 3308 3308 } 3309 3309 qla2xxx_wake_dpc(vha); 3310 + ha->flags.fw_hung = 1; 3310 3311 if (ha->flags.mbox_busy) { 3311 - ha->flags.fw_hung = 1; 3312 3312 ha->flags.mbox_int = 1; 3313 3313 DEBUG2(qla_printk(KERN_ERR, ha, 3314 - "Due to fw hung, doing premature " 3315 - "completion of mbx command\n")); 3316 - complete(&ha->mbx_intr_comp); 3314 + "Due to fw hung, doing premature " 3315 + "completion of mbx command\n")); 3316 + if (test_bit(MBX_INTR_WAIT, 3317 + &ha->mbx_cmd_flags)) 3318 + complete(&ha->mbx_intr_comp); 3317 3319 } 3318 3320 } 3319 3321 } else ··· 3421 3419 "%s(): Adapter reset needed!\n", __func__); 3422 3420 set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); 3423 3421 qla2xxx_wake_dpc(vha); 3422 + ha->flags.fw_hung = 1; 3424 3423 if (ha->flags.mbox_busy) { 3425 - ha->flags.fw_hung = 1; 3426 3424 ha->flags.mbox_int = 1; 3427 3425 DEBUG2(qla_printk(KERN_ERR, ha, 3428 - "Need reset, doing premature " 3429 - "completion of mbx command\n")); 3430 - complete(&ha->mbx_intr_comp); 3426 + "Need reset, doing premature " 3427 + "completion of mbx command\n")); 3428 + if (test_bit(MBX_INTR_WAIT, 3429 + &ha->mbx_cmd_flags)) 3430 + complete(&ha->mbx_intr_comp); 3431 3431 } 3432 3432 } else { 3433 3433 qla82xx_check_fw_alive(vha);