Re: [PATCH] bus: simple-pm-bus: fix forced runtime PM use

From: Johan Hovold
Date: Fri Feb 14 2025 - 07:55:33 EST


On Fri, Feb 14, 2025 at 01:36:48PM +0100, Ulf Hansson wrote:
> On Fri, 14 Feb 2025 at 11:21, Johan Hovold <johan+linaro@xxxxxxxxxx> wrote:
> >
> > The simple-pm-bus driver only enables runtime PM for some buses
> > ('simple-pm-bus') yet has started calling pm_runtime_force_suspend() and
> > pm_runtime_force_resume() during system suspend unconditionally.
> >
> > This currently works, but that is not obvious and depends on
> > implementation details which may change at some point.
> >
> > Add dedicated system sleep ops and only call pm_runtime_force_suspend()
> > and pm_runtime_force_resume() for buses that use runtime PM to avoid any
> > future surprises.
> >
> > Fixes: c45839309c3d ("drivers: bus: simple-pm-bus: Use clocks")
>
> This doesn't look like it is needed to me. It isn't broken, right?

I didn't add a CC stable tag since this currently works, but I still
consider it a bug to call these helpers unconditionally when not using
runtime PM.

[ And during rc1 these callbacks were suddenly called and triggered a
NULL-pointer dereference as you know. [1] ]

Johan

[1] https://lore.kernel.org/lkml/Z6YcjFBWAVVVANf2@xxxxxxxxxxxxxxxxxxxx/