Skip to content

genirq: Overhaul for 2.6.39

Thomas Gleixner linux-arch linux-arm-kernel linux-tegra lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest75 patches 20 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/75genirq: Namespace cleanupinclude/linux/irq.h include/linux/irqdesc.h kernel/irq/chip.c+116 -280 replies
2/75genirq: Simplify affinity related codekernel/irq/manage.c+41 -230 replies
3/75genirq: Rremove redundant checkkernel/irq/manage.c+2 -10 replies
4/75genirq: Always apply cpu online maskkernel/irq/manage.c+6 -60 replies
5/75genirq: Do not copy affinity before setinclude/linux/irq.h kernel/irq/manage.c+49 -110 replies
6/75genirq: Plug race in report_bad_irq()kernel/irq/spurious.c+9 -30 replies
7/75genirq: Warn when handler enables interruptskernel/irq/handle.c+3 -10 replies
8/75genirq: Fixup poll handlingkernel/irq/spurious.c+19 -310 replies
9/75genirq: Do not poll disabled, percpu and timer interruptskernel/irq/spurious.c+26 -140 replies
10/75genirq: spurious: Run only one poller at a timekernel/irq/spurious.c+15 -10 replies
11/75genirq: Mark polled irqs and defer the real handlerinclude/linux/irq.h kernel/irq/chip.c kernel/irq/internals.h +1 more+61 -280 replies
12/75genirq: Move irq thread flags to coreinclude/linux/interrupt.h kernel/irq/internals.h+14 -140 replies
13/75genirq: Remove bogus conditionalkernel/irq/manage.c+1 -40 replies
14/75genirq: Consolidate startup/shutdown of interruptskernel/irq/autoprobe.c kernel/irq/chip.c kernel/irq/internals.h +1 more+33 -310 replies
15/75genirq: Consolidate disable/enablekernel/irq/chip.c kernel/irq/internals.h kernel/irq/manage.c +2 more+20 -80 replies
16/75genirq: Remove default magickernel/irq/chip.c kernel/irq/manage.c+17 -600 replies
17/75genirq: Consolidate IRQ_DISABLEDkernel/irq/chip.c kernel/irq/manage.c kernel/irq/resend.c +1 more+14 -162 replies
18/75genirq: Do not fiddle with IRQ_MASKED in handle_edge_irq()kernel/irq/chip.c+1 -10 replies
19/75m68knommu: 5772: Replace private irq flow handlerarch/m68knommu/platform/5272/intc.c+2 -50 replies
20/75arm: Ns9xxx: Remove private irq flow handlerarch/arm/mach-ns9xxx/irq.c+4 -540 replies
21/75genirq: Mark handle_IRQ_event deprecatedinclude/linux/irq.h+3 -20 replies
22/75genirq: Implement handle_irq_event()kernel/irq/handle.c kernel/irq/internals.h+43 -80 replies
23/75genirq: Use handle_irq_event() in handle_simple_irq()kernel/irq/chip.c+2 -130 replies
24/75genirq: Use handle_irq_event() in handle_level_irq()kernel/irq/chip.c+2 -140 replies
25/75genirq: Use handle_irq_event() in handle_fasteoi_irq()kernel/irq/chip.c+2 -170 replies
26/75genirq: Use handle_irq_event() in handle_edge_irq()kernel/irq/chip.c+2 -140 replies
27/75genirq: Use handle_perpcu_event() in handle_percpu_irq()kernel/irq/chip.c+6 -80 replies
28/75genirq: Use handle_irq_event() in the spurious poll codekernel/irq/spurious.c+9 -120 replies
29/75genirq: Simplify handle_irq_event()kernel/irq/handle.c+5 -120 replies
30/75genirq: Implement generic irq_show_interrupts()fs/proc/interrupts.c include/linux/interrupt.h kernel/irq/Kconfig +1 more+80 -10 replies
31/75genirq: Fixup core code namespace falloutkernel/irq/chip.c kernel/irq/manage.c+4 -40 replies
32/75genirq: Add internal state field to irq_descinclude/linux/irqdesc.h kernel/irq/internals.h+8 -10 replies
33/75gpio: Remove broken irq_desc hackery.drivers/gpio/gpiolib.c+0 -441 reply
34/75arm: ep93xx: Kill another instance of broken irq_desc fiddlingarch/arm/mach-ep93xx/gpio.c+0 -384 replies
35/75genirq: Protect tglx from tripping over his own feetkernel/irq/internals.h kernel/irq/irqdesc.c kernel/irq/settings.h+11 -20 replies
36/75genirq: Move IRQ_AUTODETECT to internal stateinclude/linux/irq.h kernel/irq/autoprobe.c kernel/irq/internals.h +1 more+27 -210 replies
37/75genirq: Move IRQ_SPURIOUS_DISABLED to core stateinclude/linux/irq.h kernel/irq/internals.h kernel/irq/manage.c +1 more+11 -100 replies
38/75genirq: Move IRQ_NESTED_THREAD to core stateinclude/linux/irq.h kernel/irq/chip.c kernel/irq/internals.h +2 more+11 -90 replies
39/75genirq: Move IRQ_POLL_INPROGRESS to coreinclude/linux/irq.h kernel/irq/chip.c kernel/irq/internals.h +1 more+6 -50 replies
40/75genirq: Add IRQ_INPROGRESS to coreinclude/linux/irq.h kernel/irq/Kconfig kernel/irq/chip.c +6 more+57 -220 replies
41/75genirq: Move IRQ_ONESHOT to coreinclude/linux/irq.h kernel/irq/chip.c kernel/irq/internals.h +1 more+7 -60 replies
42/75genirq: Move IRQ_REPLAY and IRQ_WAITING to coreinclude/linux/irq.h kernel/irq/autoprobe.c kernel/irq/chip.c +4 more+31 -210 replies
43/75genirq: Move IRQ_DISABLED to coreinclude/linux/irq.h kernel/irq/chip.c kernel/irq/compat.h +6 more+57 -250 replies
44/75genirq: Move IRQ_PENDING flag to coreinclude/linux/irq.h kernel/irq/autoprobe.c kernel/irq/chip.c +8 more+40 -170 replies
45/75genirq: Move IRQ_MASKED to coreinclude/linux/irq.h kernel/irq/chip.c kernel/irq/compat.h +4 more+41 -130 replies
46/75genirq: Move IRQ_SUSPENDED to coreinclude/linux/irq.h kernel/irq/internals.h kernel/irq/manage.c +1 more+9 -90 replies
47/75arm: tegra: Remove unused function which fiddles with irq_descarch/arm/mach-tegra/gpio.c arch/arm/mach-tegra/irq.c+0 -1211 reply
48/75genirq: Move IRQ_WAKEUP to coreinclude/linux/irq.h kernel/irq/internals.h kernel/irq/manage.c +2 more+7 -40 replies
49/75genirq: Add state field to irq_datainclude/linux/irq.h include/linux/irqdesc.h+4 -00 replies
50/75genirq: Add IRQ_MOVE_PENDING to irq_data.stateinclude/linux/irq.h kernel/irq/compat.h kernel/irq/internals.h +4 more+52 -80 replies
51/75genirq: Remove CONFIG_IRQ_PER_CPUinclude/linux/irq.h kernel/irq/Kconfig kernel/irq/internals.h +1 more+3 -160 replies
52/75genirq: Make CHECK_IRQ_PER_CPU an inline and deprecate itinclude/linux/irq.h+6 -20 replies
53/75genirq: Remove CHECK_IRQ_PER_CPU from core codekernel/irq/manage.c kernel/irq/migration.c+3 -30 replies
54/75genirq: Move debug code to separate headerkernel/irq/debug.h kernel/irq/internals.h+44 -440 replies
55/75genirq: Mirror IRQ_PER_CPU and IRQ_NO_BALANCING in irq_data.stateinclude/linux/irq.h kernel/irq/chip.c kernel/irq/internals.h +4 more+84 -150 replies
56/75genirq: Reuse existing can set affinty checkkernel/irq/manage.c kernel/irq/proc.c+3 -40 replies
57/75genirq: Move IRQ_AFFINITY_SET to coreinclude/linux/irq.h kernel/irq/compat.h kernel/irq/internals.h +2 more+32 -50 replies
58/75genirq: Mirror irq trigger type bits in irq_data.stateinclude/linux/irq.h kernel/irq/chip.c kernel/irq/manage.c +2 more+87 -200 replies
59/75genirq: Wrap the remaning IRQ_* flagskernel/irq/autoprobe.c kernel/irq/chip.c kernel/irq/manage.c +1 more+59 -80 replies
60/75genirq: Force wrapped access to desc->status in core codekernel/irq/handle.c kernel/irq/irqdesc.c kernel/irq/settings.h+8 -50 replies
61/75genirq: Cleanup irq.hinclude/linux/irq.h kernel/irq/settings.h+59 -460 replies
62/75genirq: Add flags to irq_chipinclude/linux/irq.h+3 -00 replies
63/75genirq: Add IRQCHIP_SET_TYPE_MASKED flag and IRQD_WAKE_SETinclude/linux/irq.h kernel/irq/chip.c kernel/irq/internals.h +1 more+25 -42 replies
64/75genirq: Move wakeup state to irq_datainclude/linux/irq.h kernel/irq/internals.h kernel/irq/manage.c +1 more+11 -50 replies
65/75genirq: Reflect IRQ_INPROGRESS/DISABLED in irq_data.stateinclude/linux/irq.h kernel/irq/chip.c kernel/irq/handle.c+20 -00 replies
66/75genirq: Reflect IRQ_MOVE_PCNTXT in irq_data stateinclude/linux/irq.h kernel/irq/chip.c+11 -10 replies
67/75genirq: Remove desc->status when GENERIC_HARDIRQS_NO_COMPAT=yinclude/linux/irqdesc.h kernel/irq/internals.h kernel/irq/settings.h+11 -00 replies
68/75genirq: Add preflow handler supportinclude/linux/irq.h include/linux/irqdesc.h kernel/irq/Kconfig +1 more+30 -10 replies
69/75genirq: Implement irq_data based move_*_irq() versionsinclude/linux/irq.h kernel/irq/migration.c+25 -110 replies
70/75x86: Fixup deprecation warningsarch/x86/kernel/apic/io_apic.c arch/x86/kernel/hpet.c+19 -190 replies
71/75x86: ioapic: Use irq_data->statearch/x86/kernel/apic/io_apic.c+7 -80 replies
72/75x86: Use the proper accessors in fixup_irqs()arch/x86/kernel/irq.c+4 -20 replies
73/75x86: ioapic: Use new move_irq functionsarch/x86/kernel/apic/io_apic.c+2 -20 replies
74/75x86: Use generic show_interruptsarch/x86/Kconfig arch/x86/kernel/irq.c+3 -550 replies
75/75x86: Disable deprecated GENIRQ featuresarch/x86/Kconfig+2 -00 replies

