From: Paul Cercueil <paul@crapouillou.net>
To: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
linux-iio@vger.kernel.org,
"Rafael J . Wysocki" <rafael@kernel.org>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Tomasz Duszynski <tomasz.duszynski@octakon.com>
Subject: Re: [PATCH 0/8] IIO: Where dev_pm_ops rework and namespaces meet.
Date: Wed, 23 Feb 2022 13:14:29 +0000 [thread overview]
Message-ID: <54ER7R.R3NHXV9BWTRL3@crapouillou.net> (raw)
In-Reply-To: <20220223121341.0000089b@Huawei.com>
Le mer., févr. 23 2022 at 12:13:41 +0000, Jonathan Cameron
<Jonathan.Cameron@Huawei.com> a écrit :
> On Wed, 23 Feb 2022 11:50:48 +0000
> Paul Cercueil <paul@crapouillou.net> wrote:
>
>> Hi Jonathan,
>>
>> Le dim., févr. 20 2022 at 18:15:14 +0000, Jonathan Cameron
>> <jic23@kernel.org> a écrit :
>> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>> >
>> > Hi All,
>> >
>> > As these two activities have been ongoing across IIO at the same
>> time
>> > it was inevitable that there would be drivers were they both
>> interact.
>> > In particularly when we have EXPORT* of struct dev_pm_ops.
>> >
>> > This series covers those cases by introducing (in patch 2)
>> > EXPORT_NS[_GPL]_SIMPLE_DEV_PM_OPS() and
>> > EXPORT_NS[_GPL]_RUNTIME_DEV_PM_OPS()
>> > that add a namespace as the final parameter.
>>
>> If we now have namespace versions of the macros, I'm starting to
>> wonder
>> if the original macros are still useful.
>>
>> In which case would we need to export a dev_pm_ops outside the
>> scope of
>> a namespace?
>
> Excellent point. Long term my assumption is that any place where
> a dev_pm_ops is being exported probably should be in a namespace
> because the scope is tightly defined.
>
> My only thought is it adds a burden to moving over to your new
> infrastructure
> as it would be odd to move only the dev_pm_ops into a NS without
> looking
> at the rest of the exports in a driver.
>
> It was useful to be able to do things in two steps as it allowed
> separation
> of using the new dev_pm_ops handling from a namespace move, but
> clearly could do that the other way around and not need the non
> namespaced version of this macro.
> So do namespace move first then use the new macros and hence only
> ever need the namespaced one.
I'd be slightly in favor of enforcing namespaces in the PM macros, if
only to simplify the macro names (as you could just extend the existing
ones to require a namespace, I don't think anything use them yet).
But I'm fine with keeping the non-namespaced macros as well if it's
easier. We can always drop them later.
Cheers,
-Paul
> Jonathan
>
>
>>
>> Cheers,
>> -Paul
>>
>> > In each driver (with the exception of the kxsd9 which was already
>> > using a IIO_KXSD9 namespace) I first move to the new *_PM_OPS()
>> > and pm_[sleep_]_ptr() then in a second patch move to the new
>> > namespaces. Initially I had these two steps done as one patch
>> > per driver but that was harder to follow and broke the rule of
>> > one thing per patch.
>> >
>> > All comments welcome.
>> >
>> > Thanks,
>> >
>> > Jonathan
>> >
>> > Jonathan Cameron (8):
>> > iio: chemical: scd30: Export dev_pm_ops instead of suspend() and
>> > resume()
>> > PM: core: Add NS varients of EXPORT[_GPL]_SIMPLE_DEV_PM_OPS and
>> > runtime pm equiv
>> > iio: chemical: scd30: Move symbol exports into IIO_SCD30
>> namespace
>> > iio:accel:kxsd9: Switch from CONFIG_PM guards to pm_ptr() etc
>> > iio: humidity: hts221: Use EXPORT_SIMPLE_DEV_PM_OPS() to allow
>> > compiler to remove dead code.
>> > iio: humidity: hts221: Move symbol exports into IIO_HTS221
>> namespace
>> > iio: imu: lsm6dsx: Use new pm_sleep_ptr() and
>> > EXPORT_SIMPLE_DEV_PM_OPS()
>> > iio: imu: lsm6dsx: Move exported symbols to the IIO_LSM6DSX
>> > namespace
>> >
>> > drivers/iio/accel/kxsd9-i2c.c | 2 +-
>> > drivers/iio/accel/kxsd9-spi.c | 2 +-
>> > drivers/iio/accel/kxsd9.c | 11 ++---------
>> > drivers/iio/chemical/scd30.h | 5 +----
>> > drivers/iio/chemical/scd30_core.c | 10 +++++-----
>> > drivers/iio/chemical/scd30_i2c.c | 3 ++-
>> > drivers/iio/chemical/scd30_serial.c | 3 ++-
>> > drivers/iio/humidity/hts221_core.c | 12 +++++-------
>> > drivers/iio/humidity/hts221_i2c.c | 3 ++-
>> > drivers/iio/humidity/hts221_spi.c | 3 ++-
>> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 12 +++++-------
>> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c | 3 ++-
>> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i3c.c | 3 ++-
>> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c | 3 ++-
>> > include/linux/pm.h | 14 +++++++++-----
>> > include/linux/pm_runtime.h | 10 ++++++++--
>> > 16 files changed, 51 insertions(+), 48 deletions(-)
>> >
>> > --
>> > 2.35.1
>> >
>>
>>
>
prev parent reply other threads:[~2022-02-23 13:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-20 18:15 [PATCH 0/8] IIO: Where dev_pm_ops rework and namespaces meet Jonathan Cameron
2022-02-20 18:15 ` [PATCH 1/8] iio: chemical: scd30: Export dev_pm_ops instead of suspend() and resume() Jonathan Cameron
2022-02-20 18:15 ` [PATCH 2/8] PM: core: Add NS varients of EXPORT[_GPL]_SIMPLE_DEV_PM_OPS and runtime pm equiv Jonathan Cameron
2022-02-21 19:37 ` Rafael J. Wysocki
2022-02-27 11:46 ` Jonathan Cameron
2022-02-28 20:13 ` Rafael J. Wysocki
2022-03-01 11:31 ` Jonathan Cameron
2022-03-30 12:30 ` Jonathan Cameron
2022-03-31 17:21 ` Rafael J. Wysocki
2022-04-01 14:06 ` Jonathan Cameron
2022-02-20 18:15 ` [PATCH 3/8] iio: chemical: scd30: Move symbol exports into IIO_SCD30 namespace Jonathan Cameron
2022-02-20 18:15 ` [PATCH 4/8] iio:accel:kxsd9: Switch from CONFIG_PM guards to pm_ptr() etc Jonathan Cameron
2022-02-20 18:15 ` [PATCH 5/8] iio: humidity: hts221: Use EXPORT_SIMPLE_DEV_PM_OPS() to allow compiler to remove dead code Jonathan Cameron
2022-02-20 18:15 ` [PATCH 6/8] iio: humidity: hts221: Move symbol exports into IIO_HTS221 namespace Jonathan Cameron
2022-02-20 18:15 ` [PATCH 7/8] iio: imu: lsm6dsx: Use new pm_sleep_ptr() and EXPORT_SIMPLE_DEV_PM_OPS() Jonathan Cameron
2022-02-20 18:15 ` [PATCH 8/8] iio: imu: lsm6dsx: Move exported symbols to the IIO_LSM6DSX namespace Jonathan Cameron
2022-02-23 11:50 ` [PATCH 0/8] IIO: Where dev_pm_ops rework and namespaces meet Paul Cercueil
2022-02-23 12:13 ` Jonathan Cameron
2022-02-23 13:14 ` Paul Cercueil [this message]
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=54ER7R.R3NHXV9BWTRL3@crapouillou.net \
--to=paul@crapouillou.net \
--cc=Jonathan.Cameron@Huawei.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=rafael@kernel.org \
--cc=tomasz.duszynski@octakon.com \
/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