Re: [RFC] irq handling code consolidation, second try (ppc part)

From: Benjamin Herrenschmidt (benh@kernel.crashing.org)
Date: Sat Jan 04 2003 - 08:01:33 EST


On Sat, 2003-01-04 at 12:59, Andrey Panin wrote:
> Hi all,
>
> attached patch is a second try of IRQ handling code consolidation.
> This is a ppc specific patch (compiled successfuly).
>
> Beware, this patch removes some old(?) and crappy code:
> - irq_kmalloc(), irq_kfree() removed. If ppc need to register
> irqs early, it should use setup_irq() as all decent people do :))
> - request_irq() with NULL handler argument == free_irq(), does
> anyone use this kludge ?
>

After a quick look, things look fine some of this old PPC crap should indeed
be killed now.

There's something else I would like to implement one of these days, and your
consolidation work makes it easier (except for archs that won't use it...).
Basically, I want some (few and rare enough though) drivers to be able
to define interrupt controllers and thus create their own IRQs.

The typical example for which I need that is cardbus. I need the cardbus
controller on PCI to be seen as a real cascaded controller, that is I want
devices below it (either PCI or PCMCIA) calls to request/free/enable/disable_irq
for their to be caught by the cardbus driver.
This is the only sane way to properly enable/disable bridging of the
interrupt upon request from the driver. Without that, I still can frequent
lockups with various pcmcia cards when inserted/removed due to IRQ line
beeing stuck down on slot shutdown or other crappy things happening
typically with legacy PCMCIA stuffs (ATA is a good example of crappy behaviour).

The "easy" way here to implement that is to make the irq_desc array larger than
NR_IRQs (or rather split NR_IRQs into NR_SYS_IRQS + NR_DYNAMIC_IRQS). The
additional "slots" could then easily be allocated/freed. Thus, keeping my
cardbus example, the cardbus driver can allocate a couple of slots (that is IRQ
 numbers) dynamically, and use it's own startup/shutdown/enable/disable/...
hooks for them, dealing itself with the cascade from the PCI irq. (Of course,
this is not for systems using cardbus routed to legacy IRQs, but for systems
like PPC where the PCI irq is mux'ing both the device IRQs and the controller
own IRQ).

Ben.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jan 07 2003 - 22:00:25 EST