[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201123121838.197550694@linuxfoundation.org>
Date: Mon, 23 Nov 2020 13:20:04 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Tony Lindgren <tony@...mide.com>,
Aaro Koskinen <aaro.koskinen@....fi>,
Grygorii Strashko <grygorii.strashko@...com>,
Keerthy <j-keerthy@...com>,
Ladislav Michl <ladis@...ux-mips.org>,
Peter Ujfalusi <peter.ujfalusi@...com>,
Russell King <rmk+kernel@...linux.org.uk>,
Tero Kristo <t-kristo@...com>,
Linus Walleij <linus.walleij@...aro.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.9 054/252] Revert "Revert "gpio: omap: Fix lost edge wake-up interrupts""
From: Tony Lindgren <tony@...mide.com>
[ Upstream commit 7ffa08169849be898eed6f3694aab8c425497749 ]
This reverts commit 579ced8fdb00b8e94304a83e3cc419f6f8eab08e.
Turns out I was overly optimistic about cpu_pm blocking idle being a
solution for handling edge interrupts. While it helps in preventing
entering idle states that potentially lose context, we can still get
an edge interrupt triggering while entering idle. So we need to also
add back the workaround for seeing if there are any pending edge
interrupts when waking up.
Signed-off-by: Tony Lindgren <tony@...mide.com>
Cc: Aaro Koskinen <aaro.koskinen@....fi>
Cc: Grygorii Strashko <grygorii.strashko@...com>
Cc: Keerthy <j-keerthy@...com>
Cc: Ladislav Michl <ladis@...ux-mips.org>
Cc: Peter Ujfalusi <peter.ujfalusi@...com>
Cc: Russell King <rmk+kernel@...linux.org.uk>
Cc: Tero Kristo <t-kristo@...com>
Link: https://lore.kernel.org/r/20201028060556.56038-1-tony@atomide.com
Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/gpio/gpio-omap.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 0ea640fb636cf..3b87989e27640 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1114,13 +1114,23 @@ static void omap_gpio_idle(struct gpio_bank *bank, bool may_lose_context)
{
struct device *dev = bank->chip.parent;
void __iomem *base = bank->base;
- u32 nowake;
+ u32 mask, nowake;
bank->saved_datain = readl_relaxed(base + bank->regs->datain);
if (!bank->enabled_non_wakeup_gpios)
goto update_gpio_context_count;
+ /* Check for pending EDGE_FALLING, ignore EDGE_BOTH */
+ mask = bank->enabled_non_wakeup_gpios & bank->context.fallingdetect;
+ mask &= ~bank->context.risingdetect;
+ bank->saved_datain |= mask;
+
+ /* Check for pending EDGE_RISING, ignore EDGE_BOTH */
+ mask = bank->enabled_non_wakeup_gpios & bank->context.risingdetect;
+ mask &= ~bank->context.fallingdetect;
+ bank->saved_datain &= ~mask;
+
if (!may_lose_context)
goto update_gpio_context_count;
--
2.27.0
Powered by blists - more mailing lists