mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shirong Zhao <shxzhaosr@163.com>
To: "Martin K . Petersen" <mkp@kernel.org>,
	Sathya Prakash <sathya.prakash@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
	Dongdong Hao <doubled@leap-io-kernel.com>
Cc: "James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
	Kashyap Desai <kashyap.desai@broadcom.com>,
	Sumit Saxena <sumit.saxena@broadcom.com>,
	Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
	Ranjan Kumar <ranjan.kumar@broadcom.com>,
	MPT-FusionLinux.pdl@broadcom.com,
	mpi3mr-linuxdrv.pdl@broadcom.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] scsi: leapraid: check set_identify result in update_links
Date: Fri,  9 Oct 2026 18:23:12 +0800	[thread overview]
Message-ID: <20261009102313.18-4-shxzhaosr@163.com> (raw)
In-Reply-To: <20261009102313.18-1-shxzhaosr@163.com>

leapraid_transport_update_links() ignores the return value of
leapraid_transport_set_identify(), which leaves the identify struct
untouched on FW query failure (recovery in progress, config page
error).  The phy is then attached using a stale
card_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@163.com>
---
 drivers/scsi/leapraid/leapraid_transport.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/leapraid/leapraid_transport.c b/drivers/scsi/leapraid/leapraid_transport.c
index 77ffbd6dd..38e63327d 100644
--- a/drivers/scsi/leapraid/leapraid_transport.c
+++ b/drivers/scsi/leapraid/leapraid_transport.c
@@ -1150,9 +1150,9 @@ void leapraid_transport_update_links(
 	card_phy->attached_hdl = hdl;
 	spin_unlock_irqrestore(&adapter->dev_topo.topo_node_lock, flags);
 
-	if (hdl && link_rate >= LEAPRAID_SAS_NEG_LINK_RATE_1_5) {
-		leapraid_transport_set_identify(adapter, hdl,
-						&card_phy->remote_identify);
+	if (hdl && link_rate >= LEAPRAID_SAS_NEG_LINK_RATE_1_5 &&
+	    !leapraid_transport_set_identify(adapter, hdl,
+					     &card_phy->remote_identify)) {
 		if (topo_node->hdl <= adapter->dev_topo.card.phys_num &&
 		    adapter->adapter_attr.enable_mp) {
 			list_for_each_entry(card_port,


      parent reply	other threads:[~2026-10-09 10:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 10:23 [PATCH 0/3] scsi: " Shirong Zhao
2026-10-09 10:23 ` [PATCH 1/3] scsi: mpt3sas: " Shirong Zhao
2026-10-09 10:23 ` [PATCH 2/3] scsi: mpi3mr: " Shirong Zhao
2026-10-09 10:23 ` Shirong Zhao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261009102313.18-4-shxzhaosr@163.com \
    --to=shxzhaosr@163.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=doubled@leap-io-kernel.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mkp@kernel.org \
    --cc=mpi3mr-linuxdrv.pdl@broadcom.com \
    --cc=ranjan.kumar@broadcom.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    --cc=sumit.saxena@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®