Re: [patch 1/4] Make usb_hcd_irq available for multi-role USB controllers with a shared interrupt line

Pete Zaitcev <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Red Hat, Inc.
Message-ID <[email protected]>
On Thu, 26 Apr 2007 14:42:39 -0400 (EDT), Alan Stern <[email protected]> wrote:
> On Thu, 26 Apr 2007, Peter Korsgaard wrote:
> 
> > Some multi-role (host/peripheral) USB controllers use a shared interrupt
> > line for all parts of the chip. Export usb_hcd_irq so drivers can call it
> > from their interrupt handler instead of duplicating code.
> > Drivers pass an irqnum of 0 to usb_add_hcd to signal that the interrupt handler
> > shouldn't be registerred by the core.
> 
> There was some controversy about this sort of thing in the past, and I 
> don't remember what the outcome was.  The difficulty is that 0 is 
> potentially a valid IRQ number, so it shouldn't be used to mean "don't 
> register the IRQ handler".

For ohci-hcd, we used -1. The problem here is, while IRQ 0 is definitely
not valid for PCI devices (as Alan Cox reminded me a couple of weeks ago),
USB controllers are found in odd embedded configurations often, so we
cannot just use 0 as invalid everywhere. I don't know if -1 is good though.
Seems like it should be. Alan Cox also cautioned against using NO_IRQ,
because it's not universally defined by all platforms, and in general is
an invention of old IDE. Looks like -1 is the way to go.

-- Pete

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.