From: Tony Lindgren <tony@atomide.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-omap@vger.kernel.org
Subject: usb: host: ohci-platform: Implement ohci_platform_shutdown
Date: Fri, 22 Mar 2019 11:11:27 -0700 [thread overview]
Message-ID: <20190322181127.60640-1-tony@atomide.com> (raw)
If OHCI 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 implementing ohci_platform_shutdown with PM runtime
calls clocking the hardware before calling hcd->driver->shutdown.
Fixes: 0aa0b93e7af6 ("usb: host: ohci-platform: Add basic runtime PM support")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/usb/host/ohci-platform.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c
--- a/drivers/usb/host/ohci-platform.c
+++ b/drivers/usb/host/ohci-platform.c
@@ -240,6 +240,22 @@ static int ohci_platform_probe(struct platform_device *dev)
return err;
}
+static void ohci_platform_shutdown(struct platform_device *pdev)
+{
+ struct usb_hcd *hcd = platform_get_drvdata(pdev);
+ int err;
+
+ err = pm_runtime_get_sync(&pdev->dev);
+ if (err < 0)
+ pm_runtime_put_noidle(&pdev->dev);
+
+ if (hcd->driver->shutdown)
+ hcd->driver->shutdown(hcd);
+
+ if (!err)
+ pm_runtime_put_sync(&pdev->dev);
+}
+
static int ohci_platform_remove(struct platform_device *dev)
{
struct usb_hcd *hcd = platform_get_drvdata(dev);
@@ -326,7 +342,7 @@ static struct platform_driver ohci_platform_driver = {
.id_table = ohci_platform_table,
.probe = ohci_platform_probe,
.remove = ohci_platform_remove,
- .shutdown = usb_hcd_platform_shutdown,
+ .shutdown = ohci_platform_shutdown,
.driver = {
.name = "ohci-platform",
.pm = &ohci_platform_pm_ops,
next reply other threads:[~2019-03-22 18:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-22 18:11 Tony Lindgren [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-03-22 18:37 usb: host: ohci-platform: Implement ohci_platform_shutdown Alan Stern
2019-03-22 19:30 Tony Lindgren
2019-03-22 20:03 Alan Stern
2019-03-22 20:41 Tony Lindgren
2019-03-22 21:01 Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190322181127.60640-1-tony@atomide.com \
--to=tony@atomide.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).