summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch
new file mode 100644
index 00000000..f8484578
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch
@@ -0,0 +1,69 @@
1From 6dc2acf66f46c7aee7ae6617612fcf32fc6b0de5 Mon Sep 17 00:00:00 2001
2From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
3Date: Tue, 7 Feb 2012 15:11:46 -0800
4Subject: [PATCH 39/73] USB: Fix handoff when BIOS disables host PCI device.
5
6commit cab928ee1f221c9cc48d6615070fefe2e444384a upstream.
7
8On some systems with an Intel Panther Point xHCI host controller, the
9BIOS disables the xHCI PCI device during boot, and switches the xHCI
10ports over to EHCI. This allows the BIOS to access USB devices without
11having xHCI support.
12
13The downside is that the xHCI BIOS handoff mechanism will fail because
14memory mapped I/O is not enabled for the disabled PCI device.
15Jesse Barnes says this is expected behavior. The PCI core will enable
16BARs before quirks run, but it will leave it in an undefined state, and
17it may not have memory mapped I/O enabled.
18
19Make the generic USB quirk handler call pci_enable_device() to re-enable
20MMIO, and call pci_disable_device() once the host-specific BIOS handoff
21is finished. This will balance the ref counts in the PCI core. When
22the PCI probe function is called, usb_hcd_pci_probe() will call
23pci_enable_device() again.
24
25This should be back ported to kernels as old as 2.6.31. That was the
26first kernel with xHCI support, and no one has complained about BIOS
27handoffs failing due to memory mapped I/O being disabled on other hosts
28(EHCI, UHCI, or OHCI).
29
30Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
31Acked-by: Oliver Neukum <oneukum@suse.de>
32Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
33Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
34---
35 drivers/usb/host/pci-quirks.c | 11 +++++++++++
36 1 files changed, 11 insertions(+), 0 deletions(-)
37
38diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
39index ac53a66..7732d69 100644
40--- a/drivers/usb/host/pci-quirks.c
41+++ b/drivers/usb/host/pci-quirks.c
42@@ -872,7 +872,17 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
43 */
44 if (pdev->vendor == 0x184e) /* vendor Netlogic */
45 return;
46+ if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI &&
47+ pdev->class != PCI_CLASS_SERIAL_USB_OHCI &&
48+ pdev->class != PCI_CLASS_SERIAL_USB_EHCI &&
49+ pdev->class != PCI_CLASS_SERIAL_USB_XHCI)
50+ return;
51
52+ if (pci_enable_device(pdev) < 0) {
53+ dev_warn(&pdev->dev, "Can't enable PCI device, "
54+ "BIOS handoff failed.\n");
55+ return;
56+ }
57 if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI)
58 quirk_usb_handoff_uhci(pdev);
59 else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)
60@@ -881,5 +891,6 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
61 quirk_usb_disable_ehci(pdev);
62 else if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI)
63 quirk_usb_handoff_xhci(pdev);
64+ pci_disable_device(pdev);
65 }
66 DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff);
67--
681.7.7.4
69