From: sashiko-bot@kernel.org
To: "Jakob Unterwurzacher" <jakobunt@gmail.com>
Cc: linux-input@vger.kernel.org, mfd@lists.linux.dev,
devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
dmitry.torokhov@gmail.com, lee@kernel.org
Subject: Re: [PATCH 2/4] mfd: rk8xx-core: keep the PMIC interrupt disabled during system suspend
Date: Thu, 29 Oct 2026 10:21:22 +0000 [thread overview]
Message-ID: <sashiko-outbox-189114@kernel.org> (raw)
In-Reply-To: <20261029-dev-tiger-v7-4-pre-20261028-tiger-suspend-b4-v1-2-cb12621c1fb4@cherry.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] mfd: rk8xx-core: disable_irq() in rk8xx_suspend() breaks s2idle wakeup
--
commit 1642fdff105aee2817fbf318588a972d4d3d49a4
Author: Jakob Unterwurzacher <jakob.unterwurzacher@cherry.de>
mfd: rk8xx-core: keep the PMIC interrupt disabled during system suspend
This commit disables the PMIC interrupt at the end of rk8xx_suspend() and
re-enables it at the start of rk8xx_resume() so that wakeup interrupts are
not handled before the parent bus controller has resumed.
> diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
> index 3dcf6abfda74f..3a68a7974ed06 100644
> --- a/drivers/mfd/rk8xx-core.c
> +++ b/drivers/mfd/rk8xx-core.c
[ ... ]
> @@ -929,7 +931,20 @@ int rk8xx_suspend(struct device *dev)
> break;
> }
>
> - return ret;
> + if (ret)
> + return ret;
> +
> + /*
> + * Keep the interrupt disabled while the bus to the PMIC may be
> + * suspended: otherwise a wakeup event (e.g. the power key) is handled
> + * as soon as interrupts are re-enabled on resume, before the bus has
> + * resumed, and reading/acking the interrupt status fails. If the
> + * interrupt is a wakeup source, it stays armed, and the pending event
> + * is replayed by enable_irq() on resume.
> + */
> + disable_irq(rk808->irq);
[Severity: High]
Does calling disable_irq(rk808->irq) in rk8xx_suspend() break wakeup from
suspend-to-idle (s2idle) on Rockchip platforms?
On Rockchip SoCs, the PMIC interrupt parent is the Rockchip GPIO irqchip in
drivers/gpio/gpio-rockchip.c, which implements rockchip_irq_disable() to mask
the pin in hardware and does not set the irqchip wakeup-on-suspend flag:
drivers/gpio/gpio-rockchip.c:rockchip_irq_disable() {
irq_gc_mask_set_bit(d);
}
When disable_irq(rk808->irq) runs during dpm_suspend() -> rk8xx_suspend(),
it invokes __disable_irq() -> irq_disable() -> __irq_disable() ->
rockchip_irq_disable(), masking the interrupt line in the GPIO int_mask
register and marking the descriptor disabled.
Later in dpm_suspend_noirq() -> suspend_device_irqs(),
kernel/irq/pm.c:suspend_device_irq() only re-enables a disabled wakeup
interrupt in the irqchip if that flag is set on the chip:
kernel/irq/pm.c:suspend_device_irq() {
if (irqd_is_wakeup_set(irqd)) {
irqd_set(irqd, IRQD_WAKEUP_ARMED);
if ((chipflags & IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND) &&
irqd_irq_disabled(irqd)) {
__enable_irq(desc);
irqd_set(irqd, IRQD_IRQ_ENABLED_ON_SUSPEND);
}
}
During suspend-to-RAM, syscore_suspend() subsequently runs irq_gc_suspend() ->
rockchip_irq_suspend(), which writes ~gc->wake_active to int_mask:
drivers/gpio/gpio-rockchip.c:rockchip_irq_suspend() {
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct rockchip_pin_bank *bank = gc->private;
bank->saved_masks = irq_reg_readl(gc, bank->gpio_regs->int_mask);
irq_reg_writel(gc, ~gc->wake_active, bank->gpio_regs->int_mask);
}
However, during suspend-to-idle, kernel/power/suspend.c:suspend_enter() enters
s2idle_loop() and jumps to Platform_wake without calling syscore_suspend():
kernel/power/suspend.c:suspend_enter() {
if (state == PM_SUSPEND_TO_IDLE) {
s2idle_loop();
goto Platform_wake;
}
}
Wouldn't that leave rk808->irq masked in the GPIO hardware throughout
s2idle_loop(), preventing the PMIC power key or RTC alarm from waking the
system from s2idle?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261029-dev-tiger-v7-4-pre-20261028-tiger-suspend-b4-v1-0-cb12621c1fb4@cherry.de?part=2
next prev parent reply other threads:[~2026-10-29 10:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 10:06 [PATCH 0/4] Suspend-to-RAM fixes for RK3588 + SPI-connected RK806 PMIC, enable PMIC sleep on RK3588 Tiger Jakob Unterwurzacher
2026-10-29 10:06 ` [PATCH 1/4] Input: rk805-pwrkey - enable the wakeup interrupt during system suspend Jakob Unterwurzacher
2026-10-29 10:06 ` [PATCH 2/4] mfd: rk8xx-core: keep the PMIC interrupt disabled " Jakob Unterwurzacher
2026-10-29 10:21 ` sashiko-bot [this message]
2026-10-29 10:06 ` [PATCH 3/4] mfd: rk8xx-spi: add system sleep PM ops Jakob Unterwurzacher
2026-10-29 10:06 ` [PATCH 4/4] arm64: dts: rockchip: put the PMIC into sleep mode in suspend on RK3588 Tiger Jakob Unterwurzacher
2026-10-29 19:31 ` [PATCH 0/4] Suspend-to-RAM fixes for RK3588 + SPI-connected RK806 PMIC, enable PMIC sleep " Quentin Schulz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-189114@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jakobunt@gmail.com \
--cc=lee@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox