ANDROID: GKI: add a vendor hook in cpufreq_online

In this vendor hook, we can register the energy model before sending the
notification to avoid pd_init failure for some clusters.

more detail info about pd_init failure,  pls refer to the link: 
https://lore.kernel.org/lkml/20230118044733.29391-1-bhuwz@163.com/T/

But the change patch cannot be submitted upstream due to differences in the
cpufreq code, the failure only appears on the aosp kernel.

Bug: 312392542

Change-Id: Ied4c72d73083d794ad6d8af1eb305be4fb382de3
Signed-off-by: vincent wang <vincentwang3@lenovo.com>
This commit is contained in:
vincent wang
2023-11-21 17:38:28 +08:00
committed by Treehugger Robot
parent 2cecfa7378
commit 71647086d7
3 changed files with 7 additions and 0 deletions

View File

@@ -138,6 +138,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_freq_table_limits);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_resolve_freq);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_fast_switch);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_target);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_online);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_skip_swapcache_flags);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_gfp_zone_flags);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_readahead_gfp_mask);

View File

@@ -1443,6 +1443,8 @@ static int cpufreq_online(unsigned int cpu)
goto out_destroy_policy;
}
trace_android_vh_cpufreq_online(policy);
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
CPUFREQ_CREATE_POLICY, policy);
}

View File

@@ -39,6 +39,10 @@ DECLARE_HOOK(android_vh_cpufreq_target,
unsigned int old_target_freq),
TP_ARGS(policy, target_freq, old_target_freq));
DECLARE_HOOK(android_vh_cpufreq_online,
TP_PROTO(struct cpufreq_policy *policy),
TP_ARGS(policy));
#endif /* _TRACE_HOOK_CPUFREQ_H */
/* This part must be outside protection */
#include <trace/define_trace.h>