aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Smart <jsmart2021@gmail.com>2018-05-25 00:09:01 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2018-05-28 22:40:33 -0400
commitb92dc72df3c6b46d2d085b56dcc764f798323e7c (patch)
tree9be8033ca9a636a8265398d6bf8e5a43c5c3da72
parentc221768bd49a7423be57c00a56985c0e9c4122cd (diff)
scsi: lpfc: Fix port initialization failure.
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>
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c21
1 files 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)
5850 int fof_vectors = 0; 5850 int fof_vectors = 0;
5851 int extra; 5851 int extra;
5852 uint64_t wwn; 5852 uint64_t wwn;
5853 u32 if_type;
5854 u32 if_fam;
5853 5855
5854 phba->sli4_hba.num_online_cpu = num_online_cpus(); 5856 phba->sli4_hba.num_online_cpu = num_online_cpus();
5855 phba->sli4_hba.num_present_cpu = lpfc_present_cpu; 5857 phba->sli4_hba.num_present_cpu = lpfc_present_cpu;
@@ -6171,15 +6173,28 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
6171 */ 6173 */
6172 rc = lpfc_get_sli4_parameters(phba, mboxq); 6174 rc = lpfc_get_sli4_parameters(phba, mboxq);
6173 if (rc) { 6175 if (rc) {
6176 if_type = bf_get(lpfc_sli_intf_if_type,
6177 &phba->sli4_hba.sli_intf);
6178 if_fam = bf_get(lpfc_sli_intf_sli_family,
6179 &phba->sli4_hba.sli_intf);
6174 if (phba->sli4_hba.extents_in_use && 6180 if (phba->sli4_hba.extents_in_use &&
6175 phba->sli4_hba.rpi_hdrs_in_use) { 6181 phba->sli4_hba.rpi_hdrs_in_use) {
6176 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 6182 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6177 "2999 Unsupported SLI4 Parameters " 6183 "2999 Unsupported SLI4 Parameters "
6178 "Extents and RPI headers enabled.\n"); 6184 "Extents and RPI headers enabled.\n");
6185 if (if_type == LPFC_SLI_INTF_IF_TYPE_0 &&
6186 if_fam == LPFC_SLI_INTF_FAMILY_BE2) {
6187 mempool_free(mboxq, phba->mbox_mem_pool);
6188 rc = -EIO;
6189 goto out_free_bsmbx;
6190 }
6191 }
6192 if (!(if_type == LPFC_SLI_INTF_IF_TYPE_0 &&
6193 if_fam == LPFC_SLI_INTF_FAMILY_BE2)) {
6194 mempool_free(mboxq, phba->mbox_mem_pool);
6195 rc = -EIO;
6196 goto out_free_bsmbx;
6179 } 6197 }
6180 mempool_free(mboxq, phba->mbox_mem_pool);
6181 rc = -EIO;
6182 goto out_free_bsmbx;
6183 } 6198 }
6184 6199
6185 mempool_free(mboxq, phba->mbox_mem_pool); 6200 mempool_free(mboxq, phba->mbox_mem_pool);