Skip to content

Commit 02cd2d3

Browse files
claudiubezneageertu
authored andcommitted
pinctrl: renesas: rzg2l: Configure the interrupt type on resume
Commit dce0919 ("irqchip/renesas-rzg2l: Do not set TIEN and TINT source at the same time") removed the setup of TINT from rzg2l_irqc_irq_enable(). To address the spurious interrupt issue the setup of TINT has been moved in rzg2l_tint_set_edge() through rzg2l_disable_tint_and_set_tint_source(). With this, the interrupts are not properly re-configured after a suspend-to-RAM cycle. To address this issue and avoid spurious interrupts while resumming set the interrupt type before enabling it. Fixes: dce0919 ("irqchip/renesas-rzg2l: Do not set TIEN and TINT source at the same time") Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20240419063822.3467424-1-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent aa43c15 commit 02cd2d3

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

drivers/pinctrl/renesas/pinctrl-rzg2l.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,9 @@ static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl)
20452045

20462046
for (unsigned int i = 0; i < RZG2L_TINT_MAX_INTERRUPT; i++) {
20472047
struct irq_data *data;
2048+
unsigned long flags;
20482049
unsigned int virq;
2050+
int ret;
20492051

20502052
if (!pctrl->hwirq[i])
20512053
continue;
@@ -2063,17 +2065,18 @@ static void rzg2l_gpio_irq_restore(struct rzg2l_pinctrl *pctrl)
20632065
continue;
20642066
}
20652067

2066-
if (!irqd_irq_disabled(data)) {
2067-
unsigned long flags;
2068-
2069-
/*
2070-
* This has to be atomically executed to protect against a concurrent
2071-
* interrupt.
2072-
*/
2073-
raw_spin_lock_irqsave(&pctrl->lock.rlock, flags);
2068+
/*
2069+
* This has to be atomically executed to protect against a concurrent
2070+
* interrupt.
2071+
*/
2072+
raw_spin_lock_irqsave(&pctrl->lock.rlock, flags);
2073+
ret = rzg2l_gpio_irq_set_type(data, irqd_get_trigger_type(data));
2074+
if (!ret && !irqd_irq_disabled(data))
20742075
rzg2l_gpio_irq_enable(data);
2075-
raw_spin_unlock_irqrestore(&pctrl->lock.rlock, flags);
2076-
}
2076+
raw_spin_unlock_irqrestore(&pctrl->lock.rlock, flags);
2077+
2078+
if (ret)
2079+
dev_crit(pctrl->dev, "Failed to set IRQ type for virq=%u\n", virq);
20772080
}
20782081
}
20792082

0 commit comments

Comments
 (0)