Thread (41 messages) 41 messages, 4 authors, 2021-08-11

Re: [PATCH 0/8] cpufreq: Auto-register with energy model

From: Quentin Perret <hidden>
Date: 2021-08-11 09:48:51
Also in: linux-arm-kernel, linux-arm-msm, linux-mediatek, linux-omap, lkml

On Wednesday 11 Aug 2021 at 11:04:06 (+0530), Viresh Kumar wrote:
On 11-08-21, 10:48, Viresh Kumar wrote:
quoted
On 10-08-21, 13:35, Quentin Perret wrote:
quoted
This series adds more code than it removes,
Sadly yes :(
quoted
and the unregistration is
not a fix as we don't ever remove the EM tables by design, so not sure
either of these points are valid arguments.
I think that design needs to be looked over again, it looks broken to
me everytime I land onto this code. I wonder why we don't unregister
stuff.
Coming back to this series. We have two options, based on what I
proposed here:

https://lore.kernel.org/linux-pm/20210811050327.3yxrk4kqxjjwaztx@vireshk-i7/ (local)

1. Let cpufreq core register with EM on behalf of cpufreq drivers.
If we're going that route, I think we should allow _all_ possible
EM registration methods (via PM_OPP or else) to be done that way.
Otherwise we're creating an inconsitency in how the EM is registered
(e.g. from the ->init() cpufreq callback for some, or from cpufreq core
for others) which is problematic as we risk building features that
assume loading is done at a certain time, which won't work for some
platforms.
2. Update drivers to use ->ready() callback to do this stuff.
I think this should work, but perhaps will be a bit tricky for cpufreq
driver developers as they need to have a pretty good understanding of
the stack to know that they should do the registration from here and not
->init() for instance. Suggested alternative: we introduce a ->register_em()
callback to cpufreq_driver, and turn dev_pm_opp_of_register_em() into a
valid handler for this callback. This should 'document' things a bit
better, avoid some of the problems your other series tried to achieve, and
allow us to call the EM registration in exactly the right place from
cpufreq core. On the plus side, we could easily make this work for e.g.
the SCMI driver which would only need to provide its own version of
->register_em().

Thoughts?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help