Patch "xhci: prevent bus_suspend if SS port resuming in phase 1" has been added to the 4.1-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
xhci: prevent bus_suspend if SS port resuming in phase 1
to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
xhci-prevent-bus_suspend-if-ss-port-resuming-in-phase-1.patch
and it can be found in the queue-4.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
fac4271d1126c45ceaceb7f4a336317b771eb121Mon Sep 17 00:00:00 2001
From: Zhuang Jin Can <[email protected]>
Date: Tue, 21 Jul 2015 17:20:30 +0300
Subject: xhci: prevent bus_suspend if SS port resuming in phase 1
From: Zhuang Jin Can <[email protected]>
commit fac4271d1126c45ceaceb7f4a336317b771eb121 upstream.
When the link is just waken, it's in Resume state, and driver sets PLS to U0. This refers to Phase 1. Phase 2 refers to when the link has completed the transition from Resume state to U0.
With the fix of xhci: report U3 when link is in resume state, it also exposes an issue that usb3 roothub and controller can suspend right after phase 1, and this causes a hard hang in controller.
To fix the issue, we need to prevent usb3 bus suspend if any port is resuming in phase 1.
--- drivers/usb/host/xhci-hub.c | 6 +++--- drivers/usb/host/xhci-ring.c | 3 +++ drivers/usb/host/xhci.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-)
drivers/usb/host/xhci-hub.c +3 -3
@@ -1123,10 +1123,10 @@ int xhci_bus_suspend(struct usb_hcd *hcdspin_lock_irqsave (&xhci->lock, flags);if (hcd->self.root_hub->do_remote_wakeup) { -if (bus_state->resuming_ports) { +if (bus_state->resuming_ports ||/* USB2 */ + bus_state->port_remote_wakeup) {/* USB3 */ spin_unlock_irqrestore (&xhci->lock, flags); -xhci_dbg (xhci,"suspend failed because " -"a port is resuming\n" ); +xhci_dbg (xhci,"suspend failed because a port is resuming\n" );return -EBUSY ; } }
drivers/usb/host/xhci-ring.c +3 -0
@@ -1546,6 +1546,9 @@ static void handle_port_status(struct xhusb_hcd_resume_root_hub (hcd); } +if (hcd->speed ==HCD_USB3 && (temp &PORT_PLS_MASK ) ==XDEV_INACTIVE ) + bus_state->port_remote_wakeup &= ~(1 << faked_port_index); +if ((temp &PORT_PLC ) && (temp &PORT_PLS_MASK ) ==XDEV_RESUME ) {xhci_dbg (xhci,"port resume event for port %d\n" , port_id);
drivers/usb/host/xhci.h +1 -0
@@ -285,6 +285,7 @@ struct xhci_op_regs {#define XDEV_U0 (0x0 << 5)#define XDEV_U2 (0x2 << 5)#define XDEV_U3 (0x3 << 5) +#define XDEV_INACTIVE (0x6 << 5)#define XDEV_RESUME (0xf << 5)/* true: port has power (see HCC_PPC) */ #define PORT_POWER (1 << 9)
Patches currently in stable-queue which might be from [email protected] are
queue-4.1/xhci-do-not-report-plc-when-link-is-in-internal-resume-state.patch queue-4.1/xhci-prevent-bus_suspend-if-ss-port-resuming-in-phase-1.patch queue-4.1/xhci-report-u3-when-link-is-in-resume-state.patch