linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.9 01/21] Revert "Revert "gpio: omap: Fix lost edge wake-up interrupts""
@ 2020-11-17 12:56 Sasha Levin
  2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 02/21] tools, bpftool: Avoid array index warnings Sasha Levin
                   ` (19 more replies)
  0 siblings, 20 replies; 23+ messages in thread
From: Sasha Levin @ 2020-11-17 12:56 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Tony Lindgren, Aaro Koskinen, Grygorii Strashko, Keerthy,
	Ladislav Michl, Peter Ujfalusi, Russell King, Tero Kristo,
	Linus Walleij, Sasha Levin, linux-omap, linux-gpio

From: Tony Lindgren <tony@atomide.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@atomide.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Keerthy <j-keerthy@ti.com>
Cc: Ladislav Michl <ladis@linux-mips.org>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Tero Kristo <t-kristo@ti.com>
Link: https://lore.kernel.org/r/20201028060556.56038-1-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 | 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


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2020-11-19  1:23 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 12:56 [PATCH AUTOSEL 5.9 01/21] Revert "Revert "gpio: omap: Fix lost edge wake-up interrupts"" Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 02/21] tools, bpftool: Avoid array index warnings Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 03/21] habanalabs/gaudi: mask WDT error in QMAN Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 04/21] pinctrl: rockchip: enable gpio pclk for rockchip_gpio_to_irq Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 05/21] scsi: ufs: Fix unbalanced scsi_block_reqs_cnt caused by ufshcd_hold() Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 06/21] scsi: ufs: Try to save power mode change and UIC cmd completion timeout Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 07/21] pinctrl: mcp23s08: Print error message when regmap init fails Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 08/21] selftests: kvm: Fix the segment descriptor layout to match the actual layout Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 09/21] ACPI: button: Add DMI quirk for Medion Akoya E2228T Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 10/21] arm64: errata: Fix handling of 1418040 with late CPU onlining Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 11/21] arm64: psci: Avoid printing in cpu_psci_cpu_die() Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 12/21] arm64: smp: Tell RCU about CPUs that fail to come online Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 13/21] lockdep: Avoid to modify chain keys in validate_chain() Sasha Levin
2020-11-18  1:26   ` Boqun Feng
2020-11-19  1:22     ` Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 14/21] um: Call pgtable_pmd_page_dtor() in __pmd_free_tlb() Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 15/21] vfs: remove lockdep bogosity in __sb_start_write Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 16/21] gfs2: fix possible reference leak in gfs2_check_blk_type Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 17/21] hwmon: (pwm-fan) Fix RPM calculation Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 18/21] gfs2: Fix case in which ail writes are done to jdata holes Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 19/21] arm64: Add MIDR value for KRYO2XX gold/silver CPU cores Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 20/21] arm64: kpti: Add KRYO2XX gold/silver CPU cores to kpti safelist Sasha Levin
2020-11-17 12:56 ` [PATCH AUTOSEL 5.9 21/21] arm64: cpu_errata: Apply Erratum 845719 to KRYO2XX Silver Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).