[SCSI] qla2xxx: Stop unconditional completion of mailbox commands issued in interrupt...
authorGiridhar Malavali <giridhar.malavali@qlogic.com>
Fri, 18 Nov 2011 17:02:13 +0000 (09:02 -0800)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 12 Dec 2011 08:34:55 +0000 (12:34 +0400)
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>
drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_os.c

index 94bded5..d2005c3 100644 (file)
@@ -4075,7 +4075,10 @@ qla82xx_chip_reset_cleanup(scsi_qla_host_t *vha)
                                ha->flags.isp82xx_fw_hung = 1;
                                if (ha->flags.mbox_busy) {
                                        ha->flags.mbox_int = 1;
-                                       complete(&ha->mbx_intr_comp);
+                                       if (test_bit(MBX_INTR_WAIT,
+                                           &ha->mbx_cmd_flags)) {
+                                               complete(&ha->mbx_intr_comp);
+                                       }
                                }
                                break;
                        }
index 01c8700..abec1dd 100644 (file)
@@ -4014,7 +4014,10 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
                                ql_dbg(ql_dbg_aer, vha, 0x9001,
                                    "Due to pci channel io frozen, 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);
+                               }
                        }
                }
                qla2x00_free_irqs(vha);