Skip to content

Commit

Permalink
scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW
Browse files Browse the repository at this point in the history
[ Upstream commit 9b5387f ]

If we fail to notify the phy up event then undo the RPM resume, as the phy
up notify event handling pairs with that RPM resume.

Link: https://lore.kernel.org/r/1651839939-101188-1-git-send-email-john.garry@huawei.com
Reported-by: Yihang Li <liyihang6@hisilicon.com>
Tested-by: Yihang Li <liyihang6@hisilicon.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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Xiang Chen authored and gregkh committed Jun 9, 2022
1 parent b142ee6 commit 15c7eb6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
Expand Up @@ -1561,9 +1561,15 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba)

phy->port_id = port_id;

/* Call pm_runtime_put_sync() with pairs in hisi_sas_phyup_pm_work() */
/*
* Call pm_runtime_get_noresume() which pairs with
* hisi_sas_phyup_pm_work() -> pm_runtime_put_sync().
* For failure call pm_runtime_put() as we are in a hardirq context.
*/
pm_runtime_get_noresume(dev);
hisi_sas_notify_phy_event(phy, HISI_PHYE_PHY_UP_PM);
res = hisi_sas_notify_phy_event(phy, HISI_PHYE_PHY_UP_PM);
if (!res)
pm_runtime_put(dev);

res = IRQ_HANDLED;

Expand Down

0 comments on commit 15c7eb6

Please sign in to comment.