[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vd4V5o90q7-burt-S3_YnZ3bfaKXdFuTRcy05x0cvz8DA@mail.gmail.com>
Date: Sun, 24 Aug 2025 22:18:37 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Akshay Jindal <akshayaj.lkd@...il.com>
Cc: anshulusr@...il.com, jic23@...nel.org, dlechner@...libre.com,
nuno.sa@...log.com, andy@...nel.org, shuah@...nel.org,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: light: ltr390: Add runtime PM support
On Sat, Aug 23, 2025 at 12:10 PM Akshay Jindal <akshayaj.lkd@...il.com> wrote:
> On Sat, Aug 23, 2025 at 1:41 AM Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> > On Fri, Aug 22, 2025 at 9:03 PM Akshay Jindal <akshayaj.lkd@...il.com> wrote:
...
> > >Ensure that interrupts continue to be delivered during
> > >runtime suspend by disabling the sensor only when no
> > >interrupts are enabled. This prevents loss of events
> > >while still allowing power savings when IRQs are unused.
> > >
> > Have you tried to enable it as a wake source and disable it?
>
> Yes, before coming onto this approach, I had given it a thought and hence did some R&D for this.
> Official documentation here & here talks about power.wakeup being an attribute for system wakeup
> NOT runtime. This checks out because in the complete IIO subsystem, there is not a single driver
> which implements both runtime PM and wakeup functionality.
> As of now there are 4 drivers in the whole of IIO, which enable this wakeup capability
> and that too are only using it in system_suspend callbacks. Hence I had to come up with this approach.
Please, make sure in the next version the summary of the above is
present in the commit message or comment block.
...
> > > + pm_runtime_mark_last_busy(dev);
> > > + pm_runtime_put_autosuspend(dev);
> >
> > mark_last_busy is redundant.
> >
> Pardon me here, but I am not able to see the redundancy.
> I think this should be very much there before we call _put_autosuspend which further calls
> autosuspend_expiration() which reads this last_busy field.
> Did you mean dev->power.last_busy is being updated elsewhere too? or something else?
> Can you please clarify?
https://elixir.bootlin.com/linux/v6.17-rc2/source/include/linux/pm_runtime.h#L603
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists