linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Akshay Jindal <akshayaj.lkd@gmail.com>
Cc: anshulusr@gmail.com, jic23@kernel.org, dlechner@baylibre.com,
	 nuno.sa@analog.com, andy@kernel.org, shuah@kernel.org,
	 linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: light: ltr390: Add runtime PM support
Date: Sun, 24 Aug 2025 22:18:37 +0300	[thread overview]
Message-ID: <CAHp75Vd4V5o90q7-burt-S3_YnZ3bfaKXdFuTRcy05x0cvz8DA@mail.gmail.com> (raw)
In-Reply-To: <CAE3SzaSW7j0yNaD9yQzc5KcJ-LH00TGebLQYDkuqwjky3ZBohA@mail.gmail.com>

On Sat, Aug 23, 2025 at 12:10 PM Akshay Jindal <akshayaj.lkd@gmail.com> wrote:
> On Sat, Aug 23, 2025 at 1:41 AM Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > On Fri, Aug 22, 2025 at 9:03 PM Akshay Jindal <akshayaj.lkd@gmail.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

  parent reply	other threads:[~2025-08-24 19:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-22 18:03 [PATCH] iio: light: ltr390: Add runtime PM support Akshay Jindal
2025-08-22 20:11 ` Andy Shevchenko
     [not found]   ` <CAE3SzaSW7j0yNaD9yQzc5KcJ-LH00TGebLQYDkuqwjky3ZBohA@mail.gmail.com>
2025-08-24 19:18     ` Andy Shevchenko [this message]
2025-08-23 16:03 ` David Lechner
2025-08-25 14:26 ` Jonathan Cameron
2025-08-25 20:59   ` Akshay Jindal
2025-08-30 18:08     ` Jonathan Cameron
2025-08-30 19:49       ` Akshay Jindal
2025-08-31 15:08         ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHp75Vd4V5o90q7-burt-S3_YnZ3bfaKXdFuTRcy05x0cvz8DA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=akshayaj.lkd@gmail.com \
    --cc=andy@kernel.org \
    --cc=anshulusr@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).