lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220104214214.198843-1-paul@crapouillou.net>
Date:   Tue,  4 Jan 2022 21:42:06 +0000
From:   Paul Cercueil <paul@...pouillou.net>
To:     "Rafael J . Wysocki" <rafael@...nel.org>
Cc:     Ulf Hansson <ulf.hansson@...aro.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Linus Walleij <linus.walleij@...aro.org>,
        Arnd Bergmann <arnd@...db.de>, Len Brown <len.brown@...el.com>,
        Pavel Machek <pavel@....cz>, list@...ndingux.net,
        linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mips@...r.kernel.org, linux-mmc@...r.kernel.org,
        linux-pm@...r.kernel.org, Paul Cercueil <paul@...pouillou.net>
Subject: [PATCH 0/8] DEV_PM_OPS macros rework

Hi,

This set of commits rework a bit the *_DEV_PM_OPS() macros that were
introduced recently.

- Remove the DEFINE_UNIVERSAL_DEV_PM_OPS() macro, since I highly doubt
  anything is going to use it. The macro it replaces
  (UNIVERSAL_DEV_PM_OPS) seems to only be used incorrectly in code that
  hasn't been updated in ages.

- Remove the static qualifier in DEFINE_SIMPLE_DEV_PM_OPS, so that the
  macro is more in line with what's done elsewhere in the kernel.

- Add a DEFINE_RUNTIME_DEV_PM_OPS() macro, for use with drivers that use
  runtime PM, and use runtime_pm_force_suspend/runtime_pm_force_resume
  as their system sleep callbacks.

- Add EXPORT_*_DEV_PM_OPS macros, which can be used for when the
  underlying dev_pm_ops is to be exported. With CONFIG_PM set, the
  symbol is exported as you would expect. With CONFIG_PM disabled, the
  dev_pm_ops is garbage-collected along with the suspend/resume
  callbacks.

- Update the two places which used DEFINE_SIMPLE_DEV_PM_OPS, to add back
  the "static" qualifier that was stripped from the macro.

- Update one driver to use EXPORT_RUNTIME_DEV_PM_OPS(), just to showcase
  how to use this macro in the case where a dev_pm_ops is to be
  exported.
  Note that the driver itself is GPL, and the symbol is only used within
  a GPL driver, so I would assume the symbol would be exported as GPL.
  But it was not the case in the original code, so I did not change the
  behaviour.

Feedback welcome.

Cheers,
-Paul


Paul Cercueil (8):
  PM: core: Remove DEFINE_UNIVERSAL_DEV_PM_OPS() macro
  PM: core: Remove static qualifier in DEFINE_SIMPLE_DEV_PM_OPS macro
  PM: core: Add EXPORT[_GPL]_SIMPLE_DEV_PM_OPS macros
  PM: runtime: Add DEFINE_RUNTIME_DEV_PM_OPS() macro
  PM: runtime: Add EXPORT[_GPL]_RUNTIME_DEV_PM_OPS macros
  mmc: mxc: Make dev_pm_ops struct static
  mmc: jz4740: Make dev_pm_ops struct static
  iio: gyro: mpu3050: Use new PM macros

 drivers/iio/gyro/mpu3050-core.c | 13 +++-----
 drivers/iio/gyro/mpu3050-i2c.c  |  2 +-
 drivers/mmc/host/jz4740_mmc.c   |  4 +--
 drivers/mmc/host/mxcmmc.c       |  2 +-
 include/linux/pm.h              | 53 +++++++++++++++++++++++----------
 include/linux/pm_runtime.h      | 21 +++++++++++++
 6 files changed, 67 insertions(+), 28 deletions(-)

-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