lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 4 Mar 2013 12:25:28 +0100
From:	David Härdeman <david@...deman.nu>
To:	Hannes Reinecke <hare@...e.de>
Cc:	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Oliver Neukum <oneukum@...e.de>,
	Thomas Renninger <trenn@...e.de>,
	Yinghai Lu <yinghai@...nel.org>,
	Frederik Himpe <fhimpe@....ac.be>,
	Alan Stern <stern@...land.harvard.edu>
Subject: Re: [PATCH][v2] xhci: correctly enable interrupts

On Mon, Mar 04, 2013 at 09:22:04AM +0100, Hannes Reinecke wrote:
>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@...gle.com>
>Cc: Oliver Neukum <oneukum@...e.de>
>Cc: Thomas Renninger <trenn@...e.de>
>Cc: Yinghai Lu <yinghai@...nel.org>
>Cc: Frederik Himpe <fhimpe@....ac.be>
>Cc: David Haerdeman <david@...deman.nu>
>Cc: Alan Stern <stern@...land.harvard.edu>
>Signed-off-by: Hannes Reinecke <hare@...e.de>

No idea if it's the "right" solution but it works for me.

Tested-by: David Härdeman <david@...deman.nu>

>
>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);
>

-- 
David Härdeman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