[PATCH v2 3/3] scsi: lpfc: Return MBX status when a non-polled mbox cannot be issued
From: Wentao Liang
Date: Sat Nov 07 2026 - 11:23:16 EST
lpfc_sli_issue_mbox_s4() reports a failure to hand a command to the port
with an MBX status code in every path except one: when interrupts are not
enabled and the caller asked for MBX_NOWAIT, it returns -EIO. A negative
errno does not belong in that code space, and a caller has no MBX value to
test for this outcome.
Return MBXERR_ERROR, as lpfc_sli4_post_sync_mbox() already does for a
command it cannot post. lpfc_issue_lip() maps MBXERR_ERROR to -EIO, and
the bsg mailbox path now converts a failure of its own, so no positive
status is handed to a caller that expects an errno.
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
New in v2, at Paul's request.
drivers/scsi/lpfc/lpfc_sli.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 715b328d3d18..05a76b00702a 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -10121,7 +10121,7 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq,
if (flag == MBX_POLL)
rc = lpfc_sli4_post_sync_mbox(phba, mboxq);
else
- rc = -EIO;
+ rc = MBXERR_ERROR;
if (rc != MBX_SUCCESS)
lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | LOG_SLI,
"(%d):2541 Mailbox command x%x "