]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl/amd: poll InterruptEnable bits in enable_irq
authorDaniel Kurtz <djkurtz@chromium.org>
Mon, 12 Mar 2018 16:45:30 +0000 (10:45 -0600)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 26 Mar 2018 09:09:49 +0000 (11:09 +0200)
commit7e9c8d23ec5a0e2609c1aeda38b812d98c4622c4
tree557a64c93cb81f78c1c07e40f74c213006822709
parent50c6207ce1648a12a28c7d233b9256686a7bc772
pinctrl/amd: poll InterruptEnable bits in enable_irq

In certain cases interrupt enablement will be delayed relative to when
the InterruptEnable bits are written.  One example of this is when
a GPIO's "debounce" logice is first enabled.  After enabling debounce,
there is a 900 us "warm up" period during which InterruptEnable[0]
(bit 11) will read as 0 despite being written 1.  During this time
InterruptSts will not be updated, nor will interrupts be delivered, even
if the GPIO's interrupt configuration has been written to the register.

To work around this delay, poll the InterruptEnable bits after setting
them to ensure interrupts have truly been enabled in hardware before
returning from the irq_enable handler.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-amd.c