Skip to content

usb: notify hcd when USB device suspend or resume

Lu Baolu lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 3 repliesIn review
  2. v43 patches 3 repliesSuperseded
  3. v33 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v23 patches14 repliesSuperseded

Changes in v5 from the cover letter

- add Alan's ACK for 1/3

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3usb: notify hcd when USB device suspend or resumedrivers/usb/core/hcd.c drivers/usb/core/hub.c include/linux/usb/hcd.h+39 -10 replies
2/3usb: xhci: implement device_suspend/device_resume entriesdrivers/usb/host/xhci-hub.c drivers/usb/host/xhci.c drivers/usb/host/xhci.h+48 -11 reply
3/3usb: xhci: remove stop device and ring doorbell in hub control and bus suspenddrivers/usb/host/xhci-hub.c+0 -472 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchAlan Stern
1/3A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/3] usb: notify hcd when USB device suspend or resume

This patch series try to meet a design requirement in xHCI spec.

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.

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.

Change log:
v4->v5:
- add Alan's ACK for 1/3

v3->v4:
- remove unused 'msg' parameter in the callbacks

v2->v3:
- move two xhci specific comments from hub to xhci
- define xhci_device_suspend(resume) as NULL when no PM_CONFIG

v1->v2:
- make the callback name specific to the activity in question
- no need to export hcd_notify
- put the callback in the right place

Lu Baolu (3):
usb: notify hcd when USB device suspend or resume
usb: xhci: implement device_suspend/device_resume entries
usb: xhci: remove stop device and ring doorbell in hub control and bus
suspend

 drivers/usb/core/hcd.c      | 27 +++++++++++++++++++++++++
 drivers/usb/core/hub.c      |  5 +++++
 drivers/usb/host/xhci-hub.c | 49 +--------------------------------------------
 drivers/usb/host/xhci.c     | 38 +++++++++++++++++++++++++++++++++++
 drivers/usb/host/xhci.h     |  9 +++++++++
 include/linux/usb/hcd.h     |  8 +++++++-
 6 files changed, 87 insertions(+), 49 deletions(-)
Signature · 1 line
2.1.0