Re: [PATCH] mfd: intel_soc_pmic_crc: balance IRQ wake enable
From: Andy Shevchenko
Date: Mon Sep 14 2026 - 04:33:16 EST
On Sat, Sep 12, 2026 at 09:36:15PM -0400, Myeonghun Pak wrote:
> The INT33FD Crystal Cove driver enables the parent IRQ as a wake source
> after registering its regmap IRQ chip. When that succeeds, a later
> mfd_add_devices() failure or driver removal leaves the wake enable
> unbalanced.
>
> Register a managed action only after enable_irq_wake() succeeds. Since
> the action is registered after the managed regmap IRQ chip, reverse devres
> order disables IRQ wake before tearing down the IRQ chip. Keep warning and
> continuing when enable_irq_wake() itself fails.
>
> This is limited to the Bay Trail and Cherry Trail Crystal Cove PMIC
> variants using the INT33FD ACPI ID.
>
> This issue was identified during our ongoing static-analysis research while
> reviewing kernel code.
...
> Assisted-by: OpenAI:GPT-5.6
Assisted-by: LLM
...
> ret = enable_irq_wake(pmic->irq);
> - if (ret)
> + if (ret) {
> dev_warn(dev, "Can't enable IRQ as wake source: %d\n", ret);
> + } else {
> + ret = devm_add_action_or_reset(dev,
> + crystal_cove_disable_irq_wake, pmic);
Make it a single line.
> + if (ret)
> + return ret;
> + }
Shouldn't disable_irq_wake() be called at .shutdown() as well?
--
With Best Regards,
Andy Shevchenko