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

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

 



> Yes, but you're forgetting that this bug fix really needs to go into the
> stable kernels.  You need one small patch (that doesn't change the
> current USB PCI interrupt allocation for other xHCI hosts) to fix the
> problem with the Panther Point xHCI host issue, and a second bigger
> patch to just skip the legacy interrupt PCI allocation all together.
> 
> > > Let's figure out internally which BIOS versions actually have this
> > > problem, and how to differentiate between the two.
> > 
> > Do you mean we can ignore such BIOS issue? 
> > If you can skip such problem in BIOS and make HCD with MSI work like
> > Windows, why not? And guess there always have BIOS engineers forgetting
> > do test for Linux. 
> 
> Again, for the stable kernel reasons.  I'm not really comfortable with
> changing the PCI interrupt allocation in the stable kernel trees for
> other xHCI hosts.  

Thanks, Sarah. I understand your concern now. 
Maybe checking MSI first in usb_hcd_request_irqs is your favorite too,
right? 

I take a quick glance on the code. May we have 2 ways to implement it.

A, move current xhci code and a few MSI related objects into usb_hcd
core code and structure. the skeleton like below. 

@@ -2340,12 +2340,25 @@ int usb_hcd_is_primary_hcd(struct usb_hcd *hcd)
        return hcd == hcd->primary_hcd;
 }
 EXPORT_SYMBOL_GPL(usb_hcd_is_primary_hcd);
+static int hcd_setup_msix();
+static int hcd_setup_msi();
 
+static int hcd_try_enable_msi(struct usb_hdcd *hcd);
+
 static int usb_hcd_request_irqs(struct usb_hcd *hcd,
                unsigned int irqnum, unsigned long irqflags)
 {
        int retval;
 
+       /* only PCI HCD enabled HCD_MSI_FIRST */
+       if (hcd->driver->flags & | HCD_MSI_FIRST) {
+               /* checking driver quriks, like xhci */
+               ret = hcd_try_enable_msi(hcd);
+               if (ret)
+                       return ret;
+       }
        if (hcd->driver->irq) {
 
                /* IRQF_DISABLED doesn't work as advertised when used together

B, left xhci code into it's place, and let different driver own self msi
enabling function, like this:
@@ -2346,6 +2346,17 @@ static int usb_hcd_request_irqs(struct usb_hcd *hcd,
 {
        int retval;
 
+       /* only PCI HCD enabled HCD_MSI_FIRST */
+       if (hcd->driver->flags & | HCD_MSI_FIRST) {
+               switch (driver->mode) {
+               xhci:
+                       ret = xhci_try_enable_msi(hcd);
+               ehci:
+                       ret = xhci_try_enable_msi(hcd);
+
+               if (ret)
+                       return ret;
+       }
        if (hcd->driver->irq) {
 


I believe the plan A is more common and clear. Any comments for this? 



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