Re: [PATCH v2 3/5] PM: runtime: Propagate last_busy from dependent to dependency
From: Brian Norris
Date: Thu Nov 12 2026 - 11:50:37 EST
On Thu, Nov 12, 2026 at 05:13:09PM +0100, Rafael J. Wysocki (Intel) wrote:
> On Thu, Nov 12, 2026 at 1:24 AM Brian Norris <briannorris@xxxxxxxxxxxx> wrote:
> > I'll give this some time in case Rafael had any other thoughts/replies,
> > but unless something major changes, I'll plan to write/test/submit v3
> > where rpm_idle() calls pm_runtime_mark_last_busy() (part of Rafael's
> > proposal), and *not* make it conditional (i.e., no
> > pm_runtime_use_autosuspend_always()).
>
> That will work for me.
>
> > (Or, Rafael is free to do so, since it's his idea. Just let me know so I
> > don't waste my time on it. But I figure he'd rather someone else do the
> > work.)
>
> I can cut that patch. It is going to be a one-liner if I'm not
> mistaken and I'd like to write a changelog for it.
OK.
There's potentially quite a bit of follow-up, including patch 5 of this
series (to drop now-redundant .runtime_idle() callbacks), but I can roll
that separately if you'd like. (Would you want to make an immutable
branch for other subsystems to pick the 1-liner up? Or just apply such
patches to your tree, as it seems the IIO maintainer was probably OK
with that?)
I also feel like there's probably room for unit tests in this area, but
again, I can do that separately if they still seem valuable.
> After that patch though, using pm_runtime_mark_last_busy() elsewhere
> will be mostly redundant except for pm_runtime_*_autosuspend(). Since
> all of them call pm_runtime_mark_last_busy() (AFAICS), it looks like
> last_busy can be updated directly in rpm_suspend() when RPM_AUTO is
> passed to it, but if so, rpm_suspend() can simply set the autosuspend
> timer unless it is already running and so last_busy can be eliminated
> entirely. I guess that should be done too (in follow-up patches)?
__pm_runtime_put_autosuspend() still sticks out, but it's nearly gone.
Its only user is just re-implementinng pm_runtime_put_autosuspend(), so
obviously it doesn't actually make a difference. I've been waiting for
someone to finish this patch...
https://lore.kernel.org/all/20260806-smmu-rpm-v4-1-8183d007331c@xxxxxxxxxxxxxxxx/
So I think you may be correct.
> Moreover, after all of that the difference between pm_runtime_put()
> and pm_runtime_put_autosuspend() will become somewhat academic, so is
> the difference worth retaining? Or can we just say "If you set the
> autosuspend delay, all async suspends will be deferred" and drop the
> "autosuspend" variant?.
That's my preference. I think having so many put() variants hurts a lot
more than it helps, and especially so if the differences are nearly
nonexistent.
> I also have to say that I agree with your remarks regarding the
> .runtime_idle() callback. I don't think it has ever been particularly
> useful and life without it would have been simpler. I'd be happy to
> just get rid of it at one point.
Great! If a few other things settle, and I find that I'm able to clean
up my existing patches to my liking, then I hope to submit such patches
at a later time.
Brian