linux-stable/drivers/scsi/hisi_sas
Xiang Chen 046ab7d0f5 scsi: hisi_sas: Wait for phyup in hisi_sas_control_phy()
When issuing a hardreset/linkreset/phy_set_linkrate from sysfs, the phy
will be disabled and re-enabled for the directly attached scenario.

It takes some time for the phy to come back up after re-enabling the phy.
If the controller becomes suspended while waiting for the phy to come back,
the phy up may be lost (along with the disk).

To solve this problem, wait for the phy up to occur with a timeout. Indeed
this is already done in hisi_sas_debug_I_T_nexus_reset() for local phys, so
just relocate the functionality to hisi_sas_control_phy().

Since the HA workqueue is drained when suspending the controller, and the
phy control function is called from the same workqueue, we can guarantee
that the controller will not be suspended during this period.

Link: https://lore.kernel.org/r/1634041588-74824-3-git-send-email-john.garry@huawei.com
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-10-12 22:46:06 -04:00
..
hisi_sas.h scsi: hisi_sas: Initialise devices in .slave_alloc callback 2021-10-12 22:46:06 -04:00
hisi_sas_main.c scsi: hisi_sas: Wait for phyup in hisi_sas_control_phy() 2021-10-12 22:46:06 -04:00
hisi_sas_v1_hw.c scsi: hisi_sas: Wait for phyup in hisi_sas_control_phy() 2021-10-12 22:46:06 -04:00
hisi_sas_v2_hw.c scsi: hisi_sas: Wait for phyup in hisi_sas_control_phy() 2021-10-12 22:46:06 -04:00
hisi_sas_v3_hw.c scsi: hisi_sas: Wait for phyup in hisi_sas_control_phy() 2021-10-12 22:46:06 -04:00
Kconfig scsi: hisi_sas: Enable debugfs support by default 2021-01-26 23:02:11 -05:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00