Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-07-03 12:53:48 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2018-07-03 12:53:59 +0200
commit7a6a02a888ed2b5ce19bedde83f87ecc980b9d25 (patch)
tree6f536a4596603c7dc11a663c82a2ba056a531d0b
parentf3cdbf2f02b26c3fef0288f230d392e01b2013a0 (diff)
scsi: lpfc: Fix port initialization failure (bsc#1095453).
-rw-r--r--patches.drivers/scsi-lpfc-fix-port-initialization-failure.patch76
-rw-r--r--series.conf1
2 files changed, 77 insertions, 0 deletions
diff --git a/patches.drivers/scsi-lpfc-fix-port-initialization-failure.patch b/patches.drivers/scsi-lpfc-fix-port-initialization-failure.patch
new file mode 100644
index 0000000000..c3ab8ed0c2
--- /dev/null
+++ b/patches.drivers/scsi-lpfc-fix-port-initialization-failure.patch
@@ -0,0 +1,76 @@
+From: James Smart <jsmart2021@gmail.com>
+Date: Thu, 24 May 2018 21:09:01 -0700
+Subject: scsi: lpfc: Fix port initialization failure.
+Git-commit: b92dc72df3c6b46d2d085b56dcc764f798323e7c
+Patch-mainline: v4.18-rc1
+References: bsc#1095453
+
+The driver exits port setup after failing the lpfc_sli4_get_parameters
+command (messages 0356, 2541, & 1412).
+
+The older CNA adapters do not support the MBX command. In the past
+the code was allowed to fail and continue on with initialization.
+However a nvme change moved a closing bracket and now makes all
+failures terminal.
+
+Revise the logic so that terminal failure only occurs if the command
+failed on the newer adapters. Additionally, if parameters are set
+that require information from the command and the command failed,
+the parameters are erroneous and port set up should fail even on
+the older adapters.
+
+Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
+Signed-off-by: James Smart <james.smart@broadcom.com>
+Reviewed-by: Hannes Reinecke <hare@suse.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ drivers/scsi/lpfc/lpfc_init.c | 21 ++++++++++++++++++---
+ 1 file changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
+index 48a5f067cec6..7ae343b14630 100644
+--- a/drivers/scsi/lpfc/lpfc_init.c
++++ b/drivers/scsi/lpfc/lpfc_init.c
+@@ -5850,6 +5850,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
+ int fof_vectors = 0;
+ int extra;
+ uint64_t wwn;
++ u32 if_type;
++ u32 if_fam;
+
+ phba->sli4_hba.num_online_cpu = num_online_cpus();
+ phba->sli4_hba.num_present_cpu = lpfc_present_cpu;
+@@ -6171,15 +6173,28 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
+ */
+ rc = lpfc_get_sli4_parameters(phba, mboxq);
+ if (rc) {
++ if_type = bf_get(lpfc_sli_intf_if_type,
++ &phba->sli4_hba.sli_intf);
++ if_fam = bf_get(lpfc_sli_intf_sli_family,
++ &phba->sli4_hba.sli_intf);
+ if (phba->sli4_hba.extents_in_use &&
+ phba->sli4_hba.rpi_hdrs_in_use) {
+ lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+ "2999 Unsupported SLI4 Parameters "
+ "Extents and RPI headers enabled.\n");
++ if (if_type == LPFC_SLI_INTF_IF_TYPE_0 &&
++ if_fam == LPFC_SLI_INTF_FAMILY_BE2) {
++ mempool_free(mboxq, phba->mbox_mem_pool);
++ rc = -EIO;
++ goto out_free_bsmbx;
++ }
++ }
++ if (!(if_type == LPFC_SLI_INTF_IF_TYPE_0 &&
++ if_fam == LPFC_SLI_INTF_FAMILY_BE2)) {
++ mempool_free(mboxq, phba->mbox_mem_pool);
++ rc = -EIO;
++ goto out_free_bsmbx;
+ }
+- mempool_free(mboxq, phba->mbox_mem_pool);
+- rc = -EIO;
+- goto out_free_bsmbx;
+ }
+
+ mempool_free(mboxq, phba->mbox_mem_pool);
+
diff --git a/series.conf b/series.conf
index ec49ad8bef..d6061f0d19 100644
--- a/series.conf
+++ b/series.conf
@@ -18760,6 +18760,7 @@
patches.drivers/scsi-lpfc-fix-16gb-hbas-failing-cq-create.patch
patches.drivers/scsi-lpfc-fix-crash-in-blk_mq-layer-when-executing-modprobe-r-lpfc.patch
patches.drivers/scsi-lpfc-fix-mds-diagnostics-failure-rx-tx.patch
+ patches.drivers/scsi-lpfc-fix-port-initialization-failure.patch
patches.drivers/nvme-remove-nvme_revalidate_ns.patch
patches.drivers/nvme-Fix-setting-logical-block-format-when-revalidat.patch