Skip to content

cpufreq: Auto-register with energy model

Viresh Kumar linux-arm-kernel linux-arm-msm linux-mediatek linux-omap linux-pm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 9 repliesIn review
  2. v18 patches 32 repliesSuperseded

Changes in v2 from the cover letter

- Add a callback instead of flag.
- Register before governor is initialized.
- Update scmi driver as well.
- Don't unregister from the EM core.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9cpufreq: Auto-register with energy model if askeddrivers/cpufreq/cpufreq.c include/linux/cpufreq.h+26 -02 replies
2/9cpufreq: dt: Use auto-registration for energy modeldrivers/cpufreq/cpufreq-dt.c+1 -20 replies
3/9cpufreq: imx6q: Use auto-registration for energy modeldrivers/cpufreq/imx6q-cpufreq.c+1 -10 replies
4/9cpufreq: mediatek: Use auto-registration for energy modeldrivers/cpufreq/mediatek-cpufreq.c+1 -20 replies
5/9cpufreq: omap: Use auto-registration for energy modeldrivers/cpufreq/omap-cpufreq.c+1 -10 replies
6/9cpufreq: qcom-cpufreq-hw: Use auto-registration for energy modeldrivers/cpufreq/qcom-cpufreq-hw.c+1 -20 replies
7/9cpufreq: scpi: Use auto-registration for energy modeldrivers/cpufreq/scpi-cpufreq.c+1 -20 replies
8/9cpufreq: vexpress: Use auto-registration for energy modeldrivers/cpufreq/vexpress-spc-cpufreq.c+1 -20 replies
9/9cpufreq: scmi: Use .register_em() callbackdrivers/cpufreq/scmi-cpufreq.c+32 -237 replies

Reviews trailers per patch

1 of 9 patches has a Reviewed-by or Acked-by.

PatchQuentin PerretLukasz Luba
1/9R-b R-b
2/9
3/9
4/9
5/9
6/9
7/9
8/9
9/9

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

Read the v2 thread

Cover letter [PATCH V2 0/9] cpufreq: Auto-register with energy model

Many cpufreq drivers register with the energy model for each policy and do exactly the same thing. Follow the footsteps of thermal-cooling, to get it done from the cpufreq core itself.

Provide a new callback, which will be called, if present, by the cpufreq core at the right moment (more on that in the code's comment). Also provide a generic implementation that uses dev_pm_opp_of_register_em().

This also allows us to register with the EM at a later point of time, compared to ->init(), from where the EM core can access cpufreq policy directly using cpufreq_cpu_get() type of helpers and perform other work, like marking few frequencies inefficient, this will be done separately.

This is build/boot tested by the bot for a couple of boards.

https://gitlab.com/vireshk/pmko/-/pipelines/351525873

Note that I haven't picked any of the Reviewed-by tags from the first version since the idea is very much changed here.

V1->V2:
- Add a callback instead of flag.
- Register before governor is initialized.
- Update scmi driver as well.
- Don't unregister from the EM core.

--
Viresh

Viresh Kumar (9):
cpufreq: Auto-register with energy model if asked
cpufreq: dt: Use auto-registration for energy model
cpufreq: imx6q: Use auto-registration for energy model
cpufreq: mediatek: Use auto-registration for energy model
cpufreq: omap: Use auto-registration for energy model
cpufreq: qcom-cpufreq-hw: Use auto-registration for energy model
cpufreq: scpi: Use auto-registration for energy model
cpufreq: vexpress: Use auto-registration for energy model
cpufreq: scmi: Use .register_em() callback

 drivers/cpufreq/cpufreq-dt.c           |  3 +-
 drivers/cpufreq/cpufreq.c              | 12 ++++++
 drivers/cpufreq/imx6q-cpufreq.c        |  2 +-
 drivers/cpufreq/mediatek-cpufreq.c     |  3 +-
 drivers/cpufreq/omap-cpufreq.c         |  2 +-
 drivers/cpufreq/qcom-cpufreq-hw.c      |  3 +-
 drivers/cpufreq/scmi-cpufreq.c         | 55 +++++++++++++++-----------
 drivers/cpufreq/scpi-cpufreq.c         |  3 +-
 drivers/cpufreq/vexpress-spc-cpufreq.c |  3 +-
 include/linux/cpufreq.h                | 14 +++++++
 10 files changed, 65 insertions(+), 35 deletions(-)
Signature · 1 line
2.31.1.272.g89b43f80a514