802-usb-xhci-force-msi-renesas-xhci.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. The APM82181 does not support MSI-X. When probed, it will
  7. produce a noisy warning.
  8. ---
  9. drivers/usb/host/pci-quirks.c | 362 ++++++++++++++++++++++++++++++++++++++++++
  10. 1 file changed, 362 insertions(+)
  11. --- a/drivers/usb/host/xhci-pci.c
  12. +++ b/drivers/usb/host/xhci-pci.c
  13. @@ -193,7 +193,7 @@ static void xhci_pci_quirks(struct devic
  14. xhci->quirks |= XHCI_TRUST_TX_LENGTH;
  15. if (pdev->vendor == PCI_VENDOR_ID_RENESAS &&
  16. pdev->device == 0x0015)
  17. - xhci->quirks |= XHCI_RESET_ON_RESUME;
  18. + xhci->quirks |= XHCI_RESET_ON_RESUME | XHCI_FORCE_MSI;
  19. if (pdev->vendor == PCI_VENDOR_ID_VIA)
  20. xhci->quirks |= XHCI_RESET_ON_RESUME;
  21. --- a/drivers/usb/host/xhci.c
  22. +++ b/drivers/usb/host/xhci.c
  23. @@ -386,10 +386,14 @@ static int xhci_try_enable_msi(struct us
  24. free_irq(hcd->irq, hcd);
  25. hcd->irq = 0;
  26. - ret = xhci_setup_msix(xhci);
  27. - if (ret)
  28. - /* fall back to msi*/
  29. + if (xhci->quirks & XHCI_FORCE_MSI) {
  30. ret = xhci_setup_msi(xhci);
  31. + } else {
  32. + ret = xhci_setup_msix(xhci);
  33. + if (ret)
  34. + /* fall back to msi*/
  35. + ret = xhci_setup_msi(xhci);
  36. + }
  37. if (!ret)
  38. /* hcd->irq is 0, we have MSI */
  39. --- a/drivers/usb/host/xhci.h
  40. +++ b/drivers/usb/host/xhci.h
  41. @@ -1657,6 +1657,7 @@ struct xhci_hcd {
  42. /* support xHCI 0.96 spec USB2 software LPM */
  43. unsigned sw_lpm_support:1;
  44. /* support xHCI 1.0 spec USB2 hardware LPM */
  45. +#define XHCI_FORCE_MSI (1 << 24)
  46. unsigned hw_lpm_support:1;
  47. /* cached usb2 extened protocol capabilites */
  48. u32 *ext_caps;