0fb95864cf1683c2d789cf72e4ed8526c0f92009
[openwrt/openwrt.git] / target / linux / apm821xx / patches-4.14 / 802-usb-xhci-force-msi-renesas-xhci.patch
1 From a0dc613140bab907a3d5787a7ae7b0638bf674d0 Mon Sep 17 00:00:00 2001
2 From: Christian Lamparter <chunkeey@gmail.com>
3 Date: Thu, 23 Jun 2016 20:28:20 +0200
4 Subject: [PATCH] usb: xhci: force MSI for uPD720201 and
5 uPD720202
6
7 The APM82181 does not support MSI-X. When probed, it will
8 produce a noisy warning.
9
10 ---
11 drivers/usb/host/pci-quirks.c | 362 ++++++++++++++++++++++++++++++++++++++++++
12 1 file changed, 362 insertions(+)
13
14 --- a/drivers/usb/host/xhci-pci.c
15 +++ b/drivers/usb/host/xhci-pci.c
16 @@ -225,7 +225,7 @@ static void xhci_pci_quirks(struct devic
17 xhci->quirks |= XHCI_TRUST_TX_LENGTH;
18 if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
19 pdev->device == 0x0015)
20 - xhci->quirks |= XHCI_RESET_ON_RESUME;
21 + xhci->quirks |= XHCI_RESET_ON_RESUME | XHCI_FORCE_MSI;
22 if (pdev->vendor == PCI_VENDOR_ID_VIA)
23 xhci->quirks |= XHCI_RESET_ON_RESUME;
24
25 --- a/drivers/usb/host/xhci.c
26 +++ b/drivers/usb/host/xhci.c
27 @@ -370,10 +370,14 @@ static int xhci_try_enable_msi(struct us
28 free_irq(hcd->irq, hcd);
29 hcd->irq = 0;
30
31 - ret = xhci_setup_msix(xhci);
32 - if (ret)
33 - /* fall back to msi*/
34 + if (xhci->quirks & XHCI_FORCE_MSI) {
35 ret = xhci_setup_msi(xhci);
36 + } else {
37 + ret = xhci_setup_msix(xhci);
38 + if (ret)
39 + /* fall back to msi*/
40 + ret = xhci_setup_msi(xhci);
41 + }
42
43 if (!ret) {
44 hcd->msi_enabled = 1;
45 --- a/drivers/usb/host/xhci.h
46 +++ b/drivers/usb/host/xhci.h
47 @@ -1858,6 +1858,7 @@ struct xhci_hcd {
48 /* support xHCI 0.96 spec USB2 software LPM */
49 unsigned sw_lpm_support:1;
50 /* support xHCI 1.0 spec USB2 hardware LPM */
51 +#define XHCI_FORCE_MSI (1 << 24)
52 unsigned hw_lpm_support:1;
53 /* Broken Suspend flag for SNPS Suspend resume issue */
54 unsigned broken_suspend:1;