Re: [PATCH v2 2/3] USB: Try MSI first before line IRQ for Intel PCIe USB3 HCD

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

 



On Tue, 2012-01-10 at 10:25 -0500, Alan Stern wrote:
> On Tue, 10 Jan 2012, Alex,Shi wrote:
> 
> > 
> > We have a PCI USB xhci host controller on a new platform. It have no
> > line IRQ definition in BIOS. So the Linux driver refuses to initial this
> > controller. But Windows works well for it depending on MSI.
> > 
> > Actually, Linux also can work for MSI. This patch skips the first line
> > IRQ checking for our HCD in usb-core pci probe, then try to enable MSI
> > firstly. That make this HCD works well under Linux.
> > 
> > Thanks for Sarah's suggestion and review for this patch.
> 
> > diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> > index 13222d3..6545454 100644
> > --- a/drivers/usb/core/hcd.c
> > +++ b/drivers/usb/core/hcd.c
> > @@ -2466,8 +2466,11 @@ 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 */
> > -	if (usb_hcd_is_primary_hcd(hcd)) {
> > +	/* enable irqs just before we start the controller. But xhci primary
> > +	 * hcd doesn't need this, since it will do it in driver->start();
> 
> There's no need to mention xhci in this comment, since the reasoning is 
> valid no matter what type of controller you have.

Yes, will rewrite the comments
> 
> > +	 */
> > +	if (usb_hcd_is_primary_hcd(hcd) &&
> > +			!(hcd->driver->flags & HCD_MSI_FST)) {
> >  		retval = usb_hcd_request_irqs(hcd, irqnum, irqflags);
> >  		if (retval)
> >  			goto err_request_irq;
> 
> What happens here if HCD_MSI_FIRST is set in the driver but the
> controller uses regular IRQs instead of MSI?  You'll skip calling 
> usb_hcd_request_irqs, and the driver won't work.

following driver->start() will call xhci_try_enable_msi(), so, it is
still have chance to fall back line irq. 
> 
> 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