Re: [PATCH v4 1/1] xHCI: Supporting MSI/MSI-X - Resend

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

 



On Fri, May 21, 2010 at 10:58:19AM -0700, Dong Nguyen wrote:
> Hi Sarah,
> 
> Thanks for your suggestion. My comments below:
> 
> > What if you set hcd->driver->irq to NULL once you've set up MSI or
> > MSI-X, here:
> > 
> >         /*
> >          * sucessfully setup msi/msi-x,
> >          * need to disable the legacy INTx
> >          */
> >         if (!ret) {
> >                 if (hcd->irq)
> >                         free_irq(hcd->irq, hcd);
> >                 hcd->irq = -1;
> > 		hcd->driver->irq = NULL;
> >         }
> > 
> > Then you can check for that NULL pointer in your clean up function, and
> > only free the IRQ if you have setup MSI:
> > 
> > 	else if (xhci_to_hcd(xhci)->driver->irq == NULL) {
> > 		free_irq(pdev->irq, xhci_to_hcd(xhci));
> > 		pdev->irq = -1;
> > 	}
> > 
> 
> The hcd->driver is read only memory and I don't think we can set to NULL
> once xhci initialization completed.  That's why I introduced the
> msi/msi-x enable flag in first patch so I only call free_irq for
> msi/msi-x case and leave the legacy interrupt for core hcd to free irq.
> Adding one msi/msi-x flag probably easiest solution when clean up
> msi/msi-x.

Ok, why not check hcd->irq == -1 instead?  Then you don't need the
flags.

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