scsi: hisi_sas: workaround STP link SoC bug
authorXiaofei Tan <tanxiaofei@huawei.com>
Mon, 10 Apr 2017 13:21:56 +0000 (21:21 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 12 Apr 2017 02:01:03 +0000 (22:01 -0400)
commitc7b9d369e4073399f97e6e090570f7df80f050dc
tree8d869c6b29265dc9dbf3b35fa3394359a5648ded
parentfcabb09e59a71ee7878ca3681828eed6e2c15cd2
scsi: hisi_sas: workaround STP link SoC bug

After resetting the controller, the process of scanning SATA disks
attached to an expander may fail occasionally. The issue is that the
controller can't close the STP link created by target if the max link
time is 0.

To workaround this issue, we reject STP link after resetting the
controller, and change the corresponding PHY to accept STP link only
after receiving data.

We do this check in cq interrupt handler. In order not to reduce
efficiency, we use an variable to control whether we should check and
change PHY to accept STP link.

The function phys_reject_stp_links_v2_hw() should be called after
resetting the controller.

The solution of another SoC bug "SATA IO timeout", that also uses the
same register to control STP link, is not effective before the PHY
accepts STP link.

Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas.h
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c