Reviews trailers per patch

4 of 75 patches have a Reviewed-by or Acked-by.

PatchUwe Kleine-KoenigGreg UngererColin CrossH Hartley Sweeten
1/75
2/75
3/75
4/75
5/75
6/75
7/75
8/75
9/75
10/75
11/75
12/75
13/75
14/75
15/75
16/75
17/75
18/75
19/75A-b
20/75A-b
21/75
22/75
23/75
24/75
25/75
26/75
27/75
28/75
29/75
30/75
31/75
32/75
33/75
34/75A-b
35/75
36/75
37/75
38/75
39/75
40/75
41/75
42/75
43/75
44/75
45/75
46/75
47/75A-b
48/75
49/75
50/75
51/75
52/75
53/75
54/75
55/75
56/75
57/75
58/75
59/75
60/75
61/75
62/75
63/75
64/75
65/75
66/75
67/75
68/75
69/75
70/75
71/75
72/75
73/75
74/75
75/75

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [patch 00/75] genirq: Overhaul for 2.6.39

This is a major overhaul of the generic interrupt layer.

- Namespace cleanup

- Further encapsulation of the core state

- Spurious/Poll handling fixes

- Stop setaffinity blindly manipulating affinity mask

- Cleanups and enhancements all over the place

1) Namespace cleanup

