]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qla2xxx: Encapsulate prematurely completing mailbox commands during ISP82xx firmware...
authorChad Dupuis <chad.dupuis@qlogic.com>
Thu, 19 Jul 2012 07:43:24 +0000 (13:13 +0530)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Mon, 23 Jul 2012 08:02:40 +0000 (01:02 -0700)
JIRA Key: V2632FC-81

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_os.c

index f7e68df9ca1c314ee20615dcd11e7f1f0b145efe..dc69f67159749036c6863f1d10e8d5aa581db3d6 100644 (file)
@@ -26,7 +26,7 @@
  * |                              |                    | 0x708c         |
  * | Task Management              |       0x803c       | 0x8025-0x8026  |
  * |                             |                    | 0x800b,0x8039 |
- * | AER/EEH                      |       0x900f       |              |
+ * | AER/EEH                      |       0x900f       | 0x9001        |
  * | Virtual Port                 |       0xa008       |              |
  * | ISP82XX Specific             |       0xb053       |              |
  * | MultiQ                       |       0xc00c       |              |
index bc98d92aea4fa6218551094d88d9263e20c54656..0f7ba1124581df35c1f0ac17e6ba4371a351efdf 100644 (file)
@@ -586,6 +586,7 @@ extern int qla81xx_set_led_config(scsi_qla_host_t *, uint16_t *);
 extern int qla81xx_get_led_config(scsi_qla_host_t *, uint16_t *);
 extern char *qdev_state(uint32_t);
 extern int qla82xx_mbx_beacon_ctl(scsi_qla_host_t *, int);
+extern void qla82xx_clear_pending_mbx(scsi_qla_host_t *);
 
 /* BSG related functions */
 extern int qla24xx_bsg_request(struct fc_bsg_job *);
index 2aecb682ae88aeb544328ee45481c6e1d0bf8ab6..2c207351fb7ef243c984a16271c3fbad105e5880 100644 (file)
@@ -3382,16 +3382,8 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
                                            &vha->dpc_flags);
                                }
                                ha->flags.isp82xx_fw_hung = 1;
-                               if (ha->flags.mbox_busy) {
-                                       ha->flags.mbox_int = 1;
-                                       ql_log(ql_log_warn, vha, 0x6007,
-                                           "Due to FW hung, doing "
-                                           "premature completion of mbx "
-                                           "command.\n");
-                                       if (test_bit(MBX_INTR_WAIT,
-                                           &ha->mbx_cmd_flags))
-                                               complete(&ha->mbx_intr_comp);
-                               }
+                               ql_log(ql_log_warn, vha, 0x6007, "Firmware hung.\n");
+                               qla82xx_clear_pending_mbx(vha);
                        }
                }
        }
@@ -3404,6 +3396,19 @@ int qla82xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
        return rval;
 }
 
+void qla82xx_clear_pending_mbx(scsi_qla_host_t *vha)
+{
+       struct qla_hw_data *ha = vha->hw;
+
+       if (ha->flags.mbox_busy) {
+               ha->flags.mbox_int = 1;
+               ql_log(ql_log_warn, vha, 0x6010,
+                   "Doing premature completion of mbx command.\n");
+               if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags))
+                       complete(&ha->mbx_intr_comp);
+       }
+}
+
 void
 qla82xx_set_reset_owner(scsi_qla_host_t *vha)
 {
@@ -3586,13 +3591,7 @@ qla82xx_chip_reset_cleanup(scsi_qla_host_t *vha)
                        msleep(1000);
                        if (qla82xx_check_fw_alive(vha)) {
                                ha->flags.isp82xx_fw_hung = 1;
-                               if (ha->flags.mbox_busy) {
-                                       ha->flags.mbox_int = 1;
-                                       if (test_bit(MBX_INTR_WAIT,
-                                           &ha->mbx_cmd_flags)) {
-                                               complete(&ha->mbx_intr_comp);
-                                       }
-                               }
+                               qla82xx_clear_pending_mbx(vha);
                                break;
                        }
                }
index c09100e9a0eb886d90962c6594302170c6902b48..ecb2d590498911c62816c4438594ad4d7aaf792f 100644 (file)
@@ -4126,16 +4126,8 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
                /* For ISP82XX complete any pending mailbox cmd */
                if (IS_QLA82XX(ha)) {
                        ha->flags.isp82xx_fw_hung = 1;
-                       if (ha->flags.mbox_busy) {
-                               ha->flags.mbox_int = 1;
-                               ql_dbg(ql_dbg_aer, vha, 0x9001,
-                                   "Due to pci channel io frozen, doing premature "
-                                   "completion of mbx command.\n");
-                               if (test_bit(MBX_INTR_WAIT,
-                                   &ha->mbx_cmd_flags)) {
-                                       complete(&ha->mbx_intr_comp);
-                               }
-                       }
+                       ql_dbg(ql_dbg_aer, vha, 0x9001, "Pci channel io frozen\n");
+                       qla82xx_clear_pending_mbx(vha);
                }
                qla2x00_free_irqs(vha);
                pci_disable_device(pdev);