All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: xhci: Disable runtime PM suspend for quirky controllers.
@ 2013-05-24 18:12 Shawn Nematbakhsh
  2013-05-24 21:05 ` Sarah Sharp
  0 siblings, 1 reply; 13+ messages in thread
From: Shawn Nematbakhsh @ 2013-05-24 18:12 UTC (permalink / raw)
  To: linux-usb
  Cc: Sarah Sharp, Greg Kroah-Hartman, linux-kernel, Julius Werner,
	Shawn Nematbakhsh

If a USB controller with XHCI_RESET_ON_RESUME goes to runtime suspend,
a reset will be performed upon runtime resume. Any previously suspended
devices attached to the controller will be re-enumerated at this time.
This will cause problems, for example, if an open system call on the
device triggered the resume (the open call will fail).

Note that this change is only relevant when persist_enabled is not set
for USB devices.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
---
 drivers/usb/host/xhci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index b4aa79d..7455156 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4687,6 +4687,12 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
 
 	get_quirks(dev, xhci);
 
+	/* If we are resetting upon resume, we must disable runtime PM.
+	 * Otherwise, an open() syscall to a device on our runtime suspended
+	 * controller will trigger controller reset and device re-enumeration */
+	if (xhci->quirks & XHCI_RESET_ON_RESUME)
+		pm_runtime_get_noresume(dev);
+
 	/* Make sure the HC is halted. */
 	retval = xhci_halt(xhci);
 	if (retval)
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-08-12 15:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-24 18:12 [PATCH] usb: xhci: Disable runtime PM suspend for quirky controllers Shawn Nematbakhsh
2013-05-24 21:05 ` Sarah Sharp
2013-05-25 14:11   ` Alan Stern
2013-05-25 16:59     ` Shawn Nematbakhsh
     [not found]     ` <CALaWCOOGEDtF1z29df2ST9kV-VpMa9VbvFK0Hh71WJG5f_pngA@mail.gmail.com>
2013-05-28 20:58       ` Sarah Sharp
2013-05-28 21:41         ` Julius Werner
2013-05-29 14:23           ` Alan Stern
2013-05-29 19:38           ` Sarah Sharp
2013-05-29 20:11             ` Alan Stern
2013-05-29 20:32             ` Don Zickus
2013-06-03 11:33               ` Oliver Neukum
2013-08-09 17:22       ` Sarah Sharp
2013-08-12 15:49         ` Shawn Nematbakhsh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.