Re: [PATCH v3 2/2] USB: Try MSI first before line IRQ in XHCI PCI driver.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 11 Jan 2012, Alex Shi wrote:

> Current PCI hcd driver will check and enable line IRQ first, if line
> IRQ is no setting in BIOS, XHCI PCIe driver will exit. But infact, if
> MSI can work for this HCD, this behavior will refuse a workable HCD.
> 
> This patch change the behavior. It skips the first line IRQ checking for
> PCI XHCI HCD in usb-core, and try to enable MSI first, if the MSI out of
> work, it is back to line IRQ at that time. And further more, trying MSI
> first can avoid a unnecessary request/fee irq for line IRQ for PCIe HCD.
> 
> Thanks for Sarah and Andiry's suggestion and review for this patch.
> 
> Signed-off-by: Alex Shi <alex.shi@xxxxxxxxx>
> ---
>  drivers/usb/core/hcd.c      |    5 ++---
>  drivers/usb/host/xhci-pci.c |    8 ++------
>  drivers/usb/host/xhci.c     |   25 ++++++++++---------------
>  3 files changed, 14 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 9dd8098..0a4f185 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2466,9 +2466,8 @@ int usb_add_hcd(struct usb_hcd *hcd,
>  			&& device_can_wakeup(&hcd->self.root_hub->dev))
>  		dev_dbg(hcd->self.controller, "supports USB remote wakeup\n");
>  
> -	/* enable irqs just before we start the controller. But Intel USB3
> -	 * hcd can't do this here on some platform, they will do it in
> -	 * following driver->start();
> +	/* enable irqs just before we start the controller, except MSI
> +	 * first try HCD. That will do it in following driver->start();
>  	 */
>  	if (usb_hcd_is_primary_hcd(hcd) &&
>  			!(hcd->driver->flags & HCD_MSI_FIRST)) {

This does not belong here; all it does is change a comment that was 
added by the previous patch.  You should have added the correct comment 
originally.

> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
> index 75c53bf..d9bef41 100644
> --- a/drivers/usb/host/xhci-pci.c
> +++ b/drivers/usb/host/xhci-pci.c
> @@ -137,11 +137,6 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  
>  	driver = (struct hc_driver *)id->driver_data;
>  
> -	/* stop line IRQ checking in xhci_hcd_pci_probe. */
> -	if (dev->vendor == PCI_VENDOR_ID_INTEL &&
> -			dev->device == PCI_DEVICE_ID_INTEL_USB_XHCI)
> -		driver->flags |= HCD_MSI_FIRST;
> -
>  	/* Register the USB 2.0 roothub.
>  	 * FIXME: USB core must know to register the USB 2.0 roothub first.
>  	 * This is sort of silly, because we could just set the HCD driver flags

This doesn't belong here either.  All it does is remove code that was 
added by the previous patch.  If you don't want the code, don't add it 
in the first place.

Alan Stern

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux