[PATCH 2/2] pinctrl: sunxi: Mask non-wakeup IRQs on suspend

15 views
Skip to first unread message

Samuel Holland

unread,
Jan 17, 2020, 4:33:45 PM1/17/20
to Maxime Ripard, Chen-Yu Tsai, Linus Walleij, linux-ar...@lists.infradead.org, linux...@vger.kernel.org, linux-...@vger.kernel.org, linux...@googlegroups.com, Samuel Holland
The pin controller hardware does not distinguish IRQs intended for
wakeup from other IRQs, so we must mask non-wakeup IRQs in software to
prevent inadvertent wakeups. This is accomplished at the irqchip level
via the IRQCHIP_MASK_ON_SUSPEND flag.

Signed-off-by: Samuel Holland <sam...@sholland.org>
---
drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
index df79da76321e..24ff591efded 100644
--- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
@@ -1076,6 +1076,7 @@ static struct irq_chip sunxi_pinctrl_edge_irq_chip = {
.irq_release_resources = sunxi_pinctrl_irq_release_resources,
.irq_set_type = sunxi_pinctrl_irq_set_type,
.irq_set_wake = sunxi_pinctrl_irq_set_wake,
+ .flags = IRQCHIP_MASK_ON_SUSPEND,
};

static struct irq_chip sunxi_pinctrl_level_irq_chip = {
@@ -1092,6 +1093,7 @@ static struct irq_chip sunxi_pinctrl_level_irq_chip = {
.irq_set_type = sunxi_pinctrl_irq_set_type,
.irq_set_wake = sunxi_pinctrl_irq_set_wake,
.flags = IRQCHIP_EOI_THREADED |
+ IRQCHIP_MASK_ON_SUSPEND |
IRQCHIP_EOI_IF_HANDLED,
};

--
2.23.0

Linus Walleij

unread,
Feb 21, 2020, 9:16:05 AM2/21/20
to Samuel Holland, Maxime Ripard, Chen-Yu Tsai, Linux ARM, open list:GPIO SUBSYSTEM, linux-...@vger.kernel.org, linux-sunxi
On Fri, Jan 17, 2020 at 10:33 PM Samuel Holland <sam...@sholland.org> wrote:

> The pin controller hardware does not distinguish IRQs intended for
> wakeup from other IRQs, so we must mask non-wakeup IRQs in software to
> prevent inadvertent wakeups. This is accomplished at the irqchip level
> via the IRQCHIP_MASK_ON_SUSPEND flag.
>
> Signed-off-by: Samuel Holland <sam...@sholland.org>

Patch applied.

Yours,
Linus Walleij
Reply all
Reply to author
Forward
0 new messages