From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-iio <linux-iio@vger.kernel.org>,
Paul Cercueil <paul@crapouillou.net>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Biju Das <biju.das.jz@bp.renesas.com>,
Geert Uytterhoeven <geert+renesas@glider.be>
Subject: Re: [PATCH] iio: adc: rzg2l: Use RUNTIME_PM_OPS() instead of SET_*
Date: Sat, 20 Aug 2022 12:40:52 +0100 [thread overview]
Message-ID: <20220820124052.48d6686a@jic23-huawei> (raw)
In-Reply-To: <CAHp75VdgcJ96tg-XMHAricQc9Dti3+PKhFiOtSnCn45ehpoxJA@mail.gmail.com>
On Sun, 14 Aug 2022 22:12:59 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Sat, Aug 13, 2022 at 7:02 PM Jonathan Cameron <jic23@kernel.org> wrote:
> > On Mon, 8 Aug 2022 11:34:23 +0200
> > Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > > On Sun, Aug 7, 2022 at 9:11 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> > > > Here we could use DEFINE_RUNTIME_DEV_PM_OPS() but that would have the
> > > > side effect of providing suspend and resume support. That would be
> > > > harmless but also of little purpose as this driver does very simplistic
> > > > power management with synchronous power up and down around individual
> > > > channel reads.
> > > >
> > > > In general these new PM macros avoid the need to mark functions
> > > > __maybe_unused, whilst still allowing the compiler to remove them
> > > > if they are unused.
> > >
> > > ...
> > >
> > > > static const struct dev_pm_ops rzg2l_adc_pm_ops = {
> > > > - SET_RUNTIME_PM_OPS(rzg2l_adc_pm_runtime_suspend,
> > > > - rzg2l_adc_pm_runtime_resume,
> > > > - NULL)
> > > > + RUNTIME_PM_OPS(rzg2l_adc_pm_runtime_suspend,
> > > > + rzg2l_adc_pm_runtime_resume,
> > > > + NULL)
> > > > };
> > >
> > > DEFINE_RUNTIME_DEV_PM_OPS() ?
> > >
> > Disagreeing with the patch description argument on why I didn't do that?
> > The extra ops set will never have anything to do... Mostly harmless,
> > but kind of gives the wrong impression of what is going on in this
> > driver.
>
> As per thread with Paul, this patch has no function change intentions,
> but also, if tested on hardware, enabling system sleep states
> shouldn't be harmful.
>
This one is different from that case where there might be side effects.
Here the suspend and resume are (I think) guaranteed to have nothing
to do in all cases - because the driver does synchronous power
up and power down in all paths. So in all cases we are already in runtime
suspended state on a call to suspend.
Joanthan
next prev parent reply other threads:[~2022-08-20 11:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-07 19:07 [PATCH] iio: adc: rzg2l: Use RUNTIME_PM_OPS() instead of SET_* Jonathan Cameron
2022-08-08 9:34 ` Andy Shevchenko
2022-08-13 16:13 ` Jonathan Cameron
2022-08-14 19:12 ` Andy Shevchenko
2022-08-20 11:40 ` Jonathan Cameron [this message]
2023-01-28 18:06 ` 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=20220820124052.48d6686a@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy.shevchenko@gmail.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=linux-iio@vger.kernel.org \
--cc=paul@crapouillou.net \
/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).