scsi: hisi_sas: Change hisi_sas_control_phy() phyup timeout
authorXiang Chen <chenxiang66@hisilicon.com>
Thu, 24 Feb 2022 11:51:25 +0000 (19:51 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 28 Feb 2022 02:46:40 +0000 (21:46 -0500)
commit512623de5239d8f0da5d6a8234e7e4adecf33947
tree603aca445d64ff4e76bada4a58dab384cd1dc75c
parentc4e070457a93705e56ed06b3910d9e5fe56d3be3
scsi: hisi_sas: Change hisi_sas_control_phy() phyup timeout

The time of phyup not only depends on the controller but also the type of
disk connected. As an example, from experience, for some SATA disks the
amount of time from reset/power-on to receive the D2H FIS for phyup can
take upto and more than 10s sometimes. According to the specification of
some SATA disks such as ST14000NM0018, the max time from power-on to ready
is 30s.

Based on this the current timeout of phyup at 2s which is not enough. So
set the value as HISI_SAS_WAIT_PHYUP_TIMEOUT (30s) in
hisi_sas_control_phy().

For v3 hw there is a pre-existing workaround for a HW bug, being that we
issue a link reset when the OOB occurs but the phyup does not. The current
phyup timeout is HISI_SAS_WAIT_PHYUP_TIMEOUT. So if this does occur from
when issuing a phy enable or similar via hisi_sas_control_phy(), the
subsequent HW workaround linkreset processing calls hisi_sas_control_phy(),
but this will pend the original phy reset timing out, so it is safe.

Link: https://lore.kernel.org/r/1645703489-87194-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>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_main.c