I reworked the slightly confusing (sorry, my bad) namespace of the various accessor functions. They follow a simple scheme now:

irq_set/get_xxx(unsigned int irq, ...)
irq_data_set/get_xxx(struct irq_data *d, ...)

That's the first patch in the series and I'm going to apply it to a separate rc-4 based branch which everybody can pull in to do the changes now in his tree.

2) Encapsulation

After __do_IRQ() was finally gone (Thanks to all involved!) I wanted to restructure the core status handling and cleanup the IRQ_* flag space.

A quick grep over the tree made me really shudder, so I converted 13 archs which are known to follow core changes slow to the new irq_chip callback functions and cleaned up the irq_desc accessors while at it. That way I learned also a lot about arch requirements.

Then I looked at the remaining places which deal with irq_desc->status directly.

1) Special EOI handling in sparc64/mips/sh. Easy to replace.

2) Random abusers of chained_interrupt_handler. The worst offender is arch/powerpc/sysdev/fsl_msi.c, which implements a combo eoi/level flow handler instead of using the existing ones.

3) Random places which quirk around their chip oddities instead of looking for solutions which can be made generic. One of them is the requirement to mask irq chips before setting the trigger type. Why is nobody talking to me ?

4) Random leftovers from the __do_IRQ() semantics which are easy to cleanup.

