]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: qcom: Move clearing pending IRQ to .irq_request_resources callback
authorMaulik Shah <mkshah@codeaurora.org>
Thu, 5 Nov 2020 07:38:04 +0000 (13:08 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:22:18 +0000 (19:22 +0100)
commit878bfd624d40b82cb203bbc86e823ffe361c9bd8
treeb54448fd6cd5940ae28d9b84f0d8e0f2c08a4025
parent89e313118c266ebfdd300d28fcfc3ec027edd264
pinctrl: qcom: Move clearing pending IRQ to .irq_request_resources callback

[ Upstream commit 71266d9d39366c9b24b866d811b3facaf837f13f ]

When GPIOs that are routed to PDC are used as output they can still latch
the IRQ pending at GIC. As a result the spurious IRQ was handled when the
client driver change the direction to input to starts using it as IRQ.

Currently such erroneous latched IRQ are cleared with .irq_enable callback
however if the driver continue to use GPIO as interrupt and invokes
disable_irq() followed by enable_irq() then everytime during enable_irq()
previously latched interrupt gets cleared.

This can make edge IRQs not seen after enable_irq() if they had arrived
after the driver has invoked disable_irq() and were pending at GIC.

Move clearing erroneous IRQ to .irq_request_resources callback as this is
the place where GPIO direction is changed as input and its locked as IRQ.

While at this add a missing check to invoke msm_gpio_irq_clear_unmask()
from .irq_enable callback only when GPIO is not routed to PDC.

Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy")
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://lore.kernel.org/r/1604561884-10166-1-git-send-email-mkshah@codeaurora.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/qcom/pinctrl-msm.c