| From: |
| Viresh Kumar <viresh.kumar-AT-linaro.org> |
| To: |
| Rafael Wysocki <rjw-AT-rjwysocki.net>, Vincent Donnefort <vincent.donnefort-AT-arm.com>, lukasz.luba-AT-arm.com, Quentin Perret <qperret-AT-google.com>, Andy Gross <agross-AT-kernel.org>, Bjorn Andersson <bjorn.andersson-AT-linaro.org>, Cristian Marussi <cristian.marussi-AT-arm.com>, Fabio Estevam <festevam-AT-gmail.com>, Kevin Hilman <khilman-AT-kernel.org>, Matthias Brugger <matthias.bgg-AT-gmail.com>, NXP Linux Team <linux-imx-AT-nxp.com>, Pengutronix Kernel Team <kernel-AT-pengutronix.de>, Sascha Hauer <s.hauer-AT-pengutronix.de>, Shawn Guo <shawnguo-AT-kernel.org>, Sudeep Holla <sudeep.holla-AT-arm.com>, Viresh Kumar <viresh.kumar-AT-linaro.org> |
| Subject: |
| [PATCH V3 0/9] Add callback to register with energy model |
| Date: |
| Thu, 12 Aug 2021 10:05:13 +0530 |
| Message-ID: |
| <cover.1628742634.git.viresh.kumar@linaro.org> |
| Cc: |
| linux-pm-AT-vger.kernel.org, Vincent Guittot <vincent.guittot-AT-linaro.org>, linux-arm-kernel-AT-lists.infradead.org, linux-arm-msm-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, linux-mediatek-AT-lists.infradead.org, linux-omap-AT-vger.kernel.org |
| Archive-link: |
| Article |
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/351965580
FWIW, I have queued up the series for linux-next to get more testing, but your
reviews are welcome. Thanks.
V2->V3:
- Drop the auto-register part from all logs, this isn't called auto registration
anymore.
- Call register_em() only for new policies.
- Update scmi driver to register with EM only when required.
- Add Rby tags.
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: Add callback to register with energy model
cpufreq: dt: Use .register_em() to register with energy model
cpufreq: imx6q: Use .register_em() to register with energy model
cpufreq: mediatek: Use .register_em() to register with energy model
cpufreq: omap: Use .register_em() to register with energy model
cpufreq: qcom-cpufreq-hw: Use .register_em() to register with energy
model
cpufreq: scpi: Use .register_em() to register with energy model
cpufreq: vexpress: Use .register_em() to register with energy model
cpufreq: scmi: Use .register_em() to register with energy model
drivers/cpufreq/cpufreq-dt.c | 3 +-
drivers/cpufreq/cpufreq.c | 13 ++++++
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 | 65 +++++++++++++++++---------
drivers/cpufreq/scpi-cpufreq.c | 3 +-
drivers/cpufreq/vexpress-spc-cpufreq.c | 3 +-
include/linux/cpufreq.h | 14 ++++++
10 files changed, 76 insertions(+), 35 deletions(-)
--
2.31.1.272.g89b43f80a514