Re: [PATCH] regmap-irq: Set IRQCHIP_MASK_ON_SUSPEND if no wake_base

From: Mark Brown
Date: Mon Jul 17 2023 - 17:06:06 EST


On Mon, Jul 17, 2023 at 02:54:18PM -0500, Samuel Holland wrote:

> The current problem is that if wakeup is enabled for any IRQ in the chip
> (say, the PMIC's power button), then we enable wakeup for the parent IRQ,
> and now suddenly all (enabled) IRQs on the PMIC are also inadvertently
> wakeup-enabled.

Yeah, I can see the issue.

> But I realize this patch does not actually solve the issue, for a couple
> of reasons:
> 1) regmap-irq does not implement .irq_mask, just .irq_disable.

It's possible we're doing the wrong thing here? It's been a decade or
something since I wrote this code.

> 2) The __disable_irq() call in suspend_device_irq() should be sufficient,
> except that we fail the irq_settings_is_nested_thread() check in
> suspend_device_irqs().

> So maybe the real issue is that commit 3c646f2c6aa9 ("genirq: Don't
> suspend nested_thread irqs over system suspend") missed the case where
> the child IRQ should be suspended, but the parent IRQ should not.

> If that is fixed, then suspend_device_irq() should do the right thing
> without any changes to the regmap-irq code.

> Sorry for the noise.

No worries, I can see the logic and it feels like there might be
something to look at here, I'm just not sure that's it.

Attachment: signature.asc
Description: PGP signature