Re: [PATCH v3 3/3] scsi: libsas: Fix disk not being scanned in after being removed

From: John Garry
Date: Thu Mar 07 2024 - 05:10:22 EST


On 07/03/2024 09:37, Xingui Yang wrote:
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@xxxxxxxxxx>

I am also ok with a change to revert to allocating the resp memory with alloc_smp_resp(), but make the changes neat please:
Reviewed-by: John Garry <john.g.garry@xxxxxxxxxx>