ANDROID: scmi_cpufreq: Add restricted vendor hook for scmi_limit_notify_cb
Include a restricted vendor hook to allow vendor modules to modify thermal updates under scmi notifications. Bug: 436290872 Change-Id: I57e33ea44b66986058008ac83737524a8c31aec0 Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
This commit is contained in:
committed by
John Stultz
parent
052da8f4d4
commit
a475a3d8e5
@@ -610,3 +610,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_migrate_one_page);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_remove_migration_pte_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_split_huge_page_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_try_split_folio_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_scmi_limit_notify_cb);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <linux/scmi_protocol.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/units.h>
|
||||
#include <trace/hooks/cpufreq.h>
|
||||
|
||||
struct scmi_data {
|
||||
int domain_id;
|
||||
@@ -188,11 +189,15 @@ static int scmi_limit_notify_cb(struct notifier_block *nb, unsigned long event,
|
||||
struct scmi_data *priv = container_of(nb, struct scmi_data, limit_notify_nb);
|
||||
struct scmi_perf_limits_report *limit_notify = data;
|
||||
unsigned int limit_freq_khz;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
bool done;
|
||||
|
||||
limit_freq_khz = limit_notify->range_max_freq / HZ_PER_KHZ;
|
||||
|
||||
ret = freq_qos_update_request(&priv->limits_freq_req, limit_freq_khz);
|
||||
trace_android_rvh_scmi_limit_notify_cb(&done, priv->cpu_dev, limit_freq_khz);
|
||||
if (done)
|
||||
return NOTIFY_OK;
|
||||
|
||||
if (ret < 0)
|
||||
pr_warn("failed to update freq constraint: %d\n", ret);
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
struct cpufreq_policy;
|
||||
struct device;
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_show_max_freq,
|
||||
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
|
||||
@@ -42,6 +43,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_cpufreq_transition,
|
||||
TP_PROTO(struct cpufreq_policy *policy),
|
||||
TP_ARGS(policy), 1);
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_scmi_limit_notify_cb,
|
||||
TP_PROTO(bool *done, struct device *cpu_dev, unsigned int limit_freq_khz),
|
||||
TP_ARGS(done, cpu_dev, limit_freq_khz), 1);
|
||||
|
||||
#endif /* _TRACE_HOOK_CPUFREQ_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
|
||||
Reference in New Issue
Block a user