[4.14,105/136] usb/ehci-platform: Set PM runtime as active on resume

Message ID 20200623195308.955410923@linuxfoundation.org
State New
Headers show
Series
  • Untitled series #39558
Related show

Commit Message

Greg Kroah-Hartman June 23, 2020, 7:59 p.m.
From: Qais Yousef <qais.yousef@arm.com>

[ Upstream commit 16bdc04cc98ab0c74392ceef2475ecc5e73fcf49 ]

Follow suit of ohci-platform.c and perform pm_runtime_set_active() on
resume.

ohci-platform.c had a warning reported due to the missing
pm_runtime_set_active() [1].

[1] https://lore.kernel.org/lkml/20200323143857.db5zphxhq4hz3hmd@e107158-lin.cambridge.arm.com/

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
CC: Tony Prisk <linux@prisktech.co.nz>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Mathias Nyman <mathias.nyman@intel.com>
CC: Oliver Neukum <oneukum@suse.de>
CC: linux-arm-kernel@lists.infradead.org
CC: linux-usb@vger.kernel.org
CC: linux-kernel@vger.kernel.org
Link: https://lore.kernel.org/r/20200518154931.6144-3-qais.yousef@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/host/ehci-platform.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Qais Yousef July 17, 2020, 4:17 p.m. | #1
Hi Eugeniu

On 07/09/20 09:00, Eugeniu Rosca wrote:
> Hello everyone,

> 

> Cc: linux-renesas-soc

> Cc: linux-pm


[...]

> After integrating v4.14.186 commit 5410d158ca2a50 ("usb/ehci-platform:

> Set PM runtime as active on resume") into downstream v4.14.x, we started

> to consistently experience below panic [1] on every second s2ram of

> R-Car H3 Salvator-X Renesas reference board.

> 

> After some investigations, we concluded the following:

>  - the issue does not exist in vanilla v5.8-rc4+

>  - [bisecting shows that] the panic on v4.14.186 is caused by the lack

>    of v5.6-rc1 commit 987351e1ea7772 ("phy: core: Add consumer device

>    link support"). Getting evidence for that is easy. Reverting

>    987351e1ea7772 in vanilla leads to a similar backtrace [2].

> 

> Questions:

>  - Backporting 987351e1ea7772 ("phy: core: Add consumer device

>    link support") to v4.14.187 looks challenging enough, so probably not

>    worth it. Anybody to contradict this?

>  - Assuming no plans to backport the missing mainline commit to v4.14.x,

>    should the following three v4.14.186 commits be reverted on v4.14.x?

>    * baef809ea497a4 ("usb/ohci-platform: Fix a warning when hibernating")

>    * 9f33eff4958885 ("usb/xhci-plat: Set PM runtime as active on resume")

>    * 5410d158ca2a50 ("usb/ehci-platform: Set PM runtime as active on resume")


Thanks for investigating this.

Alan, Greg, do you have any ideas?

Let me know if there's anything I can help with.

Thanks

--
Qais Yousef

Patch

diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index f1908ea9fbd86..6fcd332880143 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -390,6 +390,11 @@  static int ehci_platform_resume(struct device *dev)
 	}
 
 	ehci_resume(hcd, priv->reset_on_resume);
+
+	pm_runtime_disable(dev);
+	pm_runtime_set_active(dev);
+	pm_runtime_enable(dev);
+
 	return 0;
 }
 #endif /* CONFIG_PM_SLEEP */