public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][v2] xhci: correctly enable interrupts
@ 2013-03-04  8:22 Hannes Reinecke
  2013-03-04 11:25 ` David Härdeman
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Hannes Reinecke @ 2013-03-04  8:22 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, Hannes Reinecke, Bjorn Helgaas, Oliver Neukum,
	Thomas Renninger, Yinghai Lu, Frederik Himpe, David Haerdeman,
	Alan Stern

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.

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>
Signed-off-by: Hannes Reinecke <hare@suse.de>

diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 622b4a4..2647e75 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -173,6 +173,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	struct hc_driver	*driver;
 	struct usb_hcd		*hcd;
 	int			retval;
+	int			hcd_irq = 0;
 
 	if (usb_disabled())
 		return -ENODEV;
@@ -187,15 +188,21 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		return -ENODEV;
 	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 supports MSI and MSI-X,
+	 * so don't fail if the BIOS doesn't provide a legacy IRQ
+	 * and do not try to enable legacy IRQs.
 	 */
-	if (!dev->irq && (driver->flags & HCD_MASK) != HCD_USB3) {
-		dev_err(&dev->dev,
-			"Found HC with no IRQ.  Check BIOS/PCI %s setup!\n",
-			pci_name(dev));
-		retval = -ENODEV;
-		goto disable_pci;
+	if ((driver->flags & HCD_MASK) != HCD_USB3) {
+		if (!dev->irq) {
+			dev_err(&dev->dev,
+				"Found HC with no IRQ.  "
+				"Check BIOS/PCI %s setup!\n",
+				pci_name(dev));
+			retval = -ENODEV;
+			goto disable_pci;
+		}
+		hcd_irq = dev->irq;
 	}
 
 	hcd = usb_create_hcd(driver, &dev->dev, pci_name(dev));
@@ -245,7 +252,7 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
 	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)
 		goto unmap_registers;
 	set_hs_companion(dev, hcd);

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-03-15 18:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-04  8:22 [PATCH][v2] xhci: correctly enable interrupts Hannes Reinecke
2013-03-04 11:25 ` David Härdeman
2013-03-04 13:27 ` Sergei Shtylyov
2013-03-04 15:26 ` Alan Stern
2013-03-04 16:11   ` Thomas Renninger
2013-03-04 16:14   ` [PATCH][v3] " Thomas Renninger
2013-03-04 18:08     ` Sergei Shtylyov
2013-03-04 17:36       ` Alan Stern
2013-03-05 10:45     ` Thomas Renninger
2013-03-15 18:34       ` Greg KH
2013-03-05 23:37     ` Sarah Sharp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox