2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-29 23:53:55 +08:00
linux-next/arch/arm/mach-pxa
Robert Jarzmik 9ba63e3cc8 ARM: pxa: pxa_cplds: fix interrupt handling
Since its initial commit, the driver is buggy for multiple interrupts
handling. The translation from the former lubbock.c file was not
complete, and might stall all interrupt handling when multiple
interrupts occur.

This is especially true when inside the interrupt handler and if a new
interrupt comes and is not handled, leaving the output line still held,
and not creating a transition as the GPIO block behind would expect to
trigger another cplds_irq_handler() call.

For the record, the hardware is working as follows.

The interrupt mechanism relies on :
 - one status register
 - one mask register

Let's suppose the input irq lines are called :
 - i_sa1111
 - i_lan91x
 - i_mmc_cd
Let's suppose the status register for each irq line is called :
 - status_sa1111
 - status_lan91x
 - status_mmc_cd
Let's suppose the interrupt mask for each irq line is called :
 - irqen_sa1111
 - irqen_lan91x
 - irqen_mmc_cd
Let's suppose the output irq line, connected to GPIO0 is called :
 - o_gpio0

The behavior is as follows :
 - o_gpio0 = not((status_sa1111 & irqen_sa1111) |
		 (status_lan91x & irqen_lan91x) |
		 (status_mmc_cd & irqen_mmc_cd))
   => this is a N-to-1 NOR gate and multiple AND gates
 - irqen_* is exactly as programmed by a write to the FPGA
 - status_* behavior is governed by a bi-stable D flip-flop
   => on next FPGA clock :
     - if i_xxx is high, status_xxx becomes 1
     - if i_xxx is low, status_xxx remains as it is
     - if software sets status_xxx to 0, the D flip-flop is reset
       => status_xxx becomes 0
       => on next FPGA clock cycle, if i_xxx is high, status_xxx becomes
	  1 again