5) Initializations with IRQ_DISABLED and random IRQ_ flags. IRQ_DISABLED is core internal state and already set by default. The settable flags have to use the provided modifier functions.

6) Weird flow handlers in m68knommu/arm/powerpc. All of them can be either replaced by existing handlers or can use an existing handler with minimal modifications. Patches are already out.

7) Totally broken debug code in gpiolib and a copy of the same in some arm Soc code. Patch is in this series to kill it. Also remove unused code in arm/mach-tegra which seems to be some relict from the android mess.

So there is no real requirement to expose the guts of the generic irq code to the world.

Even if all is cleaned up, I'm tired of:

- Having to chase the creative abusage all the time

- People not talking to me about their special requirements

- Spending another day to find out that someone had typoed desc->status |= IRQ_LEVEL; into desc->status = IRQ_LEVEL; in some weird arch code and then complaining about the core code playing silly buggers.

So I decided to encapsulate the state into the core and make it hard to access and offenders easy to find. For now I keep the existing and used IRQ_* status bits up to date, unless GENERIC_HARDIRQS_NO_COMPAT=y which can be selected by the architecture. Be aware that not setting that config adds extra overhead to the core code.

For all real requirements which I found, I provided solutions either in the core itself or information accessible via a state field in irq_data, which is handed to the irq_chip functions. So setting GENERIC_HARDIRQS_NO_COMPAT=y should be not a big deal on most architectures. There are some gpio and mfd drivers which need to be converted to threaded interrupts instead of having the old style racy and ugly disable_irq_nosync/schedule_work() implementation.

There are a few places which need some thought like the powerpc kexec shutdown, but even that stuff should be generic as it makes sense to cleanup irqs before booting into a new kernel. Nothing which can't be solved though.

Note that most accessors to irq_desc are going away sooner than later and long term I want to remove irq_desc from the public space completely.

One step to this is a generic show_interrupts() function, which replaces the 23 copies with random modifications and different bugs inside. Unless you switch over you will be reminded by a nice deprecated warning.

3) Spurious/Poll

This is a long neglected piece of code and got an overhaul so it's simpler and less broken than it used to be.

4) irq_setaffinity()

Does not longer blindly update the affinity mask before calling into the arch code. Also the chip functions can now return a return code, which tells the core that it modified the mask itself. That's useful when arch code restricts the mask further than the core code can do.

5) Cleanups and enhancements

Main cleanup happened in poll and the consolidation of the flow handlers which moved their duplicated code into handle_irq_event

irq_set_type() now checks chip.flags for a chip flag, which indicates that the chip needs to be masked before setting the trigger type. That avoids duplicated code and fiddling with internal core state.

If no major outcry comes I'm going to push this into tip/irq/core and next.

A preview is available at:

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-genirq.git irq/core

Thanks,

tglx