]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type
authorDaniel Kurtz <djkurtz@chromium.org>
Sat, 22 Sep 2018 19:58:26 +0000 (13:58 -0600)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 25 Sep 2018 10:39:19 +0000 (12:39 +0200)
commit62fc9c409ee66803737c1dff9e91924dce2cc86a
tree3378e362516134913cc132f06e247c67fd033676
parentcf80c873e685c0440e4b1c448412449c7a97917a
pinctrl/amd: poll InterruptEnable bits in amd_gpio_irq_set_type

From the AMD BKDG, if WAKE_INT_MASTER_REG.MaskStsEn is set, a software
write to the debounce registers of *any* gpio will block wake/interrupt
status generation for *all* gpios for a length of time that depends on
WAKE_INT_MASTER_REG.MaskStsLength[11:0].  During this period the Interrupt
Delivery bit (INTERRUPT_ENABLE) will read as 0.

In commit 7e9c8d23ec5a0e ("pinctrl/amd: poll InterruptEnable bits in
enable_irq") we tried to fix this same "gpio Interrupts are blocked
immediately after writing debounce registers" problem, but incorrectly
assumed it only affected the gpio whose debounce was being configured
and not ALL gpios.

To solve this for all gpios, we move the polling loop from
amd_gpio_irq_enable() to amd_gpio_irq_set_type(), while holding the gpio
spinlock.  This ensures that another gpio operation (e.g.
amd_gpio_irq_unmask()) can read a temporarily disabled IRQ and
incorrectly disable it while trying to modify some other register bits.

Fixes: 7e9c8d23ec5a0e pinctrl/amd: poll InterruptEnable bits in enable_irq
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-amd.c