diff options
author | Andiry Xu <andiry.xu@amd.com> | 2011-04-19 05:17:39 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2011-05-03 14:14:32 -0400 |
commit | 4f0871a6c7811a433513c3788a7cce27033bb8b8 (patch) | |
tree | f532cfb989d412eba133163b74337f4afabd3b02 | |
parent | cee6a262550f53a13acfefbc1e3e5ff35c96182c (diff) |
xHCI: Clear PLC in xhci_bus_resume()
This patch clears PORT_PLC if xhci_bus_resume() resumes a previous suspended
port, because if a port transition from U3 to U0 state, it will report a
port link state change, and software should clear the corresponding PLC bit.
It also uses hcd->speed to check if a port is a USB2 protocol port.
The patch fixes the issue that USB keyboard can not wakeup system from
hibernation.
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
-rw-r--r-- | drivers/usb/host/xhci-hub.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index a78f2ebd11b7..73f75d26436c 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
@@ -777,7 +777,7 @@ int xhci_bus_suspend(struct usb_hcd *hcd) | |||
777 | if (t1 != t2) | 777 | if (t1 != t2) |
778 | xhci_writel(xhci, t2, port_array[port_index]); | 778 | xhci_writel(xhci, t2, port_array[port_index]); |
779 | 779 | ||
780 | if (DEV_HIGHSPEED(t1)) { | 780 | if (hcd->speed != HCD_USB3) { |
781 | /* enable remote wake up for USB 2.0 */ | 781 | /* enable remote wake up for USB 2.0 */ |
782 | u32 __iomem *addr; | 782 | u32 __iomem *addr; |
783 | u32 tmp; | 783 | u32 tmp; |
@@ -866,6 +866,21 @@ int xhci_bus_resume(struct usb_hcd *hcd) | |||
866 | temp |= PORT_LINK_STROBE | XDEV_U0; | 866 | temp |= PORT_LINK_STROBE | XDEV_U0; |
867 | xhci_writel(xhci, temp, port_array[port_index]); | 867 | xhci_writel(xhci, temp, port_array[port_index]); |
868 | } | 868 | } |
869 | /* wait for the port to enter U0 and report port link | ||
870 | * state change. | ||
871 | */ | ||
872 | spin_unlock_irqrestore(&xhci->lock, flags); | ||
873 | msleep(20); | ||
874 | spin_lock_irqsave(&xhci->lock, flags); | ||
875 | |||
876 | /* Clear PLC */ | ||
877 | temp = xhci_readl(xhci, port_array[port_index]); | ||
878 | if (temp & PORT_PLC) { | ||
879 | temp = xhci_port_state_to_neutral(temp); | ||
880 | temp |= PORT_PLC; | ||
881 | xhci_writel(xhci, temp, port_array[port_index]); | ||
882 | } | ||
883 | |||
869 | slot_id = xhci_find_slot_id_by_port(hcd, | 884 | slot_id = xhci_find_slot_id_by_port(hcd, |
870 | xhci, port_index + 1); | 885 | xhci, port_index + 1); |
871 | if (slot_id) | 886 | if (slot_id) |
@@ -873,7 +888,7 @@ int xhci_bus_resume(struct usb_hcd *hcd) | |||
873 | } else | 888 | } else |
874 | xhci_writel(xhci, temp, port_array[port_index]); | 889 | xhci_writel(xhci, temp, port_array[port_index]); |
875 | 890 | ||
876 | if (DEV_HIGHSPEED(temp)) { | 891 | if (hcd->speed != HCD_USB3) { |
877 | /* disable remote wake up for USB 2.0 */ | 892 | /* disable remote wake up for USB 2.0 */ |
878 | u32 __iomem *addr; | 893 | u32 __iomem *addr; |
879 | u32 tmp; | 894 | u32 tmp; |