diff options
| author | Xingui Yang <yangxingui@huawei.com> | 2026-08-11 12:03:34 +0800 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-08-13 21:53:50 -0400 |
| commit | db441dcb8c1452279956b7ea4e394b5ce8ce77f1 (patch) | |
| tree | 385cea4bcb70408ec6763e707acd4d5993d9b034 /scripts/objdiff | |
| parent | 4c2128c1a399318859d9eea0b74613d90f4bcb66 (diff) | |
| download | linux-next-db441dcb8c1452279956b7ea4e394b5ce8ce77f1.tar.gz linux-next-db441dcb8c1452279956b7ea4e394b5ce8ce77f1.zip | |
scsi: libsas: Add linkrate and sas_addr change detection in rediscover
Introduce sas_dev_is_flutter() and sas_rediscover_ex_phy() to improve
flutter and device replace detection during rediscovery.
sas_dev_is_flutter() calls sas_ex_phy_discover() before looking up the
child device via sas_ex_phy_to_dev(), ensuring the PHY state is always
updated and avoiding use-after-free since the child device pointer is
obtained after the sleeping SMP request completes.
Add validation for linkrate and sas_addr changes. When the SAS address
changes, phy->attached_sas_addr is restored to the original address
before returning false, so sas_unregister_devs_sas_addr() can properly
match and unregister the old device. The sas_addr check is ordered
before the linkrate check to avoid skipping the restoration when both
change simultaneously.
sas_rediscover_ex_phy() uses the async discovery pattern
(sas_discover_event) instead of the synchronous sas_discover_new() to
ensure proper ordering between device unregistration and rediscovery,
avoiding sysfs_warn_dup() errors.
Signed-off-by: Xingui Yang <yangxingui@huawei.com>
Suggested-by: John Garry <john.g.garry@oracle.com>
Link: https://patch.msgid.link/20260811040334.4184911-3-yangxingui@huawei.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'scripts/objdiff')
0 files changed, 0 insertions, 0 deletions
