kernel_optimize_test/arch/arm/mach-orion5x
Nicolas Pitre fd4b9b3650 [ARM] 5401/1: Orion: fix edge triggered GPIO interrupt support
The GPIO interrupts can be configured as either level triggered or edge
triggered, with a default of level triggered.  When an edge triggered
interrupt is requested, the gpio_irq_set_type method is called which
currently switches the given IRQ descriptor between two struct irq_chip
instances: orion_gpio_irq_level_chip and orion_gpio_irq_edge_chip. This
happens via __setup_irq() which also calls irq_chip_set_defaults() to
assign default methods to uninitialized ones.  The problem is that
irq_chip_set_defaults() is called before the irq_chip reference is
switched, leaving the new irq_chip (orion_gpio_irq_edge_chip in this
case) with uninitialized methods such as chip->startup() causing a kernel
oops.

Many solutions are possible, such as making irq_chip_set_defaults() global
and calling it from gpio_irq_set_type(), or calling __irq_set_trigger()
before irq_chip_set_defaults() in __setup_irq().  But those require
modifications to the generic IRQ code which might have adverse effect on
other architectures, and that would still be a fragile arrangement.
Manually copying the missing methods from within gpio_irq_set_type()
would be really ugly and it would break again the day new methods with
automatic defaults are added.

A better solution is to have a single irq_chip instance which can deal
with both edge and level triggered interrupts.  It is also a good idea
to switch the IRQ handler instead, as the edge IRQ handler allows for
one edge IRQ event to be queued as the IRQ is actually masked only when
that second IRQ is received, at which point the hardware can queue an
additional IRQ event, making edge triggered interrupts a bit more
reliable.

Tested-by: Martin Michlmayr <tbm@cyrius.com>

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-02-17 22:37:09 +00:00
..
include/mach [ARM] Orion: share GPIO IRQ handling code 2008-12-20 12:24:05 -05:00
addr-map.c [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
common.c [ARM] Orion: add the option to support different ehci phy initialization 2008-12-04 01:28:14 -05:00
common.h [ARM] Orion: share GPIO handling code 2008-12-20 12:21:02 -05:00
db88f5281-setup.c mv643xx_eth: remove force_phy_addr field 2008-09-05 06:33:59 +02:00
dns323-setup.c [ARM] DNS323: Initialise 88F5182 correctly 2008-12-11 16:38:56 -05:00
edmini_v2-setup.c [ARM] EDMINIV2: add support for LED and power button 2008-09-25 16:27:22 -04:00
irq.c [ARM] 5401/1: Orion: fix edge triggered GPIO interrupt support 2009-02-17 22:37:09 +00:00
Kconfig [ARM] Orion: Add Buffalo Linkstation Mini support 2008-09-25 17:00:01 -04:00
kurobox_pro-setup.c Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-11 10:09:45 -07:00
lsmini-setup.c [ARM] Orion: Add Buffalo Linkstation Mini power-off method 2008-09-25 23:54:19 -04:00
Makefile [ARM] Orion: share GPIO handling code 2008-12-20 12:21:02 -05:00
Makefile.boot Orion: orion -> orion5x rename 2008-03-27 14:51:41 -04:00
mpp.c [ARM] Orion: share GPIO handling code 2008-12-20 12:21:02 -05:00
mpp.h [ARM] Orion: rework MPP handling 2008-06-22 22:44:47 +02:00
mss2-setup.c mv643xx_eth: remove force_phy_addr field 2008-09-05 06:33:59 +02:00
mv2120-setup.c mv643xx_eth: remove force_phy_addr field 2008-09-05 06:33:59 +02:00
pci.c [ARM] 5360/1: Orion: fix compilation error 2009-01-08 16:29:40 +00:00
rd88f5181l-fxo-setup.c [ARM] Orion: instantiate the dsa switch driver 2008-10-19 14:29:05 -04:00
rd88f5181l-ge-setup.c [ARM] Orion: instantiate the dsa switch driver 2008-10-19 14:29:05 -04:00
rd88f5182-setup.c mv643xx_eth: remove force_phy_addr field 2008-09-05 06:33:59 +02:00
rd88f6183ap-ge-setup.c [ARM] Orion: instantiate the dsa switch driver 2008-10-19 14:29:05 -04:00
terastation_pro2-setup.c [ARM] Orion: add Buffalo Terastation Pro II/Live support 2008-09-25 16:26:44 -04:00
ts78xx-setup.c mv643xx_eth: remove force_phy_addr field 2008-09-05 06:33:59 +02:00
ts209-setup.c [ARM] Orion: register UART1 on QNAP TS-209 and TS-409 2008-08-21 22:15:17 -04:00
ts409-setup.c [ARM] Orion: register UART1 on QNAP TS-209 and TS-409 2008-08-21 22:15:17 -04:00
tsx09-common.c Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-11 10:09:45 -07:00
tsx09-common.h [ARM] Orion: remove code duplication in TS209 and TS409 setup files 2008-06-22 22:44:54 +02:00
wnr854t-setup.c mv643xx_eth: remove force_phy_addr field 2008-09-05 06:33:59 +02:00
wrt350n-v2-setup.c [ARM] Orion: instantiate the dsa switch driver 2008-10-19 14:29:05 -04:00