Re: [PATCH 1/4] Input: rk805-pwrkey - enable the wakeup interrupt during system suspend
From: Dmitry Torokhov
Date: Sun Nov 22 2026 - 20:50:17 EST
Hi Jakob,
On Fri, Nov 20, 2026 at 02:42:57PM +0100, Jakob Unterwurzacher wrote:
> On 11/12/26 01:25, Dmitry Torokhov wrote:
...
> > Sounds like this needs to be solved in PM core rather than hacked around
> > in individual driver? Let's CC Tony and Rafael.
>
> How about something like this, copy-pasted below? If no immediate
> objections I'll post it as a proper patch.
>
> With this, rk805-pwrkey can use dev_pm_set_wake_irq with no issues
> (tested on RK3588-Tiger).
This approach makes sense to me (and matches what several I2C controller
drivers such as i2c-imx already do), though ultimately it is up to Mark
Brown to decide for SPI.
For rk805-pwrkey, please use devm_pm_set_wake_irq() in v2.
...
> > Take a runtime PM reference in the regular suspend phase and drop it on
> > resume. This keeps the controller usable until its noirq suspend
> > callback, and since it was active then, pm_runtime_force_resume()
> > restores it in the noirq resume phase, before interrupts of child
> > devices are handled again.
> >
> > Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@xxxxxxxxx>
Probably worth adding
Fixes: be721b451aff ("spi: rockchip: Resolve unbalanced runtime PM / system PM handling")
as well.
...
> > +/*
> > + * Child devices (e.g. an RK806 PMIC with its interrupt controller and wakeup
> > + * interrupts) can still need the bus during the late and noirq phases of
> > + * system suspend and resume, while runtime PM is disabled. Keep the controller
> > + * runtime-active from the regular suspend phase on, so that such transfers
> > + * work and pm_runtime_force_resume() restores the controller in the noirq
> > + * resume phase, before child device interrupts are handled again.
> > + */
One nit on the comment: rockchip_spi_isr() does not use IRQF_NO_SUSPEND
(and pl330 DMA suspends in the late phase), so arbitrary transfers in
child suspend_noirq()/resume_noirq() callbacks still will not work. What
this actually enables are PIO transfers in the late/early phases, during
device_wakeup_arm_wake_irqs() before device IRQs are suspended, and once
resume_device_irqs() re-enables them at the end of the noirq resume
phase. It might be worth wording the comment more precisely so nobody
assumes general noirq transfers are supported.
Thanks.
--
Dmitry