All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/3] usb: add a hcd notify entry in hc_driver
@ 2015-05-04  3:15 Lu Baolu
  2015-05-04  3:15 ` [RFC][PATCH 1/3] " Lu Baolu
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Lu Baolu @ 2015-05-04  3:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Mathias Nyman, Alan Stern
  Cc: linux-usb, linux-kernel, Lu Baolu

This patch adds a new entry pointer in hc_driver. With this new entry,
USB core can notify host driver when something happens and host driver
is willing to be notified. One use case of this interface comes from
xHCI compatible host controller driver.

The xHCI spec is designed to allow an xHC implementation to cache the
endpoint state. Caching endpoint state allows an xHC to reduce latency
when handling ERDYs and other USB asynchronous events. However holding
this state in xHC consumes resources and power. The xHCI spec designs
some methods through which host controller driver can hint xHC about
how to optimize its operation, e.g. to determine when it holds state
internally or pushes it out to memory, when to power down logic, etc.

When a USB device is going to suspend, states of all endpoints cached
in the xHC should be pushed out to memory to save power and resources.
Vice versa, when a USB device resumes, those states should be brought
back to the cache. USB core suspends or resumes a USB device by sending
set/clear port feature requests to the parent hub where the USB device
is connected. Unfortunately, these operations are transparent to xHCI
driver unless the USB device is plugged in a root port. This patch
utilizes the notify interface to notify xHCI driver whenever a USB
device's power state is changed.

It is harmless if a USB devices under USB 3.0 host controller suspends
or resumes without a notification to hcd driver. However there may be
less opportunities for power savings and there may be increased latency
for restarting an endpoint. The precise impact will be different for
each xHC implementation. It all depends on what an implementation does
with the hints.


Lu Baolu (3):
  usb: add a hcd notify entry in hc_driver
  usb: xhci: implement hc_driver notify entry
  usb: xhci: cleanup unnecessary stop device and ring doorbell
    operations

 drivers/usb/core/generic.c  | 10 +++++++--
 drivers/usb/core/hcd.c      | 23 +++++++++++++++++++++
 drivers/usb/host/xhci-hub.c | 49 +--------------------------------------------
 drivers/usb/host/xhci.c     | 28 ++++++++++++++++++++++++++
 drivers/usb/host/xhci.h     |  3 +++
 include/linux/usb/hcd.h     | 11 +++++++++-
 6 files changed, 73 insertions(+), 51 deletions(-)

-- 
2.1.0


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

end of thread, other threads:[~2015-05-06  1:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04  3:15 [RFC][PATCH 0/3] usb: add a hcd notify entry in hc_driver Lu Baolu
2015-05-04  3:15 ` [RFC][PATCH 1/3] " Lu Baolu
2015-05-04  8:14   ` Greg Kroah-Hartman
2015-05-05 22:36     ` Lu, Baolu
2015-05-04 14:28   ` Alan Stern
2015-05-05  1:05     ` Lu, Baolu
2015-05-05 14:50       ` Alan Stern
2015-05-06  1:07         ` Lu, Baolu
2015-05-04  3:15 ` [RFC][PATCH 2/3] usb: xhci: implement hc_driver notify entry Lu Baolu
2015-05-04  3:15 ` [RFC][PATCH 3/3] usb: xhci: cleanup unnecessary stop device and ring doorbell operations Lu Baolu

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.