The AMD SB700 I'm testing with wakes up fine on connection after runtime suspend, but doesn't appear to set the "Port change detect" bit in USBSTS. The change does appear in the individual port register, so try checking the port status as well. It's an infrequent enough operation that the overhead shouldn't be an issue. Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx> --- drivers/usb/host/ehci-hub.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 796ea0c..7653117 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -106,12 +106,25 @@ static void ehci_handover_companion_ports(struct ehci_hcd *ehci) ehci->owned_ports = 0; } +static int ehci_port_change(struct ehci_hcd *ehci) +{ + int i = HCS_N_PORTS(ehci->hcs_params); + + while (i--) { + if (ehci_readl(ehci, &ehci->regs->port_status[i]) & PORT_CSC) + return 1; + } + + return 0; +} + static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci, bool suspending, bool do_wakeup) { int port; u32 temp; + /* If remote wakeup is enabled for the root hub but disabled * for the controller, we must adjust all the port wakeup flags * when the controller is suspended or resumed. In all other @@ -168,7 +181,9 @@ static void ehci_adjust_port_wakeup_flags(struct ehci_hcd *ehci, } /* Does the root hub have a port wakeup pending? */ - if (!suspending && (ehci_readl(ehci, &ehci->regs->status) & STS_PCD)) + if (!suspending && + ((ehci_readl(ehci, &ehci->regs->status) & STS_PCD) || + ehci_port_change(ehci))) usb_hcd_resume_root_hub(ehci_to_hcd(ehci)); } -- 1.7.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html