public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 00/19] genirq: Cleanup and irq_chip functions overhaul
@ 2010-09-27 12:44 Thomas Gleixner
  2010-09-27 12:44 ` [patch 01/19] genirq: Cleanup access to irq_data Thomas Gleixner
                   ` (18 more replies)
  0 siblings, 19 replies; 40+ messages in thread
From: Thomas Gleixner @ 2010-09-27 12:44 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-arch, Ingo Molnar, Peter Zijlstra,
	Julia Lawall

I'm working on a large scale overhaul of the generic irq code. One of
the goals is to sanitize the sparse irq code, which is pretty much
impossible right now as there are too many sites accessing and
fiddling with irq_desc directly (And I'm not even talking about the
__do_IRQ() cadavers).

Some of these accesses have legacy reasons, some grew out of laziness
and some are just due to shortcomings in the generic code, which need
to be addressed.

The long term plan is to make irq desc private to the generic irq code
to allow freeing of unused irq descriptors, moving the irq descriptor
to a different node when the irq affinity changes and to allow
internal optimizations.

Following problems need to be addressed:

 - irq chips, which need to access irq_desc->chip_data, msi_desc etc.
  
    This is a problem already today when sparse irq is enabled. We
    need to lookup the irq desc for the interrupt to gain access to
    the data. With sparse this requires a redundant radix tree lookup
    as the core code already has a pointer to irq desc when the low
    level chip functions are called.

    It was proposed to simply hand down irq_desc in the functions, but
    low level code should not know about the details of irq_desc at
    all.

    The solution to this is to switch to a new set of irq_chip
    functions which have as single argument a pointer to a new
    irq_data structure which holds the irq number, desc->handler_data,
    desc->chip_data, desc->msi_desc, desc->affinity and a reference to
    the chip itself. The structure is embedded into irq_desc for now,
    but that's going to change, when the first cleanup round is done.

    AFAICT, that should be sufficient to satisfy the requirements of
    all low level implementations.

    For a transition phase both the old and the new functions are
    handled with wrappers in the core code.

    The new functions are implemented in:
    [Patch 3/19] genirq: Provide advanced irq chip functions
    
    Note: chip->end() will be dropped as it is just related to the old
    __do_IRQ() function and not used in the flow based handler code.


 - direct access to irq desc in architecture / drivers code.

    That's mostly related to sparse, irq affinity settings,
    show_interrupts() and fixup of irqs on cpu hot unplug.

    sparse just needs access to the irq desc due to a massive design
    failure. Most arch implementations are easy to fix except for the
    x86 one which is an utter nightmare.

    affinity settings are easy to fix with the new chip functions

    show_interrupts() should be made generic code with an arch callback
    for the extra irq related statistics (NMI, direct vectors, etc.)

    The cpu hot unplug fixup functions which handle the move of
    interrupts from a hotplug CPU do not need access to irq_desc when
    the cpu unplug code calls into the genirq core code and let it
    migrate the interrupts before calling into the architecture
    specific cpu down function. That needs some more thought, but I
    think it's a solvable problem.

    Some private irq flow handlers in arch/ can be generalized and
    moved to the generic code.

    The remaining few cases where architecture or irq chip code
    fiddles with irq_desc->status are relatively easy to cleanup.

This is going to be a major surgery in some places so I need all the
help I can get, but parts of the cleanups can be done scripted. I hope
Julia can come up with a solution to go through the irq_chip functions
and convert most of them with spatch.

The transition phase is definitly going to be short and I'm not going
to keep the old chip functions around for years like we did with
__do_IRQ().

Comments ?

Thanks,

	tglx


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2010-10-04 20:35 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-27 12:44 [patch 00/19] genirq: Cleanup and irq_chip functions overhaul Thomas Gleixner
2010-09-27 12:44 ` [patch 01/19] genirq: Cleanup access to irq_data Thomas Gleixner
2010-09-27 12:44 ` [patch 02/19] genirq: Create irq_data Thomas Gleixner
2010-10-04 20:29   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2010-09-27 12:44 ` [patch 03/19] genirq: Provide advanced irq chip functions Thomas Gleixner
2010-10-04 20:29   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2010-09-27 12:44 ` [patch 04/19] genirq; Provide compat handling for bus_lock/bus_sync_unlock Thomas Gleixner
2010-10-04 20:30   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:44 ` [patch 05/19] genirq; Provide compat handling for chip->mask() Thomas Gleixner
2010-10-04 20:31   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:44 ` [patch 06/19] genirq; Provide compat handling for chip->unmask() Thomas Gleixner
2010-10-04 20:31   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:44 ` [patch 07/19] genirq; Provide compat handling for chip->ack() Thomas Gleixner
2010-10-04 20:31   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:44 ` [patch 08/19] genirq; Provide compat handling for chip->mask_ack() Thomas Gleixner
2010-09-27 15:10   ` Geert Uytterhoeven
2010-09-27 15:16     ` Thomas Gleixner
2010-10-04 20:32   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:44 ` [patch 09/19] genirq; Provide compat handling for chip->eoi() Thomas Gleixner
2010-10-04 20:32   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:44 ` [patch 10/19] genirq; Provide compat handling for chip->enable() Thomas Gleixner
2010-10-04 20:32   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:45 ` [patch 11/19] genirq; Provide compat handling for chip->disable()/shutdown() Thomas Gleixner
2010-10-04 20:33   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:45 ` [patch 12/19] genirq; Provide compat handling for chip->startup() Thomas Gleixner
2010-10-04 20:33   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:45 ` [patch 13/19] genirq; Provide compat handling for chip->set_affinity() Thomas Gleixner
2010-10-04 20:34   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:45 ` [patch 14/19] genirq; Provide compat handling for chip->set_type() Thomas Gleixner
2010-10-04 20:34   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:45 ` [patch 15/19] genirq; Provide compat handling for chip->set_wake() Thomas Gleixner
2010-10-04 20:34   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:45 ` [patch 16/19] genirq; Provide compat handling for chip->retrigger() Thomas Gleixner
2010-10-04 20:35   ` [tip:irq/core] genirq: " tip-bot for Thomas Gleixner
2010-09-27 12:45 ` [patch 17/19] genirq: Switch dummy_chip and no_irq_chip to new functions Thomas Gleixner
2010-09-27 12:45 ` [patch 18/19] genirq: Provide Kconfig Thomas Gleixner
2010-09-27 16:43   ` Randy Dunlap
2010-10-04 20:28   ` [tip:irq/core] " tip-bot for Thomas Gleixner
2010-09-27 12:46 ` [patch 19/19] x86: Use genirq Kconfig Thomas Gleixner
2010-10-04 20:28   ` [tip:irq/core] " tip-bot for Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox