aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
diff options
context:
space:
mode:
authorXiang Chen <chenxiang66@hisilicon.com>2021-12-20 19:21:36 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2021-12-22 23:38:31 -0500
commitae9b69e85eb7ecb32ddce7c04a10a3c69ad60e52 (patch)
tree6548d6e7619ef3d85f7fba7e532947292ec5ca60 /drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
parentscsi: libsas: Defer works of new phys during suspend (diff)
downloadlinux-dev-ae9b69e85eb7ecb32ddce7c04a10a3c69ad60e52.tar.xz
linux-dev-ae9b69e85eb7ecb32ddce7c04a10a3c69ad60e52.zip
scsi: hisi_sas: Keep controller active between ISR of phyup and the event being processed
It is possible that controller may become suspended between processing a phyup interrupt and the event being processed by libsas. As such, we can't ensure the controller is active when processing the phyup event - this may cause the phyup event to be lost or other issues. To avoid any possible issues, add pm_runtime_get_noresume() in phyup interrupt handler and pm_runtime_put_sync() in the work handler exit to ensure that we stay always active. Since we only want to call pm_runtime_get_noresume() for v3 hw, signal this will a new event, HISI_PHYE_PHY_UP_PM. Link: https://lore.kernel.org/r/1639999298-244569-14-git-send-email-chenxiang66@hisilicon.com Acked-by: John Garry <john.garry@huawei.com> Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hisi_sas/hisi_sas_v3_hw.c')
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas_v3_hw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 6d7fde38fe02..94eb48c93ab1 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -1561,7 +1561,9 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba)
phy->port_id = port_id;
- hisi_sas_notify_phy_event(phy, HISI_PHYE_PHY_UP);
+ /* Call pm_runtime_put_sync() with pairs in hisi_sas_phyup_pm_work() */
+ pm_runtime_get_noresume(dev);
+ hisi_sas_notify_phy_event(phy, HISI_PHYE_PHY_UP_PM);
res = IRQ_HANDLED;