From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Fri, 4 Mar 2011 11:47:50 -0000 Subject: [PATCH 6/6] ARM: nmk: update GPIO chained IRQ handler to use EOI in parent chip In-Reply-To: References: <1298900022-21516-1-git-send-email-will.deacon@arm.com> <1298900022-21516-7-git-send-email-will.deacon@arm.com> <20110228140327.GA1937@n2100.arm.linux.org.uk> <001401cbd772$a1f93ae0$e5ebb0a0$@deacon@arm.com> <20110228214445.GD1937@n2100.arm.linux.org.uk> <20110301201904.GA27107@n2100.arm.linux.org.uk> <001301cbd8ef$29403c10$7bc0b430$@deacon@arm.com> Message-ID: <000401cbda61$fd8759e0$f8960da0$@deacon@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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