diff options
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.patch | 69 |
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 @@ | |||
1 | From 6dc2acf66f46c7aee7ae6617612fcf32fc6b0de5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Sarah Sharp <sarah.a.sharp@linux.intel.com> | ||
3 | Date: Tue, 7 Feb 2012 15:11:46 -0800 | ||
4 | Subject: [PATCH 39/73] USB: Fix handoff when BIOS disables host PCI device. | ||
5 | |||
6 | commit cab928ee1f221c9cc48d6615070fefe2e444384a upstream. | ||
7 | |||
8 | On some systems with an Intel Panther Point xHCI host controller, the | ||
9 | BIOS disables the xHCI PCI device during boot, and switches the xHCI | ||
10 | ports over to EHCI. This allows the BIOS to access USB devices without | ||
11 | having xHCI support. | ||
12 | |||
13 | The downside is that the xHCI BIOS handoff mechanism will fail because | ||
14 | memory mapped I/O is not enabled for the disabled PCI device. | ||
15 | Jesse Barnes says this is expected behavior. The PCI core will enable | ||
16 | BARs before quirks run, but it will leave it in an undefined state, and | ||
17 | it may not have memory mapped I/O enabled. | ||
18 | |||
19 | Make the generic USB quirk handler call pci_enable_device() to re-enable | ||
20 | MMIO, and call pci_disable_device() once the host-specific BIOS handoff | ||
21 | is finished. This will balance the ref counts in the PCI core. When | ||
22 | the PCI probe function is called, usb_hcd_pci_probe() will call | ||
23 | pci_enable_device() again. | ||
24 | |||
25 | This should be back ported to kernels as old as 2.6.31. That was the | ||
26 | first kernel with xHCI support, and no one has complained about BIOS | ||
27 | handoffs failing due to memory mapped I/O being disabled on other hosts | ||
28 | (EHCI, UHCI, or OHCI). | ||
29 | |||
30 | Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> | ||
31 | Acked-by: Oliver Neukum <oneukum@suse.de> | ||
32 | Cc: Jesse Barnes <jbarnes@virtuousgeek.org> | ||
33 | Signed-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 | |||
38 | diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c | ||
39 | index 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 | -- | ||
68 | 1.7.7.4 | ||
69 | |||