Re: [PATCH] usb: correctly enable interrupts for xhci

From: Alan Stern
Date: Fri Mar 01 2013 - 09:54:48 EST


On Fri, 1 Mar 2013, Hannes Reinecke wrote:

> xhci might run with MSI/MSI-X only, with no support for legacy
> interrupts. On these devices the request_irq() call in usb_add_hcd()
> will fail, causing the entire device to fail.
> For xhci this is especially painful as the driver will enable
> interrupts during xhci_run(), so the initial call to request_irq()
> is not required anyway.
>
> This patch adds a flag 'msix_supported' to struct usb_hcd, which
> will cause usb_add_hcd() to skip interrupt setup. This flag is
> set in xhci-pci, so the registration will skip the first request_irq()
> and can proceed.

I think it might be better to fix this in hcd-pci.c:usb_hcd_pci_probe.
At that point if we see that MSI/MSI-X is available, the call to
usb_add_hcd can pass 0 instead of dev->irq.

It may even be possible to do this without adding an extra flag
anywhere. It also has the advantage of keeping special knowledge about
MSI encapsulated in the PCI-specific parts of the code.

Alan Stern

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