Commit Graph

10 Commits

Author SHA1 Message Date
Jia-Wei Chang
cb0ff59972 ANDROID: cpufreq: add vendor hook in cpufreq_offline
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>
2022-12-21 10:45:13 +08:00
Todd Kjos
ecb7d6b106 ANDROID: remove inclusions from hook definition headers
To avoid changing the visibiliy of data types when including
hook definition headers remove header file inclusions from
the hook definition header files.

Instead, the hook definition headers should just have forward
declarations that don't require full definition.

To provide full definitions of the types for the KMI, the
headers that define the types should be included by the
source file that instantiates the hooks - normally
vendor_hooks.c.

Since the KMI is frozen, some of the inclusions are still
required to preserve the CRC associated with symbols. Keep
these inclusions under #ifdef __GENKSYMS__.

Bug: 233047575
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ibc1173eb4b07fcec21c7abd8e0ab1950b3fb5b34
2022-09-07 13:18:14 -07:00
zhengding chen
55f112e068 ANDROID: vendor_hooks: Add hooks for cpufreq_acct_update_power
We want to record the cputime of each running process by adding
hooks for cpufreq_acct_update_power.

Bug: 186604985

Signed-off-by: zhengding chen <chenzhengding@oppo.com>
Change-Id: I35e38be4680781df3338b4a01041922294aecaa0
(cherry picked from commit 3983753280987d68138ce249232b3d1b775ab1e6)
2022-08-29 22:44:45 +00:00
Saravana Kannan
0ef21e1c1a ANDROID: vendor_hooks: Reduce pointless modversions CRC churn
When vendor hooks are added to a file that previously didn't have any
vendor hooks, we end up indirectly including linux/tracepoint.h.  This
causes some data types that used to be opaque (forward declared) to the
code to become visible to the code.

Modversions correctly catches this change in visibility, but we don't
really care about the data types made visible when linux/tracepoint.h is
included. So, hide this from modversions in the central vendor_hooks.h file
instead of having to fix this on a case by case basis.

This change itself will cause a one time CRC breakage/churn because it's
fixing the existing vendor hook headers, but should reduce unnecessary CRC
churns in the future.

To avoid future pointless CRC churn, vendor hook header files that include
vendor_hooks.h should not include linux/tracepoint.h directly.

Bug: 227513263
Bug: 226140073
Signed-off-by: Saravana Kannan <saravanak@google.com>
Change-Id: Ia88e6af11dd94fe475c464eb30a6e5e1e24c938b
2022-04-06 08:31:36 -07:00
Liujie Xie
d5aece2586 ANDROID: vendor_hooks: Add hooks for frequency optimization
These hooks will do the following works:
a) Record the number of times when target_freq being clamped
b) Record the number of times when target_freq is greater than policy->cur
c) Make corresponding optimization strategies in different hooks
d) change the value of target_freq for some scenarios

Bug: 205906618
Bug: 206896672

Change-Id: I8eba66fd0c6d36393ca39045cf228b659834e0ae
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Signed-off-by: vincent.wang <vincent.wang@unisoc.com>
(cherry picked from commit 7e2fbdaeabb31251f42e38bed0ae0b660408f8e6)
(cherry picked from commit cf551f380a3c47894accfffc2c8b3d4547a60f9a)
2022-03-24 15:49:56 +00:00
Shaleen Agrawal
632bb51100 ANDROID: sched: add restricted hook to override show_cpufinfo_max_freq
Need to update to restricted hook since the module code registering for
this hook needs to take the task lock and walk over the linked
libraries.

Bug: 194431527
Change-Id: I7093b66f95c3b9c473386ade60d8897426ddbb13
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-10-14 23:21:14 +00:00
Pavankumar Kondeti
d723168991 ANDROID: cpufreq: Add a restricted vendor hook for freq transition
A restricted vendor hook for cpufreq transition. The hook is
invoked per policy after changing the policy->cur and passes
policy as an argument.

Bug: 181889516
Change-Id: I6f89850779fdd63e178e227c293f42b7f66fd78d
Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
2021-10-12 15:36:46 -07:00
Isaac J. Manjarres
ad5b9d3a9e ANDROID: Fix compilation error when CPU_FREQ is disabled
The following compilation error can be observed when CONFIG_CPU_FREQ
is disabled, while CONFIG_ANDROID_VENDOR_HOOKS is enabled:

include/trace/hooks/cpufreq.h:14:18: warning: declaration of 'struct
cpufreq_policy' will not be visible outside of this function
[-Wvisibility] error, forbidden warning: cpufreq.h:14.

Include the cpufreq header in the cpufreq trace hooks header to
fix the compilation error.

Bug: 181956431
Change-Id: I33ef6d91cfde856891d8cf7f345710f6b8c2c7ac
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
(cherry picked from commit 39fedc3a58f46a8aa8b35e451db9cea67126858a)
2021-03-23 17:13:28 +00:00
Todd Kjos
9e0cf0e90d ANDROID: simplify vendor hook definitions
Remove macro versions of hooks that are no longer needed. The
macro versions are still needed when the _rcuidle version
of the hook is used (as in include/trace/hooks/debug.h).

Bug: 177416721
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I4b50447e9a922ed038663d1459d7622dab30ffbb
2021-01-27 09:44:33 +00:00
Todd Kjos
efab334061 ANDROID: add vendor hooks to override show_cpufinfo_max_freq
QC value-add requires the ability to override the value displayed
by show_cpuinfo_max_freq.

Bug: 173984660
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ida11256f399f0730bc1228524b9687df3e7b8bf4
2020-11-23 21:01:12 +00:00