]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: omap: ensure irq is enabled before wakeup
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 10 Jun 2019 17:10:44 +0000 (20:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:12:34 +0000 (09:12 +0200)
commitfd40385f2cdd78bc58d835c8caa8362b36bf0307
tree4617d115b2e5438516e14b24cdf7380b591b4f71
parente1a324ccf033f2eacad940d560040880085b367f
gpio: omap: ensure irq is enabled before wakeup

[ Upstream commit c859e0d479b3b4f6132fc12637c51e01492f31f6 ]

Documentation states:

  NOTE: There must be a correlation between the wake-up enable and
  interrupt-enable registers. If a GPIO pin has a wake-up configured
  on it, it must also have the corresponding interrupt enabled (on
  one of the two interrupt lines).

Ensure that this condition is always satisfied by enabling the detection
events after enabling the interrupt, and disabling the detection before
disabling the interrupt.  This ensures interrupt/wakeup events can not
happen until both the wakeup and interrupt enables correlate.

If we do any clearing, clear between the interrupt enable/disable and
trigger setting.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-omap.c