]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: zynq: Clear pending interrupt when enabling a IRQ
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 18 Jul 2014 09:52:12 +0000 (11:52 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 23 Jul 2014 14:29:14 +0000 (16:29 +0200)
commit50da6322becc9e11f695f44660ae98c7860fa69a
tree8d1533c42bec5070e0be972ac0674bb7d48a8efa
parenta33412e5d001495e6402134ae67fd926a856b409
gpio: zynq: Clear pending interrupt when enabling a IRQ

The Zynq GPIO controller does not disable the interrupt detection when the
interrupt is masked and only disables the propagation of the interrupt. This
means when the controller detects an interrupt condition while the interrupt is
logically disabled (and masked) it will propagate the recorded interrupt event
once the interrupt is enabled. This will cause the interrupt consumer to see
spurious interrupts to prevent this first make sure that the interrupt is not
asserted and then enable it.

E.g. when a interrupt is requested with request_irq() it will be configured
according to the requested type (edge/level triggered, etc.) after that it will
be enabled. But the detection circuit might have already registered a false
interrupt before the interrupt type was correctly configured and once the
interrupt is unmasked this false interrupt will be propagated and the interrupt
handler for the just request interrupt will called.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-zynq.c