kernel: gpio-button-hotplug: Add missing ONESHOT flag to threaded IRQ request
authorJohn Crispin <john@openwrt.org>
Thu, 3 Mar 2016 20:24:47 +0000 (20:24 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 3 Mar 2016 20:24:47 +0000 (20:24 +0000)
commit449f23fa6ae6b2bdfe88bc9d892fe5f72aa55bf0
tree2b4b2c2b3a792bdf3d1510c9664c6787ad3a7dd5
parentc02459b083b337ee99486001c043b7388baa7cb7
kernel: gpio-button-hotplug: Add missing ONESHOT flag to threaded IRQ request

Without the IRQF_ONESHOT flag in devm_request_threaded_irq() call I get
following error:

  genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq 56
  gpio-keys gpio-keys: failed to request irq:56 for gpio:20

>From kernel/irq/manage.c:

 The interrupt was requested with handler = NULL, so we use the default
 primary handler for it. But it does not have the oneshot flag set. In
 combination with level interrupts this is deadly, because the default
 primary handler just wakes the thread, then the irq lines is reenabled,
 but the device still has the level irq asserted. Rinse and repeat....

 While this works for edge type interrupts, we play it safe and reject
 unconditionally because we can't say for sure which type this interrupt
 really has. The type flags are unreliable as the underlying chip
 implementation can override them.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
SVN-Revision: 48894
package/kernel/gpio-button-hotplug/Makefile
package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c