]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scsi: libsas: Fix disk not being scanned in after being removed
authorXingui Yang <yangxingui@huawei.com>
Thu, 7 Mar 2024 14:14:13 +0000 (14:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:29:03 +0000 (15:29 +0200)
commit2048ff503f4318868ca7dc004b3fc5c5c755084b
treece3dc0ff5748f8d48cac01fb46a734ded40aa18b
parentf23db75792831f6dc4e057dab35a8c8f51b45dd7
scsi: libsas: Fix disk not being scanned in after being removed

commit 8e68a458bcf5b5cb9c3624598bae28f08251601f upstream.

As of commit d8649fc1c5e4 ("scsi: libsas: Do discovery on empty PHY to
update PHY info"), do discovery will send a new SMP_DISCOVER and update
phy->phy_change_count. We found that if the disk is reconnected and phy
change_count changes at this time, the disk scanning process will not be
triggered.

Therefore, call sas_set_ex_phy() to update the PHY info with the results of
the last query. And because the previous phy info will be used when calling
sas_unregister_devs_sas_addr(), sas_unregister_devs_sas_addr() should be
called before sas_set_ex_phy().

Fixes: d8649fc1c5e4 ("scsi: libsas: Do discovery on empty PHY to update PHY info")
Signed-off-by: Xingui Yang <yangxingui@huawei.com>
Link: https://lore.kernel.org/r/20240307141413.48049-3-yangxingui@huawei.com
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/libsas/sas_expander.c