linux-stable/drivers/scsi/libsas
Xingui Yang 7b1c815aab scsi: libsas: Fix disk not being scanned in after being removed
commit 8e68a458bc upstream.

As of commit d8649fc1c5 ("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: d8649fc1c5 ("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>
2024-04-03 15:32:50 +02:00
..
Kconfig scsi: libsas: Drop BLK_DEV_BSGLIB selection 2021-07-27 00:06:42 -04:00
Makefile scsi: libsas: Allow libsas to include SCSI header files directly 2021-07-20 23:11:17 -04:00
sas_ata.c ata changes for 6.6 2023-09-05 12:37:28 -07:00
sas_discover.c scsi: libsas: Declare sas_discover_end_dev() static 2023-09-13 21:06:44 -04:00
sas_event.c scsi: libsas: Use bool for queue_work() return code 2022-02-27 21:48:30 -05:00
sas_expander.c scsi: libsas: Fix disk not being scanned in after being removed 2024-04-03 15:32:50 +02:00
sas_host_smp.c scsi: libsas: Delete struct scsi_core 2023-08-21 17:50:58 -04:00
sas_init.c scsi: libsas: Declare sas_set_phy_speed() static 2023-09-13 21:06:44 -04:00
sas_internal.h scsi: libsas: Move local functions declarations to sas_internal.h 2023-09-13 21:06:44 -04:00
sas_phy.c scsi: libsas: Delete struct scsi_core 2023-08-21 17:50:58 -04:00
sas_port.c scsi: libsas: Delete struct scsi_core 2023-08-21 17:50:58 -04:00
sas_scsi_host.c scsi: libsas: Simplify sas_queue_reset() and remove unused code 2023-08-30 21:24:50 -04:00
sas_task.c scsi: libsas: Use enum for response frame DATAPRES field 2022-02-19 15:59:34 -05:00