Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Xingui Yang <yangxingui@huawei.com>
To: <john.g.garry@oracle.com>, <yanaijie@huawei.com>,
	<jejb@linux.ibm.com>, <martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linuxarm@huawei.com>, <liyihang9@h-partners.com>,
	<yangxingui@huawei.com>, <liuyonglong@huawei.com>,
	<kangfenglong@huawei.com>
Subject: [PATCH v2 3/3] scsi: hisi_sas: add support for dev info update notification
Date: Wed, 13 May 2026 10:16:03 +0800	[thread overview]
Message-ID: <20260513021603.3023329-4-yangxingui@huawei.com> (raw)
In-Reply-To: <20260513021603.3023329-1-yangxingui@huawei.com>

Implement the lldd_dev_info_update callback for hisi_sas driver. When
a device's information changes (such as linkrate), clear the old ITCT
entry and setup a new one to reflect the new settings. This ensures the
hardware uses the correct information after events like cable reconnection
or renegotiation.

Signed-off-by: Xingui Yang <yangxingui@huawei.com>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 944ce19ae2fc..095960aef6d8 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -900,6 +900,21 @@ static int hisi_sas_dev_found(struct domain_device *device)
 	return rc;
 }
 
+static void hisi_sas_dev_info_update(struct domain_device *device)
+{
+	struct hisi_hba *hisi_hba = dev_to_hisi_hba(device);
+	struct hisi_sas_device *sas_dev = device->lldd_dev;
+	struct device *dev = hisi_hba->dev;
+
+	if (!sas_dev)
+		return;
+
+	dev_info(dev, "update itct for device %016llx\n",
+		 SAS_ADDR(device->sas_addr));
+	hisi_hba->hw->clear_itct(hisi_hba, sas_dev);
+	hisi_hba->hw->setup_itct(hisi_hba, sas_dev);
+}
+
 int hisi_sas_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim)
 {
 	struct domain_device *dev = sdev_to_domain_dev(sdev);
@@ -2168,6 +2183,7 @@ EXPORT_SYMBOL_GPL(hisi_sas_stt);
 static struct sas_domain_function_template hisi_sas_transport_ops = {
 	.lldd_dev_found		= hisi_sas_dev_found,
 	.lldd_dev_gone		= hisi_sas_dev_gone,
+	.lldd_dev_info_update	= hisi_sas_dev_info_update,
 	.lldd_execute_task	= hisi_sas_queue_command,
 	.lldd_control_phy	= hisi_sas_control_phy,
 	.lldd_abort_task	= hisi_sas_abort_task,
-- 
2.43.0


  parent reply	other threads:[~2026-05-13  2:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13  2:16 [PATCH v2 0/3] scsi: libsas: handle linkrate change in sas_rediscover_dev Xingui Yang
2026-05-13  2:16 ` [PATCH v2 1/3] scsi: libsas: refactor sas_ex_to_ata() using new helper sas_ex_to_dev() Xingui Yang
2026-05-13  6:18   ` Jason Yan
2026-05-13  2:16 ` [PATCH v2 2/3] scsi: libsas: add lldd_dev_info_update callback for device info changes Xingui Yang
2026-05-13  6:22   ` Jason Yan
2026-05-13  2:16 ` Xingui Yang [this message]
2026-05-13  6:23   ` [PATCH v2 3/3] scsi: hisi_sas: add support for dev info update notification Jason Yan
2026-05-13  7:29 ` [PATCH v2 0/3] scsi: libsas: handle linkrate change in sas_rediscover_dev John Garry
2026-05-13  8:14   ` yangxingui

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=20260513021603.3023329-4-yangxingui@huawei.com \
    --to=yangxingui@huawei.com \
    --cc=jejb@linux.ibm.com \
    --cc=john.g.garry@oracle.com \
    --cc=kangfenglong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liuyonglong@huawei.com \
    --cc=liyihang9@h-partners.com \
    --cc=martin.petersen@oracle.com \
    --cc=yanaijie@huawei.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