Re: [PATCH v2 2/3] scsi: libsas: add lldd_dev_info_update callback for device info changes

From: Jason Yan

Date: Wed May 13 2026 - 02:22:42 EST


在 2026/5/13 10:16, Xingui Yang 写道:
When a device attached to an expander phy experiences a linkrate change
(e.g., due to cable reconnection or negotiation), the current code in
sas_rediscover_dev() treats it as "broadcast flutter" and takes no action
if the SAS address and device type remain unchanged.

However, for drivers like hisi_sas, the ITCT entry needs to be updated
to reflect the new linkrate. Without this update, the hardware continues
using stale linkrate information, which can cause performance issues or
protocol errors.

Introduce a new LLDD callback lldd_dev_info_update() to notify the
low-level driver when a device's information changes (such as linkrate),
allowing the driver to update its hardware structures accordingly. This
callback is designed to be extensible for future device information
updates.

Signed-off-by: Xingui Yang<yangxingui@xxxxxxxxxx>
---
drivers/scsi/libsas/sas_discover.c | 12 ++++++++++++
drivers/scsi/libsas/sas_expander.c | 13 +++++++++++--
drivers/scsi/libsas/sas_internal.h | 1 +
include/scsi/libsas.h | 1 +
4 files changed, 25 insertions(+), 2 deletions(-)

Reviewed-by: Jason Yan <yanaijie@xxxxxxxxxx>