Skip to content

PM / devfreq: Add dev_pm_qos support

Leonard Crestez linux-arm-kernel linux-pm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 15 repliesIn review

Changes since v4 from the cover letter

* Move more devfreq_add_device init ahead of device_register.
* Make devfreq_dev_release cleanup devices not yet in devfreq_list. This is simpler than previous attempt to add to devfreq_list sonner.
* Take devfreq->lock in trans_stat_show
* Register dev_pm_opp notifier on devfreq parent dev (which has OPPs) Link to v4: https://patchwork.kernel.org/cover/11114657/

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8PM / devfreq: Lock devfreq in trans_stat_showdrivers/devfreq/devfreq.c+13 -43 replies
2/8PM / devfreq: Don't fail devfreq_dev_release if not in listdrivers/devfreq/devfreq.c+1 -51 reply
3/8PM / devfreq: Move more initialization before registrationdrivers/devfreq/devfreq.c+20 -184 replies
4/8PM / devfreq: Don't take lock in devfreq_add_devicedrivers/devfreq/devfreq.c+0 -101 reply
5/8PM / devfreq: Introduce devfreq_get_freq_rangedrivers/devfreq/devfreq.c+63 -481 reply
6/8PM / devfreq: Add dev_pm_qos supportdrivers/devfreq/devfreq.c include/linux/devfreq.h+76 -01 reply
7/8PM / devfreq: Use dev_pm_qos for sysfs min/max_freqdrivers/devfreq/devfreq.c include/linux/devfreq.h+38 -222 replies
8/8PM / devfreq: Move opp notifier registration to coredrivers/devfreq/devfreq.c drivers/devfreq/exynos-bus.c drivers/devfreq/rk3399_dmc.c +1 more+6 -992 replies

Reviews trailers per patch

4 of 8 patches have a Reviewed-by or Acked-by.

PatchMatthias Kaehlcke
1/8R-b
2/8R-b
3/8
4/8R-b
5/8R-b
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/8] PM / devfreq: Add dev_pm_qos support

Add dev_pm_qos notifiers to devfreq core in order to support frequency limits via dev_pm_qos_add_request.

Unlike the rest of devfreq the dev_pm_qos frequency is measured in Khz, this is consistent with current dev_pm_qos usage for cpufreq and allows frequencies above 2Ghz (pm_qos expresses limits as s32).

Like with cpufreq the handling of min_freq/max_freq is moved to the dev_pm_qos mechanism. Constraints from userspace are no longer clamped on store, instead all values can be written and we only check against OPPs in a new devfreq_get_freq_range function. This is consistent with the design of dev_pm_qos.

Notifiers from pm_qos are executed under a single global dev_pm_qos_mtx and need to take devfreq->lock. Notifier registration takes the same dev_pm_qos_mtx so in order to prevent lockdep warnings it must be done outside devfreq->lock. Current devfreq_add_device does *all* initialization under devfreq->lock and that needs to be relaxed.

---

Changes since v4:
* Move more devfreq_add_device init ahead of device_register.
* Make devfreq_dev_release cleanup devices not yet in devfreq_list. This is simpler than previous attempt to add to devfreq_list sonner.
* Take devfreq->lock in trans_stat_show
* Register dev_pm_opp notifier on devfreq parent dev (which has OPPs) Link to v4: https://patchwork.kernel.org/cover/11114657/

Changes since v3:
* Cleanup locking and error-handling in devfreq_add_device
* Register notifiers after device registration but before governor start
* Keep the initialization of min_req/max_req ahead of device_register because it's used for sysfs handling
* Use HZ_PER_KHZ instead of 1000
* Add kernel-doc comments
* Move OPP notifier to core
Link to v3: https://patchwork.kernel.org/cover/11104061/

Changes since v2:
* Handle sysfs via dev_pm_qos (in separate patch)
* Add locking to {min,max}_freq_show
* Fix checkpatch issues (long lines etc)
Link to v2: https://patchwork.kernel.org/patch/11084279/

Changes since v1:
* Add doxygen comments for min_nb/max_nb
* Remove notifiers on error/cleanup paths. Keep gotos simple by relying on dev_pm_qos_remove_notifier ignoring notifiers which were not added. Link to v1: https://patchwork.kernel.org/patch/11078475/

Leonard Crestez (8):
PM / devfreq: Lock devfreq in trans_stat_show
PM / devfreq: Don't fail devfreq_dev_release if not in list PM / devfreq: Move more initialization before registration PM / devfreq: Don't take lock in devfreq_add_device PM / devfreq: Introduce devfreq_get_freq_range
PM / devfreq: Add dev_pm_qos support
PM / devfreq: Use dev_pm_qos for sysfs min/max_freq PM / devfreq: Move opp notifier registration to core

 drivers/devfreq/devfreq.c    | 362 +++++++++++++++++++----------------
 drivers/devfreq/exynos-bus.c |   7 -
 drivers/devfreq/rk3399_dmc.c |   6 -
 include/linux/devfreq.h      |  22 +--
 4 files changed, 204 insertions(+), 193 deletions(-)
Signature · 1 line
2.17.1