Re: [PATCH] PM: runtime: Extend support for wakeirq for force_suspend|resume

From: Rafael J. Wysocki
Date: Fri Jul 08 2022 - 15:37:55 EST


On Tue, Jun 14, 2022 at 1:16 PM Tony Lindgren <tony@xxxxxxxxxxx> wrote:
>
> * Ulf Hansson <ulf.hansson@xxxxxxxxxx> [220608 15:26]:
> > A driver that makes use of pm_runtime_force_suspend|resume() to support
> > system suspend/resume, currently needs to manage the wakeirq support
> > itself. To avoid the boilerplate code in the driver's system suspend/resume
> > callbacks in particular, let's extend pm_runtime_force_suspend|resume() to
> > deal with the wakeirq.
>
> Looks good to me:
>
> Reviewed-by: Tony Lindgren <tony@xxxxxxxxxxx>

Applied (as 5.20 material), but there is still a quite fundamental
problem with pm_runtime_force_suspend|resume() which is using
RPM_GET_CALLBACK() in these functions, because that macro returns a
middle-layer PM-runtime callback, so any bus type or PM domain
implementing meaningful generic power management ends up calling its
own PM-runtime callback from its system-wide PM callback which is
super-confusing at best.

Another problem with them is that they are generally not suitable for
devices that can wake up the system from sleep.