UPSTREAM: arm64: topology: Make AMUs work with modular cpufreq drivers
The AMU counters won't get used today if the cpufreq driver is built as a module as the amu core requires everything to be ready by late init. Fix that properly by registering for cpufreq policy notifier. Note that the amu core don't have any cpufreq dependency after the first time CPUFREQ_CREATE_POLICY notifier is called for all the CPUs. And so we don't need to do anything on the CPUFREQ_REMOVE_POLICY notifier. And for the same reason we check if the CPUs are already parsed in the beginning of amu_fie_setup() and skip if that is true. Alternatively we can shoot a work from there to unregister the notifier instead, but that seemed too much instead of this simple check. While at it, convert the print message to pr_debug instead of pr_info. Signed-off-by:Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by:
Ionela Voinescu <ionela.voinescu@arm.com> Tested-by:
Ionela Voinescu <ionela.voinescu@arm.com> Link: https://lore.kernel.org/r/89c1921334443e133c9c8791b4693607d65ed9f5.1610104461.git.viresh.kumar@linaro.org Signed-off-by:
Will Deacon <will@kernel.org> (cherry picked from commit a5f1b187) BUG=b:249685960 TEST=Build Change-Id: I10d18ae86942d196f41d68e71e53ce4cb1aef6e6 Signed-off-by:
Masami Hiramatsu <mhiramat@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3939332 Reviewed-by:
Sean Paul <sean@poorly.run> Reviewed-by:
Suleiman Souhlal <suleiman@chromium.org>
Loading
Please sign in to comment