Re: USB core PCI irq question

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

 



On Fri, 17 Dec 2010, Sarah Sharp wrote:

> Alan,
> 
> Can the USB core rely on hcd->irq being equal to pci_dev->irq in
> suspend_common() for PCI host controllers that use legacy interrupts?

I'm not aware of any PCI host controller drivers that change it (except
for some reason, ohci-hcd.c sets hcd->irq to -1 in ohci_stop() -- this
won't interfere with suspend).

I also can't think of any reason why it would need to be changed.

> > > Yes, that's possible. Here are the modifications:
> > > 
> > > 1. Set hcd->irq = pdev->irq in xhci driver when using MSI;
> > > 2. Synchronize irq in xhci_suspend() only when using MSI-X;
> > > 3. Synchronize irq only if pci_dev->irq is equal to hcd->irq in
> > > suspend_common().
> 
> Andiry, if Alan says we can't rely on that fact, you could change the
> suspend_common() code to skip the irq sync if pci_dev->irq is equal to
> -1.  You would have to set pci_dev->irq to -1 when you enable MSI-X in
> the xHCI driver.

You want to be a little careful about setting ->irq to -1 and comparing
the resulting values, because it is supposed to be an unsigned int.  
There have been repeated discussions regarding what irq value is
supposed to mean "no irq", but I don't remember the outcomes.

Why not just add an extra flag or two instead of relying on magic 
values?

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