Add vendor hook in cpufreq_offline to block uevent pathway before cpufreq cooling unregister to prevent NETLINK broadcast waking up during suspend. The change is because android hardware health service will register epoll with EPOLLWAKEUP flag [1]. Afterwards, when suspend starts, NETLINK will hold the wakelock because the EPOLLWAKEUP flag registered from health service. One more key factor is the CAP_BLOCK_SUSPEND capability of health service [2] that may affect suspend flow as well. Currently only the patch [3] is available but not accepted in upstream. [1] https://android.googlesource.com/platform/hardware/interfaces/+/master/health/utils/libhealthloop/HealthLoop.cpp#69 [2] https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1461242 [3] https://patchwork.kernel.org/project/linux-pm/list/?series=658300&state=%2A&archive=both Bug: 260537724 Change-Id: Ifea4bff2d8fdc3b7e60e7f1cb7ec29a8d3c8771a Signed-off-by: Jia-Wei Chang <jia-wei.chang@mediatek.com>
56 lines
1.7 KiB
C
56 lines
1.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM cpufreq
|
|
|
|
#define TRACE_INCLUDE_PATH trace/hooks
|
|
|
|
#if !defined(_TRACE_HOOK_CPUFREQ_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_HOOK_CPUFREQ_H
|
|
#include <trace/hooks/vendor_hooks.h>
|
|
|
|
#ifdef __GENKSYMS__
|
|
#include <linux/cpufreq.h>
|
|
#endif
|
|
|
|
struct cpufreq_policy;
|
|
struct task_struct;
|
|
|
|
DECLARE_RESTRICTED_HOOK(android_rvh_show_max_freq,
|
|
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
|
|
TP_ARGS(policy, max_freq), 1);
|
|
|
|
DECLARE_HOOK(android_vh_freq_table_limits,
|
|
TP_PROTO(struct cpufreq_policy *policy, unsigned int min_freq,
|
|
unsigned int max_freq),
|
|
TP_ARGS(policy, min_freq, max_freq));
|
|
|
|
DECLARE_HOOK(android_vh_cpufreq_acct_update_power,
|
|
TP_PROTO(u64 cputime, struct task_struct *p, unsigned int state),
|
|
TP_ARGS(cputime, p, state));
|
|
|
|
DECLARE_RESTRICTED_HOOK(android_rvh_cpufreq_transition,
|
|
TP_PROTO(struct cpufreq_policy *policy),
|
|
TP_ARGS(policy), 1);
|
|
|
|
DECLARE_HOOK(android_vh_cpufreq_resolve_freq,
|
|
TP_PROTO(struct cpufreq_policy *policy, unsigned int *target_freq,
|
|
unsigned int old_target_freq),
|
|
TP_ARGS(policy, target_freq, old_target_freq));
|
|
|
|
DECLARE_HOOK(android_vh_cpufreq_fast_switch,
|
|
TP_PROTO(struct cpufreq_policy *policy, unsigned int *target_freq,
|
|
unsigned int old_target_freq),
|
|
TP_ARGS(policy, target_freq, old_target_freq));
|
|
|
|
DECLARE_HOOK(android_vh_cpufreq_target,
|
|
TP_PROTO(struct cpufreq_policy *policy, unsigned int *target_freq,
|
|
unsigned int old_target_freq),
|
|
TP_ARGS(policy, target_freq, old_target_freq));
|
|
|
|
DECLARE_HOOK(android_vh_cpufreq_offline,
|
|
TP_PROTO(struct device *dev, int val),
|
|
TP_ARGS(dev, val));
|
|
#endif /* _TRACE_HOOK_CPUFREQ_H */
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|