diff mbox series

usb: core: Add PM runtime calls to usb_hcd_platform_shutdown

Message ID 20190322215405.27453-1-tony@atomide.com (mailing list archive)
State New, archived
Headers show
Series usb: core: Add PM runtime calls to usb_hcd_platform_shutdown | expand

Commit Message

Tony Lindgren March 22, 2019, 9:54 p.m. UTC
If ohci-platform is runtime suspended, we can currently get an "imprecise
external abort" on reboot with ohci-platform loaded when PM runtime
is implemented for the SoC.

Let's fix this by adding PM runtime support to usb_hcd_platform_shutdown.

Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/usb/core/hcd.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Alan Stern March 23, 2019, 3:22 p.m. UTC | #1
On Fri, 22 Mar 2019, Tony Lindgren wrote:

> If ohci-platform is runtime suspended, we can currently get an "imprecise
> external abort" on reboot with ohci-platform loaded when PM runtime
> is implemented for the SoC.
> 
> Let's fix this by adding PM runtime support to usb_hcd_platform_shutdown.
> 
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/usb/core/hcd.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -3017,6 +3017,9 @@ usb_hcd_platform_shutdown(struct platform_device *dev)
>  {
>  	struct usb_hcd *hcd = platform_get_drvdata(dev);
>  
> +	/* No need for pm_runtime_put(), we're shutting down */
> +	pm_runtime_get_sync(&dev->dev);
> +
>  	if (hcd->driver->shutdown)
>  		hcd->driver->shutdown(hcd);
>  }

Acked-by: Alan Stern <stern@rowland.harvard.edu>
diff mbox series

Patch

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -3017,6 +3017,9 @@  usb_hcd_platform_shutdown(struct platform_device *dev)
 {
 	struct usb_hcd *hcd = platform_get_drvdata(dev);
 
+	/* No need for pm_runtime_put(), we're shutting down */
+	pm_runtime_get_sync(&dev->dev);
+
 	if (hcd->driver->shutdown)
 		hcd->driver->shutdown(hcd);
 }