On Sun, Sep 12, 2010 at 06:18:57PM +0200, Carlo Caione wrote: > > > That being said, the IRQ-core core does need some way to differentiate > > between handlers for shared IRQs. This is necessary so that you can > > selectively uninstall handlers. This is also why the free_irq() takes > > not only the IRQ#, but the dev_id (your dev1 or dev2) you registered > > with. > > I'm ok also with this point. But for example: > the IRQ-core code executes both the handlers for the shared irqn. > Just one of the handlers is the right one for that specific device, > whereas the other one should be return IRQ_NONE. Well, thats not _entirely_ true. It is possible that two devices sharing an IRQ can interrupt at the same time, so both handlers could return IRQ_HANDLED. :) > How do those parameters dev1 and dev2 help me within the handler > functions to know if the interrupt is coming from the right devices? That's up for you, the driver writer, to decide. In your driver code you are probably already keeping around a per-device object (that will hold pointers to mapped registers, or other ways of communicating with your device), so it makes sense in this case to request_irq() by passing a pointer to that per-device object. In this way, your handler can communicate with your device and ask it if it was the one that generated the interrupt. > I hope I'm not saying something stupid :) Not at all. -- -joshc -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