Commit 00eed9c8 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Greg Kroah-Hartman

USB: xhci: correctly enable interrupts

xhci has its own interrupt enabling routine, which will try to
use MSI-X/MSI if present. So the usb core shouldn't try to enable
legacy interrupts; on some machines the xhci legacy IRQ setting
is invalid.

v3: Be careful to not break XHCI_BROKEN_MSI workaround (by trenn)

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Oliver Neukum <oneukum@suse.de>
Cc: Thomas Renninger <trenn@suse.de>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Frederik Himpe <fhimpe@vub.ac.be>
Cc: David Haerdeman <david@hardeman.nu>
Cc: Alan Stern <stern@rowland.harvard.edu>
Acked-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
Reviewed-by: default avatarThomas Renninger <trenn@suse.de>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1d9d8639
...@@ -173,6 +173,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -173,6 +173,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
struct hc_driver *driver; struct hc_driver *driver;
struct usb_hcd *hcd; struct usb_hcd *hcd;
int retval; int retval;
int hcd_irq = 0;
if (usb_disabled()) if (usb_disabled())
return -ENODEV; return -ENODEV;
...@@ -187,15 +188,19 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -187,15 +188,19 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
return -ENODEV; return -ENODEV;
dev->current_state = PCI_D0; dev->current_state = PCI_D0;
/* The xHCI driver supports MSI and MSI-X, /*
* so don't fail if the BIOS doesn't provide a legacy IRQ. * The xHCI driver has its own irq management
* make sure irq setup is not touched for xhci in generic hcd code
*/ */
if (!dev->irq && (driver->flags & HCD_MASK) != HCD_USB3) { if ((driver->flags & HCD_MASK) != HCD_USB3) {
dev_err(&dev->dev, if (!dev->irq) {
"Found HC with no IRQ. Check BIOS/PCI %s setup!\n", dev_err(&dev->dev,
pci_name(dev)); "Found HC with no IRQ. Check BIOS/PCI %s setup!\n",
retval = -ENODEV; pci_name(dev));
goto disable_pci; retval = -ENODEV;
goto disable_pci;
}
hcd_irq = dev->irq;
} }
hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev)); hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev));
...@@ -245,7 +250,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -245,7 +250,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
pci_set_master(dev); pci_set_master(dev);
retval = usb_add_hcd(hcd, dev->irq, IRQF_SHARED); retval = usb_add_hcd(hcd, hcd_irq, IRQF_SHARED);
if (retval != 0) if (retval != 0)
goto unmap_registers; goto unmap_registers;
set_hs_companion(dev, hcd); set_hs_companion(dev, hcd);
......
...@@ -350,7 +350,7 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd) ...@@ -350,7 +350,7 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
* generate interrupts. Don't even try to enable MSI. * generate interrupts. Don't even try to enable MSI.
*/ */
if (xhci->quirks & XHCI_BROKEN_MSI) if (xhci->quirks & XHCI_BROKEN_MSI)
return 0; goto legacy_irq;
/* unregister the legacy interrupt */ /* unregister the legacy interrupt */
if (hcd->irq) if (hcd->irq)
...@@ -371,6 +371,7 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd) ...@@ -371,6 +371,7 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
return -EINVAL; return -EINVAL;
} }
legacy_irq:
/* fall back to legacy interrupt*/ /* fall back to legacy interrupt*/
ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED, ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED,
hcd->irq_descr, hcd); hcd->irq_descr, hcd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment