[PATCH 6/6] ARM: nmk: update GPIO chained IRQ handler to use EOI in parent chip

Will Deacon will.deacon at arm.com
Fri Mar 4 06:47:50 EST 2011


Hi Thomas,

> > > irqchip1.c
> > >
> > > struct irq_chip1;
> > >
> > > handle_primary_irq(int irq, struct irq_desc *desc)
> > > {
> > > 	chip->irq_ack();
> > > 	desc->demux();
> > > }
> > >
> > > init()
> > > {
> > > 	irq_set_chip(PRIMARY_IRQ, &irq_chip1);
> > > 	irq_set_primary_handler(PRIMARY_IRQ, handle_primary_irq);
> > > }
> >
> > I think with this approach you get the exact opposite problem; that
> > is the primary irq_chip doesn't know which IRQs are going to be
> > demuxed so it cannot know at init time which IRQs need their primary
> > handler set. Is the idea that you set_primary_handler for all IRQs,
> > stash that in the descriptor somewhere and then replace handle_irq
> > with the primary handler when a demux handler is registered?
> >
> > I guess I'm missing something here,
> 
> No, I missed that. Darn, yes this would need storing the
> primary_handler in some separate pointer or having a callback into the
> chip implementation to make this fully distangled.

You could remove the need for pointer switching by having a bitmap
indicating the flow control supported by the primary chip and then
having a single primary handler implementation which checks the map.
Not especially nice but it does allow for demux handlers to exist
where they are sufficient.

Will






More information about the linux-arm-kernel mailing list