diff options
Diffstat (limited to 'drivers/usb/host/xhci-pci.c')
-rw-r--r-- | drivers/usb/host/xhci-pci.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index cbc4d491e626..faf039ac6573 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -242,8 +242,28 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) | |||
242 | static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated) | 242 | static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated) |
243 | { | 243 | { |
244 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | 244 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); |
245 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | ||
245 | int retval = 0; | 246 | int retval = 0; |
246 | 247 | ||
248 | /* The BIOS on systems with the Intel Panther Point chipset may or may | ||
249 | * not support xHCI natively. That means that during system resume, it | ||
250 | * may switch the ports back to EHCI so that users can use their | ||
251 | * keyboard to select a kernel from GRUB after resume from hibernate. | ||
252 | * | ||
253 | * The BIOS is supposed to remember whether the OS had xHCI ports | ||
254 | * enabled before resume, and switch the ports back to xHCI when the | ||
255 | * BIOS/OS semaphore is written, but we all know we can't trust BIOS | ||
256 | * writers. | ||
257 | * | ||
258 | * Unconditionally switch the ports back to xHCI after a system resume. | ||
259 | * We can't tell whether the EHCI or xHCI controller will be resumed | ||
260 | * first, so we have to do the port switchover in both drivers. Writing | ||
261 | * a '1' to the port switchover registers should have no effect if the | ||
262 | * port was already switched over. | ||
263 | */ | ||
264 | if (usb_is_intel_switchable_xhci(pdev)) | ||
265 | usb_enable_xhci_ports(pdev); | ||
266 | |||
247 | retval = xhci_resume(xhci, hibernated); | 267 | retval = xhci_resume(xhci, hibernated); |
248 | return retval; | 268 | return retval; |
249 | } | 269 | } |