* [PATCH] scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW
@ 2022-05-06 12:25 John Garry
2022-05-11 1:48 ` Martin K. Petersen
2022-05-17 2:16 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: John Garry @ 2022-05-06 12:25 UTC (permalink / raw)
To: jejb, martin.petersen
Cc: linux-scsi, linux-kernel, linuxarm, Xiang Chen, John Garry
From: Xiang Chen <chenxiang66@hisilicon.com>
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.
Tested-by: Yihang Li <liyihang6@hisilicon.com>
Reported-by: Yihang Li <liyihang6@hisilicon.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---
Please consider for 5.19, thanks!
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 79f87d7c3e68..7d819fc0395e 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -1563,9 +1563,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;
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW
2022-05-06 12:25 [PATCH] scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW John Garry
@ 2022-05-11 1:48 ` Martin K. Petersen
2022-05-17 2:16 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-05-11 1:48 UTC (permalink / raw)
To: John Garry
Cc: jejb, martin.petersen, linux-scsi, linux-kernel, linuxarm, Xiang Chen
John,
> 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.
Applied to 5.19/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW
2022-05-06 12:25 [PATCH] scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW John Garry
2022-05-11 1:48 ` Martin K. Petersen
@ 2022-05-17 2:16 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-05-17 2:16 UTC (permalink / raw)
To: John Garry, jejb
Cc: Martin K . Petersen, linuxarm, Xiang Chen, linux-kernel, linux-scsi
On Fri, 6 May 2022 20:25:39 +0800, John Garry wrote:
> From: Xiang Chen <chenxiang66@hisilicon.com>
>
> 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.
>
>
Applied to 5.19/scsi-queue, thanks!
[1/1] scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW
https://git.kernel.org/mkp/scsi/c/9b5387fe5af3
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-17 2:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 12:25 [PATCH] scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW John Garry
2022-05-11 1:48 ` Martin K. Petersen
2022-05-17 2:16 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).