/openbmc/linux/drivers/usb/host/ |
H A D | xhci-hub.c | diff f217c980ca980e3a645b7485ea5eae9a747f4945 Mon Aug 05 15:36:00 CDT 2013 Sarah Sharp <sarah.a.sharp@linux.intel.com> xhci: Don't enable/disable RWE on bus suspend/resume.
The RWE bit of the USB 2.0 PORTPMSC register is supposed to enable remote wakeup for devices in the lower power link state L1. It has nothing to do with the device suspend remote wakeup from L2. The RWE bit is designed to be set once (when USB 2.0 LPM is enabled for the port) and cleared only when USB 2.0 LPM is disabled for the port.
The xHCI bus suspend method was setting the RWE bit erroneously, and the bus resume method was clearing it. The xHCI 1.0 specification with errata up to Aug 12, 2012 says in section 4.23.5.1.1.1 "Hardware Controlled LPM":
"While Hardware USB2 LPM is enabled, software shall not modify the HIRDBESL or RWE fields of the USB2 PORTPMSC register..."
If we have previously enabled USB 2.0 LPM for a device, that means when the USB 2.0 bus is resumed, we violate the xHCI specification by clearing RWE. It also means that after a bus resume, the host would think remote wakeup is disabled from L1 for ports with USB 2.0 Link PM enabled, which is not what we want.
This patch should be backported to kernels as old as 3.2, that contain the commit 65580b4321eb36f16ae8b5987bfa1bb948fc5112 "xHCI: set USB2 hardware LPM". That was the first kernel that supported USB 2.0 Link PM.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org diff 65580b4321eb36f16ae8b5987bfa1bb948fc5112 Fri Sep 23 16:19:52 CDT 2011 Andiry Xu <andiry.xu@amd.com> xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state.
If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port.
Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
H A D | xhci-pci.c | diff 65580b4321eb36f16ae8b5987bfa1bb948fc5112 Fri Sep 23 16:19:52 CDT 2011 Andiry Xu <andiry.xu@amd.com> xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state.
If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port.
Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
H A D | xhci.h | diff 65580b4321eb36f16ae8b5987bfa1bb948fc5112 Fri Sep 23 16:19:52 CDT 2011 Andiry Xu <andiry.xu@amd.com> xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state.
If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port.
Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
H A D | xhci.c | diff 65580b4321eb36f16ae8b5987bfa1bb948fc5112 Fri Sep 23 16:19:52 CDT 2011 Andiry Xu <andiry.xu@amd.com> xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state.
If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port.
Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
/openbmc/linux/drivers/usb/core/ |
H A D | usb.h | diff 65580b4321eb36f16ae8b5987bfa1bb948fc5112 Fri Sep 23 16:19:52 CDT 2011 Andiry Xu <andiry.xu@amd.com> xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state.
If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port.
Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
H A D | hub.c | diff dcc01c0864823f91c3bf3ffca6613e2351702b87 Mon Sep 30 09:26:29 CDT 2013 Sarah Sharp <sarah.a.sharp@linux.intel.com> usb: Disable USB 2.0 Link PM before device reset.
Before the USB core resets a device, we need to disable the L1 timeout for the roothub, if USB 2.0 Link PM is enabled. Otherwise the port may transition into L1 in between descriptor fetches, before we know if the USB device descriptors changed. LPM will be re-enabled after the full device descriptors are fetched, and we can confirm the device still supports USB 2.0 LPM after the reset.
We don't need to wait for the USB device to exit L1 before resetting the device, since the xHCI roothub port diagrams show a transition to the Reset state from any of the Ux states (see Figure 34 in the 2012-08-14 xHCI specification update).
This patch should be backported to kernels as old as 3.2, that contain the commit 65580b4321eb36f16ae8b5987bfa1bb948fc5112 "xHCI: set USB2 hardware LPM". That was the first commit to enable USB 2.0 hardware-driven Link Power Management.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org diff c3e751e4f4754793bb52bd5ae30e9cc027edbb12 Fri May 04 11:50:10 CDT 2012 Andiry Xu <andiry.xu@gmail.com> usbcore: enable USB2 LPM if port suspend fails
USB2 LPM is disabled when device begin to suspend and enabled after device is resumed. That's because USB spec does not define the transition from U1/U2 state to U3 state.
If usb_port_suspend() fails, usb_port_resume() is never called, and USB2 LPM is disabled in this situation. Enable USB2 LPM if port suspend fails.
This patch should be backported to kernels as old as 3.2, that contain the commit 65580b4321eb36f16ae8b5987bfa1bb948fc5112 "xHCI: set USB2 hardware LPM".
Signed-off-by: Andiry Xu <andiry.xu@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Cc: stable@vger.kernel.org diff 65580b4321eb36f16ae8b5987bfa1bb948fc5112 Fri Sep 23 16:19:52 CDT 2011 Andiry Xu <andiry.xu@amd.com> xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state.
If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port.
Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
H A D | driver.c | diff 65580b4321eb36f16ae8b5987bfa1bb948fc5112 Fri Sep 23 16:19:52 CDT 2011 Andiry Xu <andiry.xu@amd.com> xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state.
If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port.
Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
/openbmc/linux/include/linux/usb/ |
H A D | hcd.h | diff 65580b4321eb36f16ae8b5987bfa1bb948fc5112 Fri Sep 23 16:19:52 CDT 2011 Andiry Xu <andiry.xu@amd.com> xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state.
If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port.
Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|
/openbmc/linux/include/linux/ |
H A D | usb.h | diff 65580b4321eb36f16ae8b5987bfa1bb948fc5112 Fri Sep 23 16:19:52 CDT 2011 Andiry Xu <andiry.xu@amd.com> xHCI: set USB2 hardware LPM
If the device pass the USB2 software LPM and the host supports hardware LPM, enable hardware LPM for the device to let the host decide when to put the link into lower power state.
If hardware LPM is enabled for a port and driver wants to put it into suspend, it must first disable hardware LPM, resume the port into U0, and then suspend the port.
Signed-off-by: Andiry Xu <andiry.xu@amd.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
|