Re: [PATCHv2] gpio: mvebu: convert to noirq suspend/resume to prevent interrupt storm on resume

From: Linus Walleij

Date: Wed Sep 16 2026 - 09:44:25 EST


On Fri, Jul 10, 2026 at 9:07 AM Rosen Penev <rosenp@xxxxxxxxx> wrote:

> The driver uses the legacy .suspend/.resume callbacks, but sets
> IRQCHIP_MASK_ON_SUSPEND on the irq_chip. During resume, the PM core
> runs dpm_resume_noirq() first, which calls irq_pm_resume() to unmask
> interrupts, and only then runs dpm_resume() which invokes the driver's
> .resume callback to restore GPIO registers (GPIO_IN_POL, GPIO_IO_CONF,
> mask registers).
>
> This ordering means interrupts are unmasked while the hardware is still
> in its reset state, potentially with incorrect polarities, causing
> spurious level-triggered interrupts before local IRQs are re-enabled.
>
> Convert the driver from legacy .suspend/.resume callbacks to noirq
> callbacks via dev_pm_ops. The noirq phase runs before resume_device_irqs()
> on resume and after suspend_device_irqs() on suspend, ensuring GPIO
> registers are restored before interrupts are unmasked.
>
> Assisted-by: opencode:big-pickle

Should be
Assisted-by: LLM
these days (Bartosz can probs fix when applying)

> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>

Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij