Skip to content

Commit b92dc72

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
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 <[email protected]> Signed-off-by: James Smart <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent c221768 commit b92dc72

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5850,6 +5850,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
58505850
int fof_vectors = 0;
58515851
int extra;
58525852
uint64_t wwn;
5853+
u32 if_type;
5854+
u32 if_fam;
58535855

58545856
phba->sli4_hba.num_online_cpu = num_online_cpus();
58555857
phba->sli4_hba.num_present_cpu = lpfc_present_cpu;
@@ -6171,15 +6173,28 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
61716173
*/
61726174
rc = lpfc_get_sli4_parameters(phba, mboxq);
61736175
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);
61746180
if (phba->sli4_hba.extents_in_use &&
61756181
phba->sli4_hba.rpi_hdrs_in_use) {
61766182
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
61776183
"2999 Unsupported SLI4 Parameters "
61786184
"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;
61796197
}
6180-
mempool_free(mboxq, phba->mbox_mem_pool);
6181-
rc = -EIO;
6182-
goto out_free_bsmbx;
61836198
}
61846199

61856200
mempool_free(mboxq, phba->mbox_mem_pool);

0 commit comments

Comments
 (0)