All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lu Baolu <baolu.lu@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lu Baolu <baolu.lu@linux.intel.com>
Subject: [PATCH v2 0/3] usb: notify hcd when USB device suspend or resume
Date: Wed,  6 May 2015 15:39:59 +0800	[thread overview]
Message-ID: <1430898002-24748-1-git-send-email-baolu.lu@linux.intel.com> (raw)

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:
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      | 29 +++++++++++++++++++++++++++
 drivers/usb/core/hub.c      | 16 +++++++++++++++
 drivers/usb/host/xhci-hub.c | 49 +--------------------------------------------
 drivers/usb/host/xhci.c     | 40 ++++++++++++++++++++++++++++++++++++
 drivers/usb/host/xhci.h     |  5 +++++
 include/linux/usb/hcd.h     | 10 ++++++++-
 6 files changed, 100 insertions(+), 49 deletions(-)

-- 
2.1.0


             reply	other threads:[~2015-05-06  7:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06  7:39 Lu Baolu [this message]
2015-05-06  7:40 ` [PATCH v2 1/3] usb: notify hcd when USB device suspend or resume Lu Baolu
2015-05-06 14:35   ` Alan Stern
2015-05-07  0:27     ` Lu, Baolu
2015-05-07 14:34       ` Alan Stern
2015-05-08  1:14         ` Lu, Baolu
2015-05-08 14:21           ` Alan Stern
2015-05-09  0:42             ` Lu, Baolu
2015-05-11 14:25               ` Alan Stern
2015-05-12  2:05                 ` Lu, Baolu
2015-05-12 15:54                   ` Alan Stern
2015-05-13  2:36                     ` Lu, Baolu
2015-05-13 14:14                       ` Alan Stern
2015-05-08  7:55     ` Lu, Baolu
2015-05-06  7:40 ` [PATCH v2 2/3] usb: xhci: implement device_suspend/device_resume entries Lu Baolu
2015-05-06 14:30   ` Alan Stern
2015-05-07  0:30     ` Lu, Baolu
2015-05-06  7:40 ` [PATCH v2 3/3] usb: xhci: remove stop device and ring doorbell in hub control and bus suspend Lu Baolu

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=1430898002-24748-1-git-send-email-baolu.lu@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --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 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.