Fixes: fc9e38c0f4 ("ARM: pxa: lubbock: use new pxa_cplds driver")
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
2016-09-09 18:09:53 +02:00
..
include/mach ARM: pxa: remove platform dma code 2016-08-09 08:16:58 +02:00
am200epd.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
am300epd.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
balloon3.c ARM: SoC multiplatform code changes for v4.5 2016-01-20 18:03:56 -08:00
capc7117.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
cm-x2xx-pci.c genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
cm-x2xx-pci.h [ARM] 5280/1: pxa: prepare cm-x2xx.c and cm-x2xx-pci.[ch] for addition of CM-X255 2008-10-07 12:05:05 +01:00
cm-x2xx.c ARM: pxa: cm-x2xx: avoid duplicate macro warnings 2015-12-15 23:50:00 +01:00
cm-x255.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
cm-x270.c rtc: v3020: move rtc-v3020.h to platform_data 2016-07-09 10:24:21 +02:00
cm-x300.c rtc: v3020: move rtc-v3020.h to platform_data 2016-07-09 10:24:21 +02:00
colibri-evalboard.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
colibri-pxa3xx.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
colibri-pxa270-income.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
colibri-pxa270.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
colibri-pxa300.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
colibri-pxa320.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
colibri.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
corgi_pm.c ARM: pxa: fix GPIO double shifts 2016-09-09 18:07:59 +02:00
corgi.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
csb701.c [ARM] pxa/csb701: do not register devices on non-csb726 boads 2009-04-04 10:26:35 +08:00
csb726.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
csb726.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
devices.c ARM: pxa: fix the number of DMA requestor lines 2016-03-29 20:59:18 +02:00
devices.h ARM: pxa: remove platform dma code 2016-08-09 08:16:58 +02:00
em-x270.c rtc: v3020: move rtc-v3020.h to platform_data 2016-07-09 10:24:21 +02:00
eseries-irq.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
eseries.c ARM: pxa: Remove CLK_IS_ROOT 2016-04-30 10:27:09 +02:00
ezx.c ARM: SoC multiplatform code changes for v4.5 2016-01-20 18:03:56 -08:00
generic.c ARM: pxa: Transition pxa25x, pxa27x, pxa3xx to clk framework 2015-05-12 23:26:46 +02:00
generic.h ARM: pxa: remove irq init from dt machines 2016-09-09 18:08:01 +02:00
gumstix.c ARM: pxa: define clock registers as __iomem 2016-02-01 21:43:41 +01:00
gumstix.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
h5000.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
h5000.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
himalaya.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
hx4700.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
icontrol.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
idp.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
idp.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
irq.c ARM: kill off set_irq_flags usage 2015-07-28 13:58:13 +02:00
Kconfig ARM: pxa: add pxa25x device-tree support 2016-08-09 08:16:59 +02:00
littleton.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
littleton.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
lpd270.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
lpd270.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
lubbock.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
magician.c ARM: pxa: magician: Remove duplicated I2C pins declaration 2016-09-09 18:08:00 +02:00
mainstone.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
Makefile ARM: pxa: add pxa25x device-tree support 2016-08-09 08:16:59 +02:00
Makefile.boot ARM: 7022/1: allow to detect conflicting zreladdrs 2011-10-17 09:12:40 +01:00
mfp-pxa2xx.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mfp-pxa2xx.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mfp-pxa3xx.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mfp-pxa3xx.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mfp-pxa25x.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mfp-pxa27x.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mfp-pxa300.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mfp-pxa320.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mfp-pxa930.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mioa701_bootresume.S ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
mioa701.c ARM: SoC multiplatform code changes for v4.5 2016-01-20 18:03:56 -08:00
mioa701.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mp900.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mxm8x10.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
mxm8x10.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palm27x.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palm27x.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palmld.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palmt5.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palmt5.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palmtc.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palmte2.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palmte2.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palmtreo.c ARM: SoC multiplatform code changes for v4.5 2016-01-20 18:03:56 -08:00
palmtreo.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
palmtx.c ARM: SoC multiplatform code changes for v4.5 2016-01-20 18:03:56 -08:00
palmz72.c ARM: SoC multiplatform code changes for v4.5 2016-01-20 18:03:56 -08:00
palmz72.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pcm027.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pcm027.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pcm990_baseboard.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pcm990-baseboard.c ARM: SoC multiplatform code changes for v4.5 2016-01-20 18:03:56 -08:00
pm.c ARM: pxa: Use kmalloc_array() in pxa_pm_init() 2016-09-09 18:08:00 +02:00
pm.h ARM: pxa: move extern declarations to pm.h 2016-02-01 21:44:27 +01:00
poodle.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa2xx.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa3xx-ulpi.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa3xx.c ARM: pxa: remove irq init from dt machines 2016-09-09 18:08:01 +02:00
pxa3xx.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa25x.c ARM: pxa: remove irq init from dt machines 2016-09-09 18:08:01 +02:00
pxa25x.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa27x-udc.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa27x.c ARM: pxa: remove irq init from dt machines 2016-09-09 18:08:01 +02:00
pxa27x.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa300.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa300.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa320.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa320.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa930.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa930.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
pxa_cplds_irqs.c ARM: pxa: pxa_cplds: fix interrupt handling 2016-09-09 18:09:53 +02:00
pxa-dt.c ARM: pxa: remove irq init from dt machines 2016-09-09 18:08:01 +02:00
raumfeld.c device property: don't bother the drivers with struct property_set 2016-04-09 03:10:50 +02:00
regs-rtc.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
regs-u2d.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
reset.c ARM: pxa: prevent PXA270 occasional reboot freezes 2013-12-11 16:35:16 -08:00
saar.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
sharpsl_pm.c ARM: pxa: fix GPIO double shifts 2016-09-09 18:07:59 +02:00
sharpsl_pm.h ARM: pxa: fix GPIO double shifts 2016-09-09 18:07:59 +02:00
sleep.S ARM: pxa: correct errata number for PXA270 2014-07-04 20:30:42 +08:00
smemc.c ARM: PXA3xx: program the CSMSADRCFG register 2013-01-23 16:56:32 +08:00
spitz_pm.c ARM: pxa: fix GPIO double shifts 2016-09-09 18:07:59 +02:00
spitz.c arm: use the new LED disk activity trigger 2016-06-27 08:58:40 +02:00
standby.S ARM: convert all "mov.* pc, reg" to "bx reg" for ARMv6+ 2014-07-18 12:29:04 +01:00
stargate2.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
tavorevb.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
tosa_bt.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
tosa-bt.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
tosa.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
trizeps4.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
udc.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
viper.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
viper.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
vpac270.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
xcep.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
z2.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
zeus.c ARM: pxa: define clock registers as __iomem 2016-02-01 21:43:41 +01:00
zeus.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
zylonite_pxa300.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
zylonite_pxa320.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
zylonite.c ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00
zylonite.h ARM: pxa: make more mach/*.h files local 2015-12-01 21:52:50 +01:00