[PATCH 2/3] scsi: mpi3mr: check set_identify result in update_links
From: Shirong Zhao
Date: Fri Oct 09 2026 - 06:24:45 EST
mpi3mr_update_links() ignores the return value of
mpi3mr_set_identify(), which leaves the identify struct untouched
on FW query failure (recovery in progress, config page error, bad
IOC status). The phy is then attached using a stale
mr_sas_phy->remote_identify.sas_address from before the failed query.
Fold the call into the if condition so a failed query takes the
existing zeroing else path (same "no valid identify" state as an
invalid handle/rate) instead of attaching with stale data. The next
successful link event re-fills the identify.
Verified against scsi.git fixes (469fa055664b), the current SCSI
fixes tree.
Signed-off-by: Shirong Zhao <shxzhaosr@xxxxxxx>
---
drivers/scsi/mpi3mr/mpi3mr_transport.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_transport.c b/drivers/scsi/mpi3mr/mpi3mr_transport.c
index 232af978d..abe8c4fb9 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
@@ -1093,9 +1093,9 @@ void mpi3mr_update_links(struct mpi3mr_ioc *mrioc,
mr_sas_phy = &mr_sas_node->phy[phy_number];
mr_sas_phy->attached_handle = handle;
spin_unlock_irqrestore(&mrioc->sas_node_lock, flags);
- if (handle && (link_rate >= MPI3_SAS_NEG_LINK_RATE_1_5)) {
- mpi3mr_set_identify(mrioc, handle,
- &mr_sas_phy->remote_identify);
+ if (handle && link_rate >= MPI3_SAS_NEG_LINK_RATE_1_5 &&
+ !mpi3mr_set_identify(mrioc, handle,
+ &mr_sas_phy->remote_identify)) {
mpi3mr_add_phy_to_an_existing_port(mrioc, mr_sas_node,
mr_sas_phy, mr_sas_phy->remote_identify.sas_address,
hba_port);