Re: [PATCH 03/20] usb: xhci: group MSI interrupt registration into its own function

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

 



On Mon, Aug 15, 2011 at 04:51:24PM +0200, Sebastian Andrzej Siewior wrote:
> This patch moves the complete MSI/MSI-X/Legacy dance into its own
> function. There is however one difference: If the XHCI_BROKEN_MSI flag
> is set then we don't free and register the irq, we simply return.
> This is preparation for later PCI decouple.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> ---
>  drivers/usb/host/xhci.c |   71 ++++++++++++++++++++++++++++------------------
>  1 files changed, 43 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 763f484..41af46e 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -396,6 +396,46 @@ static int xhci_run_finished(struct xhci_hcd *xhci)
>  	return 0;
>  }
>  
> +static int xhci_try_enable_msi(struct usb_hcd *hcd)
> +{
> +	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
> +	struct pci_dev  *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
> +	int ret;
> +
> +	if (xhci->quirks & XHCI_BROKEN_MSI)
> +		return 0;
> +
> +	/* unregister the legacy interrupt */
> +	if (hcd->irq)
> +		free_irq(hcd->irq, hcd);
> +	hcd->irq = -1;
> +
> +	/*
> +	 * Some Fresco Logic host controllers advertise MSI, but fail to
> +	 * generate interrupts.  Don't even try to enable MSI.
> +	 */

You should put this comment above the check for the XHCI_BROKEN_MSI
quirk.  Otherwise this looks fine.

Sarah Sharp
--
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