OSDN Git Service

scsi: hisi_sas: Fix phyup timeout on FPGA
authorQi Liu <liuqi115@huawei.com>
Wed, 15 Dec 2021 14:37:40 +0000 (22:37 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 17 Dec 2021 03:59:58 +0000 (22:59 -0500)
commit37310bad7fa645b21653fd7f13cb6b376d80c919
tree774f660e0d8d6cebe29a100f126cc2b944e8d962
parent16775db613c2bdea09705dcb876942c0641a1098
scsi: hisi_sas: Fix phyup timeout on FPGA

The OOB interrupt and phyup interrupt handlers may run out-of-order in high
CPU usage scenarios. Since the hisi_sas_phy.timer is added in
hisi_sas_phy_oob_ready() and disarmed in phy_up_v3_hw(), this out-of-order
execution will cause hisi_sas_phy.timer timeout to trigger.

To solve, protect hisi_sas_phy.timer and .attached with a lock, and ensure
that the timer won't be added after phyup handler completes.

Link: https://lore.kernel.org/r/1639579061-179473-8-git-send-email-john.garry@huawei.com
Signed-off-by: Qi Liu <liuqi115@huawei.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_main.c
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c