Re: [PATCH V3 0/9] Add callback to register with energy model

From: Dietmar Eggemann
Date: Tue Aug 31 2021 - 04:54:49 EST


On 12/08/2021 06:35, Viresh Kumar wrote:
> 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.

LGTM. Tested on TC2 (vexpress-spc), Juno-r0 (scpi-cpufreq and scmi).

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>