Skip to content

Commit 9cf927d

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-103751 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 0c985d8 commit 9cf927d

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
@@ -7918,8 +7918,6 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba)
79187918
int longs;
79197919
int extra;
79207920
uint64_t wwn;
7921-
u32 if_type;
7922-
u32 if_fam;
79237921

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

82078188
/*

0 commit comments

Comments
 (0)