Skip to content

Commit 58213a5

Browse files
author
Paul Ely
committed
scsi: lpfc: Simplify error handling for failed lpfc_get_sli4_parameters cmd
JIRA: https://issues.redhat.com/browse/RHEL-103752 commit 5a00dfc Author: Justin Tee <justin.tee@broadcom.com> Date: Wed Jun 18 12:21:31 2025 -0700 scsi: lpfc: Simplify error handling for failed lpfc_get_sli4_parameters cmd There are unnecessary checks on an HBA's interface type and family before erroring out a failed lpfc_get_sli4_parameters mailbox command. Simplify the error handling by logging a message and proceeding to memory free labels. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20250618192138.124116-7-justintee8345@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Paul Ely <paely@redhat.com>
1 parent 9c00084 commit 58213a5

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

drivers/scsi/lpfc/lpfc_init.c

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7916,8 +7916,6 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
79167916
int longs;
79177917
int extra;
79187918
uint64_t wwn;
7919-
u32 if_type;
7920-
u32 if_fam;
79217919

79227920
phba->sli4_hba.num_present_cpu = lpfc_present_cpu;
79237921
phba->sli4_hba.num_possible_cpu = cpumask_last(cpu_possible_mask) + 1;
@@ -8178,28 +8176,11 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
81788176
*/
81798177
rc = lpfc_get_sli4_parameters(phba, mboxq);
81808178
if (rc) {
8181-
if_type = bf_get(lpfc_sli_intf_if_type,
8182-
&phba->sli4_hba.sli_intf);
8183-
if_fam = bf_get(lpfc_sli_intf_sli_family,
8184-
&phba->sli4_hba.sli_intf);
8185-
if (phba->sli4_hba.extents_in_use &&
8186-
phba->sli4_hba.rpi_hdrs_in_use) {
8187-
lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
8188-
"2999 Unsupported SLI4 Parameters "
8189-
"Extents and RPI headers enabled.\n");
8190-
if (if_type == LPFC_SLI_INTF_IF_TYPE_0 &&
8191-
if_fam == LPFC_SLI_INTF_FAMILY_BE2) {
8192-
mempool_free(mboxq, phba->mbox_mem_pool);
8193-
rc = -EIO;
8194-
goto out_free_bsmbx;
8195-
}
8196-
}
8197-
if (!(if_type == LPFC_SLI_INTF_IF_TYPE_0 &&
8198-
if_fam == LPFC_SLI_INTF_FAMILY_BE2)) {
8199-
mempool_free(mboxq, phba->mbox_mem_pool);
8200-
rc = -EIO;
8201-
goto out_free_bsmbx;
8202-
}
8179+
lpfc_log_msg(phba, KERN_WARNING, LOG_INIT,
8180+
"2999 Could not get SLI4 parameters\n");
8181+
rc = -EIO;
8182+
mempool_free(mboxq, phba->mbox_mem_pool);
8183+
goto out_free_bsmbx;
82038184
}
82048185

82058186
/*

0 commit comments

Comments
 (0)