+++ /dev/null
-From: Jamie Wellnitz <jamie.wellnitz@emulex.com>
-Subject: Disable MSI by default in lpfc driver
-References: bnc#477843
-
-Update lpfc from 8.2.8.13 to 8.2.8.14
-
-We (Emulex) have seen too many MSI/MSI-X issues to be comfortable at this
-stage, so we've decided to revert lpfc to using INTx interrupts by default and
-allowing MSI or MSI-X to be enabled with the lpfc_use_msi driver parameter.
-
-We will also include a change to only test MSI-X and MSI interrupts in the
-interrupt method failback logic. This way, lpfc will not fail port
-initialization if the first few INTx interrupts are slow to arrive. Lpfc will
-still verify MSI/MSI-X interrupts are actually delivered before continuing port
-initialization.
-
-Signed-off-by: Hannes Reinecke <hare@suse.de>
-
---
-diff -urpN a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
---- a/drivers/scsi/lpfc/lpfc_attr.c 2009-02-19 17:49:17.668021000 -0500
-+++ b/drivers/scsi/lpfc/lpfc_attr.c 2009-02-19 17:49:17.761982000 -0500
-@@ -3080,12 +3080,12 @@ LPFC_ATTR_RW(poll_tmo, 10, 1, 255,
- /*
- # lpfc_use_msi: Use MSI (Message Signaled Interrupts) in systems that
- # support this feature
--# 0 = MSI disabled
-+# 0 = MSI disabled (default)
- # 1 = MSI enabled
--# 2 = MSI-X enabled (default)
--# Value range is [0,2]. Default value is 2.
-+# 2 = MSI-X enabled
-+# Value range is [0,2]. Default value is 0.
- */
--LPFC_ATTR_R(use_msi, 2, 0, 2, "Use Message Signaled Interrupts (1) or "
-+LPFC_ATTR_R(use_msi, 0, 0, 2, "Use Message Signaled Interrupts (1) or "
- "MSI-X (2), if possible");
-
- /*
-diff -urpN a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
---- a/drivers/scsi/lpfc/lpfc_hbadisc.c 2009-02-19 17:49:17.697993000 -0500
-+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c 2009-02-19 17:49:17.792982000 -0500
-@@ -2246,9 +2246,13 @@ lpfc_unreg_all_rpis(struct lpfc_vport *v
- mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
- mbox->context1 = NULL;
- rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO);
-- if (rc == MBX_NOT_FINISHED) {
-+ if (rc != MBX_TIMEOUT)
- mempool_free(mbox, phba->mbox_mem_pool);
-- }
-+
-+ if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED))
-+ lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
-+ "1836 Could not issue "
-+ "unreg_login(all_rpis) status %d\n", rc);
- }
- }
-
-@@ -2266,12 +2270,14 @@ lpfc_unreg_default_rpis(struct lpfc_vpor
- mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
- mbox->context1 = NULL;
- rc = lpfc_sli_issue_mbox_wait(phba, mbox, LPFC_MBOX_TMO);
-- if (rc == MBX_NOT_FINISHED) {
-+ if (rc != MBX_TIMEOUT)
-+ mempool_free(mbox, phba->mbox_mem_pool);
-+
-+ if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED))
- lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
- "1815 Could not issue "
-- "unreg_did (default rpis)\n");
-- mempool_free(mbox, phba->mbox_mem_pool);
-- }
-+ "unreg_did (default rpis) status %d\n",
-+ rc);
- }
- }
-
-diff -urpN a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
---- a/drivers/scsi/lpfc/lpfc_init.c 2009-02-19 17:49:17.710980000 -0500
-+++ b/drivers/scsi/lpfc/lpfc_init.c 2009-02-19 17:49:17.817984000 -0500
-@@ -1355,7 +1355,8 @@ lpfc_get_hba_model_desc(struct lpfc_hba
- m = (typeof(m)){"LPe11000", max_speed, "PCIe"};
- break;
- case PCI_DEVICE_ID_ZEPHYR_DCSP:
-- m = (typeof(m)){"LPe11002-SP", max_speed, "PCIe"};
-+ m = (typeof(m)){"LP2105", max_speed, "PCIe"};
-+ GE = 1;
- break;
- case PCI_DEVICE_ID_ZMID:
- m = (typeof(m)){"LPe1150", max_speed, "PCIe"};
-@@ -2954,8 +2955,9 @@ lpfc_pci_probe_one(struct pci_dev *pdev,
-
- /* Wait 50ms for the interrupts of previous mailbox commands */
- msleep(50);
-- /* Check active interrupts received */
-- if (phba->sli.slistat.sli_intr > LPFC_INTR_THRESHOLD) {
-+ /* Check active interrupts received only for MSI/MSI-X */
-+ if (phba->sli.slistat.sli_intr > LPFC_INTR_THRESHOLD ||
-+ intr_mode == 0) {
- /* Log the current active interrupt mode */
- phba->intr_mode = intr_mode;
- lpfc_log_intr_mode(phba, intr_mode);
-@@ -2965,13 +2967,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev,
- "0451 Configure interrupt mode (%d) "
- "failed active interrupt test.\n",
- intr_mode);
-- if (intr_mode == 0) {
-- lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
-- "0479 Failed to enable "
-- "interrupt.\n");
-- error = -ENODEV;
-- goto out_remove_device;
-- }
- /* Stop HBA SLI setups */
- lpfc_stop_port(phba);
- /* Disable the current interrupt mode */
-diff -urpN a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
---- a/drivers/scsi/lpfc/lpfc_sli.c 2009-02-19 17:49:17.741980000 -0500
-+++ b/drivers/scsi/lpfc/lpfc_sli.c 2009-02-19 17:49:17.845982000 -0500
-@@ -4031,6 +4031,7 @@ lpfc_sli_async_event_handler(struct lpfc
- uint16_t temp;
- struct temp_event temp_event_data;
- struct Scsi_Host *shost;
-+ uint32_t *iocb_w;
-
- icmd = &iocbq->iocb;
- evt_code = icmd->un.asyncstat.evt_code;
-@@ -4038,13 +4039,23 @@ lpfc_sli_async_event_handler(struct lpfc
-
- if ((evt_code != ASYNC_TEMP_WARN) &&
- (evt_code != ASYNC_TEMP_SAFE)) {
-+ iocb_w = (uint32_t *) icmd;
- lpfc_printf_log(phba,
- KERN_ERR,
- LOG_SLI,
- "0346 Ring %d handler: unexpected ASYNC_STATUS"
-- " evt_code 0x%x\n",
-+ " evt_code 0x%x \n"
-+ "W0 0x%08x W1 0x%08x W2 0x%08x W3 0x%08x\n"
-+ "W4 0x%08x W5 0x%08x W6 0x%08x W7 0x%08x\n"
-+ "W8 0x%08x W9 0x%08x W10 0x%08x W11 0x%08x\n"
-+ "W12 0x%08x W13 0x%08x W14 0x%08x W15 0x%08x\n",
- pring->ringno,
-- icmd->un.asyncstat.evt_code);
-+ icmd->un.asyncstat.evt_code,
-+ iocb_w[0], iocb_w[1], iocb_w[2], iocb_w[3],
-+ iocb_w[4], iocb_w[5], iocb_w[6], iocb_w[7],
-+ iocb_w[8], iocb_w[9], iocb_w[10], iocb_w[11],
-+ iocb_w[12], iocb_w[13], iocb_w[14], iocb_w[15]);
-+
- return;
- }
- temp_event_data.data = (uint32_t)temp;
-diff -urpN a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h
---- a/drivers/scsi/lpfc/lpfc_version.h 2009-02-19 17:49:17.744980000 -0500
-+++ b/drivers/scsi/lpfc/lpfc_version.h 2009-02-19 17:49:17.848982000 -0500
-@@ -18,7 +18,7 @@
- * included with this package. *
- *******************************************************************/
-
--#define LPFC_DRIVER_VERSION "8.2.8.13"
-+#define LPFC_DRIVER_VERSION "8.2.8.14"
-
- #define LPFC_DRIVER_NAME "lpfc"
- #define LPFC_SP_DRIVER_HANDLER_NAME "lpfc:sp"