aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2013-01-25 17:09:42 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-25 18:06:01 -0500
commitda0aa7169b97d90f4af39a9dc84d58bbe19d7e78 (patch)
tree7d5e1d583787b07d6627f4acd46da1cc38deaf93 /include
parent6e0c3339a6f19d748f16091d0a05adeb1e1f822b (diff)
USB: add usb_hcd_{start,end}_port_resume
This patch (as1649) adds a mechanism for host controller drivers to inform usbcore when they have begun or ended resume signalling on a particular root-hub port. The core will then make sure that the root hub does not get runtime-suspended while the port resume is going on. Since commit 596d789a211d134dc5f94d1e5957248c204ef850 (USB: set hub's default autosuspend delay as 0), the system tries to suspend hubs whenever they aren't in use. While a root-hub port is being resumed, the root hub does not appear to be in use. Attempted runtime suspends fail because of the ongoing port resume, but the PM core just keeps on trying over and over again. We want to prevent this wasteful effort. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Tested-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb.h2
-rw-r--r--include/linux/usb/hcd.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 689b14b26c8d..4d22d0f6167a 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -357,6 +357,8 @@ struct usb_bus {
357 int bandwidth_int_reqs; /* number of Interrupt requests */ 357 int bandwidth_int_reqs; /* number of Interrupt requests */
358 int bandwidth_isoc_reqs; /* number of Isoc. requests */ 358 int bandwidth_isoc_reqs; /* number of Isoc. requests */
359 359
360 unsigned resuming_ports; /* bit array: resuming root-hub ports */
361
360#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) 362#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
361 struct mon_bus *mon_bus; /* non-null when associated */ 363 struct mon_bus *mon_bus; /* non-null when associated */
362 int monitored; /* non-zero when monitored */ 364 int monitored; /* non-zero when monitored */
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 608050b2545f..0a78df5f6cfd 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -430,6 +430,9 @@ extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd);
430extern void usb_wakeup_notification(struct usb_device *hdev, 430extern void usb_wakeup_notification(struct usb_device *hdev,
431 unsigned int portnum); 431 unsigned int portnum);
432 432
433extern void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum);
434extern void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum);
435
433/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ 436/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */
434#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) 437#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)
435#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) 438#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))