]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: hisi_sas: Prevent parallel controller reset and control phy command
authorQi Liu <liuqi115@huawei.com>
Wed, 15 Dec 2021 14:37:38 +0000 (22:37 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 17 Dec 2021 03:59:57 +0000 (22:59 -0500)
commitcad4661ba2c32e4d04c9a71d251cddc8ecc62ad1
tree37f9f47a87c8ba5fde57256dbafc3bba64eaa182
parent2a404b227769bd9879b8d3d14fed4cac32dab949
scsi: hisi_sas: Prevent parallel controller reset and control phy command

A user may issue a control phy command from sysfs at any time, even if the
controller is resetting.

If a phy is disabled by hardreset/linkreset command before calling
get_phys_state() in the reset path, the saved phy state may be incorrect.

To avoid incorrectly recording the phy state, use hisi_hba.sem to ensure
that the controller reset may not run at the same time as when the phy
control function is running.

Link: https://lore.kernel.org/r/1639579061-179473-6-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