Re: [PATCH v5 14/18] iio: magnetometer: ak8975: switch to using managed resources

From: Andy Shevchenko

Date: Thu May 07 2026 - 08:12:24 EST


On Thu, May 07, 2026 at 12:14:30PM +0200, Joshua Crofts wrote:
> On Thu, 7 May 2026 at 12:09, Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Thu, May 07, 2026 at 11:19:32AM +0200, Joshua Crofts wrote:
> > > On Wed, 6 May 2026 at 19:09, Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
> > > > On Tue, 05 May 2026 13:46:10 +0200
> > > > Joshua Crofts via B4 Relay <devnull+joshua.crofts1.gmail.com@xxxxxxxxxx> wrote:

...

> > > I'd just add pm_runtime_mark_last_busy() and pm_request_autosuspend() here
> > > to make the device suspend.
> >
> > pm_runtime_put_autosuspend() is exactly doing that in one call. That's what

(Okay, this should be read as "pm_request_autosuspend()".)

> > documentation says about, and that's correct, however it might be not so clear.
>
> Maybe I didn't look enough, but I couldn't find a definition of
> pm_runtime_put_autosuspend()
> that actually calls mark_last_busy().

Hmm... It's just there.

static inline int pm_runtime_put_autosuspend(struct device *dev)
{
pm_runtime_mark_last_busy(dev);
return __pm_runtime_put_autosuspend(dev);
}

Even in pm_request_autosuspend().

> Either way, it wouldn't hurt to add it manually, just to be sure?

Why? the whole point that it's not needed when autosuspend is in use.

--
With Best Regards,
Andy Shevchenko