Re: [PATCH] scsi: libsas: handle linkrate change in sas_rediscover_dev
From: Jason Yan
Date: Tue May 12 2026 - 09:39:16 EST
在 2026/5/12 15:12, 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.
This patch introduces a new LLDD callback lldd_dev_info_update() to notify
the low-level driver when a device's linkrate changes, allowing the driver
to update its hardware structures accordingly.
Additionally, refactor sas_ex_to_ata() to use a new helper function
sas_ex_to_dev() which returns any device type attached to an expander phy,
improving code reuse.
Could you split this refactor to another patch? This makes it easier to review.
祝一切顺利
Jason