Commit Graph

313 Commits

Author SHA1 Message Date
Eddie Huang
afa76a1c3a ANDROID: scsi: ufs: Improve MCQ error handling
Changes
- Add new android vendor hook: android_vh_ufs_mcq_retry_complete()
- Retry mcq complete on reset in error handling flow
- Check mcq oustanding reqs instead of DB reg under MCQ mode

Bug: 248447556
Change-Id: Ie658edcef0f9b155eefb4462c99f40557cb64c68
Signed-off-by: Po-Wen Kao <powen.kao@mediatek.com>
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
2022-09-26 18:24:05 +00:00
xiaofeng
2ecf8fb58d ANDROID: vendor_hooks:vendor hook for mmput
add vendor hook in mmput while mm_users decreased to 0.

Bug: 238821038
Bug: 248221914
Change-Id: I42a717cbeeb3176bac14b4b2391fdb2366c972d3
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2022-09-26 12:37:17 +00:00
xiaofeng
9d557fbd5a ANDROID: vendor_hooks:vendor hook for __alloc_pages_slowpath.
add vendor hook in __alloc_pages_slowpath ahead of
__alloc_pages_direct_reclaim and warn_alloc.

Bug: 243629905
Bug: 248236877
Change-Id: Ieacc6cf79823c0bfacfdeec9afb55ed66f40d0b0
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2022-09-26 12:37:17 +00:00
qizhong cheng
a89fbc0de0 ANDROID: fix add vendor hooks for unusual abort cases
Add hooks to check the do_serror can be recover or not.
When PCIe encounters completion timeout, PCIe hardware will
reply slave error to bus, which will causes the system to panic.

Bug: 247846368

Signed-off-by: qizhong cheng <qizhong.cheng@mediatek.com>
Change-Id: Iaef6c9a6ac07e552939c0f8e386213cb930cfb6e
2022-09-23 21:05:40 +00:00
xiaofeng
b9f272d887 ANDROID: vendor_hooks:vendor hook for mmput
add vendor hook in mmput while mm_users decreased to 0.

Bug: 238821038
Change-Id: I42a717cbeeb3176bac14b4b2391fdb2366c972d3
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2022-09-08 17:51:10 +00:00
Todd Kjos
5dc0a0bd6b ANDROID: remove CONFIG_TRACEPOINTS from hook definition headers
Remove the obsolete use of CONFIG_TRACEPOINTS in hook definition
header files. The !CONFIG_TRACEPOINTS case is correctly handled
by the included trace header files.

Bug: 233047575
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I957649bcfef375284f2885cf732ff2960c303837
2022-09-07 13:25:46 -07: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
Chiawei Wang
fb2bb8f3ad ANDROID: mm: Add vendor hook in rmqueue()
Add a vendor hook for costly order page counting
and other vendor specific functions.

Bug: 174521902
Bug: 172987241
Bug: 244409558
Signed-off-by: Chiawei Wang <chiaweiwang@google.com>
Signed-off-by: Oven <liyangouwen1@oppo.com>
Change-Id: I89206727a462548cc3500b695d85c83ff003eec7
(cherry picked from commit 369de3780428a17e9afece2f5747f03619d589b6)
2022-09-02 20:54:45 +00:00
Todd Kjos
e6c826aa9b ANDROID: reduce number of opaque structs in KMI
Change how vendor hooks are instantiated to promote
more complete structure definition in the ABI XML
description without complicating hook definition for
partners.

We don't want to force partners to include all
headers as part of the hook definition in include/trace/hooks/
since that causes extra headers to be included in
source files that runs the risk of changing visibility
resulting in CRC changes to KMI symbols. Instead continue
the practice of using forward declarations in the hook
header files.

Instead of instantiating hook tracepoints globally in
drivers/android/vendor_hooks.c, use subsystem-specific
vendor_hooks.c. This avoids namespace collisions between
internal header files and limits the exposure to the internal
headers to the instantiation, not the call sites.

In this patch, all of the scheduler related hooks are
instantiated in kernel/sched/vendor_hooks.c which can
cleanly include scheduler-related header files to
provide full type visibility.

Since this is being done on a KMI frozen branch, there
are some __GENKSYMS__ tricks needed to preserve the
existing CRC as we increase the number of fully typed
structs. These tricks won't be needed when this is
introduced on a non-KMI-frozen branch.

With this patch, the number of undefined types was
reduced from 108 to 68.

Bug: 233047575
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ife5a66c2968de73e3f6d05840411310611e2e175
2022-08-30 17:31:23 +00:00
zhouhuacai
0226fc2e18 ANDROID: vendor_hooks: tune reclaim inactive ratio
Add hooks to apply oem's memory reclaim optimization

Bug: 186669330
Change-Id: I9a1c713bf3eea2823b2758ee44284a244b1ca7a1
Signed-off-by: zhouhuacai <zhouohuacai@oppo.com>
Signed-off-by: Oven <liyangouwen1@oppo.com>
(cherry picked from commit 577f73412f579ef493e8e67795b3fd93f1a47dfd)
2022-08-30 17:17:32 +00: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
xieliujie
cc724041ce ANDROID: vendor_hooks: Add hooks for oem futex optimization
If an important task is going to sleep through do_futex(),
find out it's futex-owner by the pid comes from userspace,
and boost the owner by some means to shorten the sleep time.
How to boost? Depends on these hooks:
commit 53e809978443 ("ANDROID: vendor_hooks: Add hooks for scheduler")

Bug: 243110112
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I9a315cfb414fd34e0ef7a2cf9d57df50d4dd984f
(cherry picked from commit 548da5d23d98b796cf9a478675622a606b3307c8)
2022-08-29 16:57:50 +00:00
xiaofeng
0312e9cd22 ANDROID: vendor_hooks:vendor hook for __alloc_pages_slowpath.
add vendor hook in __alloc_pages_slowpath ahead of
__alloc_pages_direct_reclaim and warn_alloc.

Bug: 243629905
Change-Id: Ieacc6cf79823c0bfacfdeec9afb55ed66f40d0b0
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2022-08-24 22:16:36 +00:00
Aran Dalton
5dc0125847 ANDROID: vendor_hooks: Add hooks for page_cache_sync_ra
Add hooks to modify the policy of page_cache_sync_ra for oem's optimization
of synchronous readahead.

Bug: 243477375

Signed-off-by: Aran Dalton <arda@allwinnertech.com>
Change-Id: Ic3397d26e58d2d1189d9db25914c2f3d95c69226
2022-08-23 19:34:18 +00:00
xieliujie
a60c2d4f12 ANDROID: vendor_hooks: Add hooks for ipa
Add hooks to support oem's thermal feature.

Bug: 242662879

Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I4731948e92e9becb2dbd1f13851b7f849dcfd57c
2022-08-19 16:07:28 +00:00
Wenchao Chen
e956d16bc2 ANDROID: GKI: add restricted vendor hook for mmc
We need to add three restricted vendor hooks to implement mmc protection
and support sd card hs mode tuning.

If you are using a function that needs to sleep, then use the restricted
vendor hook.
- android_rvh_mmc_partition_status
- android_rvh_mmc_sd_cmdline_timing
- android_rvh_mmc_sd_dataline_timing

If you're using functions that don't sleep, then use vendor hooks.
- android_vh_mmc_update_partition_status
- android_vh_mmc_sd_update_cmdline_timing
- android_vh_mmc_sd_update_dataline_timing

Bug: 242645760
Change-Id: I880436e3159bec30d7d92c620b268ec350e97235
Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
2022-08-19 15:49:31 +00:00
davidwang
fc9630b3cb ANDROID: vendor_hooks: add vendor hook for dma_heap_buffer_alloc
Add android_vh_dmabuf_heap_flags_validation vh for
heap flags with vendor valid check.

Bug: 241733930
Signed-off-by: davidwang <davidwang@realtek.com>
Change-Id: I5c1c111b8231a05f733bc56bda34bc408e708554
2022-08-19 15:19:36 +00:00
Peifeng Li
f729494767 ANDROID: vendor_hook: add hooks to protect locking-tsk in cpu scheduler
Providing vendor hooks to record the start time of holding the lock, which
protects rwsem/mutex locking-process from being preemptedfor a short time
in some cases.

- android_vh_record_mutex_lock_starttime
- android_vh_record_rtmutex_lock_starttime
- android_vh_record_rwsem_lock_starttime
- android_vh_record_percpu_rwsem_lock_starttime

Bug: 241191475

Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
Change-Id: I0e967a1e8b77c32a1ad588acd54028fae2f90c4e
2022-08-19 09:26:28 +00:00
Todd Kjos
1f925159e2 ANDROID: fix kernelci issue: visibility of struct cgroup_subsys
Kernelci reported:
include/trace/hooks/cgroup.h:27:18: error: declaration of 'struct cgroup_subsys'
will not be visible outside of this function

Fixes: 2487db8d59 ("ANDROID: freezer: Add vendor hook to freezer for GKI
purpose.")
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I7678fc03df6593ca42f2043f33ec3c3fee8d362b
2022-08-18 19:33:23 +00:00
Peifeng Li
309a6bf81a ANDROID: vendor_hook: Add hook to not be stuck ro rmap lock in kswapd or direct_reclaim
Add hooks to support trylock in rmaplock when reclaiming in kswapd or
direct_reclaim, in order to avoid wait lock for a long time.

- android_vh_handle_failed_page_trylock
- android_vh_page_trylock_set
- android_vh_page_trylock_clear
- android_vh_page_trylock_get_result
- android_vh_do_page_trylock

Bug: 240003372

Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
Change-Id: I0f605b35ae41f15b3ca7bc72cd5f003175c318a5
2022-08-16 15:13:18 +08:00
heshuai1
2487db8d59 ANDROID: freezer: Add vendor hook to freezer for GKI purpose.
Add the vendor hook to freezer.c, because of some special cases related to our feature, we do not want the process to be frozen immediately, so we add the hook at __refrigerator to make sure we can go to our own freeze logic when the process is about to be frozen.

Bug: 187458531

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: Iea42fd9604d6b33ccd6502425416f0dd28eecebb
(cherry picked from commit a1580311c36ca28344b2f03b3c8a72d9f8db5bde)
2022-08-15 18:32:23 +00:00
heshuai1
9ac0923ef5 ANDROID: user: Add vendor hook to user for GKI purpose
Add the vendor hook to user.c, because of some speical cases related to
our feature, we need to initialize the variables defined by ourselves in
user_struct, so we add the hook at alloc_uid to make sure we can go to
our own logic when the user_struct is about to initialize.

Bug: 187458531

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: I078484aac2c3d396aba5971d6d0f491652f3781c
(cherry picked from commit c9b8fa644f45e9c99da85d8947f6c7e06771f205)
2022-08-15 18:19:32 +00:00
Zhenxiong Lai
6349c3bbd5 ANDROID: GKI: add vendor hook to support emmc FFU
We need this vendor hook to support emmc FFU. Avoid init card fail
due to changes in PRV of cid in the new firmware.

Bug: 241854943
Change-Id: Ib92105264daabedcb68aa99d0b4c0d45b5b741b1
Signed-off-by: Zhenxiong Lai <zhenxiong.lai@unisoc.com>
2022-08-12 19:28:51 +00:00
Peifeng Li
ce8b55bb08 ANDROID: vendor_hooks: protect multi-mapcount pages in kernel
Support two hooks as follows to protect multi-mapcount pages in kernel:

- trace_android_vh_page_should_be_protect
- trace_android_vh_mapped_page_try_sorthead

Bug: 236578020
Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
Change-Id: I688aceabf17d9de2feac7c3ad7144d307de6ef29
2022-08-10 04:38:19 +00:00
Peifeng Li
efbe140e82 ANDROID: vendor_hooks: account page-mapcount
Support five hooks as follows to account
the amount of multi-mapped pages in kernel:

- android_vh_show_mapcount_pages
- android_vh_do_traversal_lruvec
- android_vh_update_page_mapcount
- android_vh_add_page_to_lrulist
- android_vh_del_page_from_lrulist

Bug: 236578020
Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
Change-Id: Ia2c7015aab442be7dbb496b8b630b9dff59ab935
2022-08-10 04:38:06 +00:00
Suren Baghdasaryan
bf19ba7dd0 ANDROID: GKI: allow mm vendor hooks header inclusion from header files
Introduce PROTECT_TRACE_INCLUDE_PATH to allow trace/hooks/mm.h to be
included from a header file. When trace/hooks/mm.h is included from a
header file PROTECT_TRACE_INCLUDE_PATH should be defined before the
inclusion so that the existing TRACE_INCLUDE_PATH gets preserved.

Bug: 236578020
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ia5890ba51675de41ff3ea4ab38bcb458202df5fb
2022-08-10 04:37:36 +00:00
Eric Biggers
60714690fe ANDROID: scsi: ufs: add vendor hook to override key reprogramming
Some hardware has a way to restore all keyslots at once that is
significantly faster than restoring each keyslot individually, as is
done by blk_ksm_reprogram_all_keys().  Add a hook
"android_rvh_ufs_reprogram_all_keys" that allows overriding the
restoration of all keyslots after UFS reset.  This may sleep, so this
must be a "restricted" Android vendor hook rather than a regular one.

Note that currently this functionality can't be upstreamed, as support
for the hardware that needs it would need to be upstreamed first.

(cherry picked from commit e2e063f5074e2e14a96875e5e5670314a41e1c34)

Bug: 162257402
Bug: 181905172
Bug: 241106918
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Kenny Root <kroot@google.com>
Change-Id: I0b25393a5131941f085892560e08a64e63cd1369
2022-08-04 16:29:33 +00:00
Rick Yiu
d66cc0913f ANDROID: sched: Add vendor hook for rt util update
Vendor may have need to track rt util.

Bug: 201261299
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: I2f4e5142c6bc8574ee3558042e1fb0dae13b702d
2022-08-01 20:51:13 +00:00
Rick Yiu
eb994f2728 ANDROID: sched: Add vendor hook for util-update related functions
Vendor may have the need to implement their own util tracking.

Bug: 201260585
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: I973902e6ff82a85ecd029ac5a78692d629df1ebe
2022-08-01 20:51:13 +00:00
Darren Hsu
9204c086fe ANDROID: power: add a vendor hook to log unfrozen tasks
We recently noticed an issue where freezing of user space tasks is
failed due to a process being in uninterruptible sleep state.
Currently, the logging of unfrozen tasks is disabled by default.
Although it can be enabled for debugging via a adb command, it's
usually hard to reproduce the issue. So we want to add a vendor hook
to log unfrozen tasks.

pm_debug_messages enables a large amount of log output during every
suspend/resume cycle of which at most 1 line is helpful for
investigating this recurring class of battery life issues. Deploying
builds with pm_debug_messages is therefore not viable, as it
substantially shortens the temporal span of the log. The new vendor
hook will only emit logs specific to this class of problem, and only
when the problem actually manifests.

Bug: 240091483
Test: all presubmit tests passed
Change-Id: Ief3d4196ea7220d4897c00a37ab96f456dbf2259
Signed-off-by: Darren Hsu <darrenhsu@google.com>
(cherry picked from commit 3821e5b25c4067d2263bc47c674fde57a17cf7c4)
2022-08-01 20:47:29 +00:00
Wenchao Chen
a8c1d81605 ANDROID: GKI: add vendor hook for sd
Modify the timing of cmd line and data line in HS mode to improve the compatibility of SD cards that only support HS mode.

Bug: 240510879
Change-Id: Ia1c98845f63b4b051d0b1db80856ee98dc5da8c1
Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
2022-07-28 15:36:32 +00:00
zhengding chen
e107ea9e4d ANDROID: vendor_hooks: Add hooks for binder proc transaction
When servicemanager process added service proxy from other process
register the service, we want to know the matching relation between
handle in the process and service name. When binder transaction
happened, We want to know what process calls what method on what service.

Bug: 186604985

Signed-off-by: zhengding chen <chenzhengding@oppo.com>
Change-Id: I813d1cde10294d8665f899f7fef0d444ec1f1f5e
2022-07-27 19:14:41 +00:00
Jing-Ting Wu
1b458bb3d1 ANDROID: sched: add vendor hook to PELT multiplier
We add vendor hook at sched_pelt_multiplier for
performance tuning.

Bug: 240249624

Change-Id: I10e3436a986dd5dd7d375460922407666f27739d
Signed-off-by: Jing-Ting Wu <Jing-Ting.Wu@mediatek.com>
2022-07-27 17:37:45 +00:00
Shaleen Agrawal
8c802d3f5c ANDROID: arch_topology: Add android_rvh_update_thermal_stats
Add trace hook so modules can track thermal changes to process
vendor value adds.

Bug: 203763121
Change-Id: I5c54b313d3c92c0514f18b07797dd20c9c6f5161
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2022-07-27 02:37:23 +00:00
Wenchao Chen
05ec70974d ANDROID: GKI: add vendor hook for mmc
We need to turn on the write protection function of the device to protect some data from being written.

Bug: 239614762
Change-Id: I2fdacf31b61612f3e9e21537e3d118432941e841
Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
2022-07-25 19:13:25 +00:00
xiaofeng
9c6d1cf9ff ANDROID: vendor_hooks: tune reclaim scan type for specified mem_cgroup
Add memcg support for hooks in the reclaim path

Bug: 230450931
Change-Id: Ia3e6949985d915c8640139fbb93800d91e1e46f8
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2022-07-21 21:14:24 +00:00
Zhuguangqing
254fb1f403 ANDROID: Add vendor hooks for binder perf tuning
Add vendor hook to get the binder message for vendor-specific power and
performance tuning.

Bug: 182496370
Bug: 235925535

Signed-off-by: Zhuguangqing <zhuguangqing@xiaomi.com>
Change-Id: Id47e59c4e3ccd07b26eef758ada147b98cd1964e
(cherry picked from commit 301e89472f3e00a2f02f1967d77efd051ada37f5)
Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
[ cmllamas: don't export complete private definition struct binder_alloc
  in vendor hooks, instead just pass member alloc->free_async_space as
  implemented by heshuai1 and squashed here ]
2022-07-12 21:20:26 +00:00
Liangliang Li
bba640d1ea ANDROID: mm: add vendor hook for vmpressure
Add vendor hook for bypass vmpressure accounting when doing oem's
custom memory reclaim.

Bug: 191534577

Change-Id: I0c2263e03943596312aa6b01cf8506f2ae87213e
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
(cherry picked from commit 444a0b77522e1fca71ac16848d5da5bd7a27908e)
2022-07-07 18:22:37 +00:00
xieliujie
709679142d ANDROID: vendor_hooks: Add hooks for signal
Add hook to boost thread when process killed.

Bug: 237749933
Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I7cc6f248397021f3a8271433144a0e582ed27cfa
2022-07-05 19:37:46 +00:00
Liujie Xie
d26c0e1c40 ANDROID: vendor_hooks: Add hooks to select binder worklist
trace_android_vh_binder_proc_transaction_entry:
We need change binder thread so that this work can be added in
proc->todo, if we found the binder thread, skip native logic.

trace_android_vh_binder_select_worklist_ilocked:
we need this because we can't change list point in ”trace_android_vh_binder_thread_read“,
otherwise, If a work has beed added in our own defined list before,
current may goto retry and loop again and again.

Bug: 219898723
Change-Id: Ifdb3429c9ddac521bc75c1d21740ee7cc4b8f143
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
(cherry picked from commit acefa91e517b9321295429d3a0e534908e2939c1)
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2022-07-01 04:44:24 +00:00
Liujie Xie
d4528a28cb ANDROID: vendor_hooks: Add hooks for rwsem and mutex
Add hooks to apply oem's optimization of rwsem and mutex

Bug: 182237112
Signed-off-by: xieliujie <xieliujie@oppo.com>
(cherry picked from commit 80b4341d0520dce2ef1e33aef06c6a2bc8ada518)

Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I36895c432e5b6d6bff8781b4a7872badb693284c
Signed-off-by: Carlos Llamas <cmllamas@google.com>
[cmllamas: completes the cherry-pick of original commit 80b4341d0520
since commit 0902cc73b7 was only partial]
2022-07-01 04:44:24 +00:00
Liujie Xie
944f06e3e0 ANDROID: vendor_hooks: Add hooks for futex
We want to use this hook to record the sleeping time due to Futex

Bug: 210947226

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I637f889dce42937116d10979e0c40fddf96cd1a2
(cherry picked from commit a7ab784f601a93a78c1c22cd0aacc2af64d8e3c8)
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2022-07-01 04:44:24 +00:00
Liujie Xie
b7a1174cc5 ANDROID: vendor_hooks: Add hooks to record the time of the process in various states
These hooks will do the following works:
a) record the time of the process in various states
b) Make corresponding optimization strategies in different hooks

Bug: 205938967

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: Ia3c47bbf0aadd17337ce18fd910343b1b8c3ef93
(cherry picked from commit a61d61bab7c3d221d5d2250eacab2e4e9f59b252)
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2022-07-01 04:44:24 +00:00
lijianzhong
7cf9646c24 ANDROID: sched: Add vendor hooks for cpu affinity.
add vendor hooks for cpu affinity to support oem's feature.

Bug: 183674818

Signed-off-by: lijianzhong <lijianzhong@xiaomi.com>
Change-Id: I3402abec4d9faa08f564409bfb8db8d7902f3aa2
2022-06-29 10:48:28 +08:00
lijianzhong
a188361628 ANDROID: cgroup: Add vendor hook for cpuset.
add vendor hook for cpuset to support oem's feature.

Bug: 183674818
Signed-off-by: lijianzhong <lijianzhong@xiaomi.com>
Change-Id: Ib93e05e5f6c338c5f7ada56bfebdd705f87f1f66
2022-06-28 19:45:00 +00:00
Liujie Xie
8968875ad6 ANDROID: vendor_hooks: Add hooks for binder proc transaction
We need pointers to proc and t, the current hooks in binder_proc_transaction
are unable to use.

Bug: 208910215
Change-Id: I730964f965a015e5f5a3e237d9b3bd084b5bd0d0
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
(cherry picked from commit cb7e10d31bca4f247c34d6791d6db048edf7e7a8)
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2022-06-28 17:43:21 +00:00
Maulik Shah
61b67cda34 ANDROID: irqchip: irq-gic: Add vendor hook for gic-v2 resume
This change adds vendor hook for gic-v2 resume to allow vendor GIC
enhancement. This is inline with hook present today in irq-gic-v3.c
with one difference that vendor hooks in v2 driver do not pass entire
gic_chip_data struct to vendor module. Instead it passes the required
fields which are irq_domain and the gic dist base to know the wakeup
IRQ reason.

The newly added vendor hook can get invoked by two ways.
  1. By registering with syscore ops, .resume method can invoke vendor
     hook. This is applicable for cases like suspend-to-ram which
     invokes syscore ops.
  2. By exporting the gic_v2_resume(), the newly added vendor hook will
     get invoked during the first CPU waking up from suspend-to-idle
     case.

While at this move android_vh_gic_resume() to gic_v3.h as its specific
to v3 driver.

Bug: 234108369
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
Change-Id: I4c857b40f25ad58a6daca491e89adb90e8f6ca93
2022-06-27 21:15:28 +00:00
Wei.Chen
6bcb23254b ANDROID: Add vendor hook to skip usb audio suspend in offload mode
android_vh_audio_usb_offload_suspend:
	To skip pcm suspend in offload mode

We need a vendor hook to skip usb audio suspend in  offload mode.
In kernel5.4 the cmd SNDRV_PCM_TRIGGER_SUSPEND and SNDRV_PCM_TRIGGER_STOP are treated differently.
However, they are treated the same in kernel5.15, which will lead to system suspend while music playing in offload mode.

Bug: 237022398
Test: build pass / music playing / recording

Signed-off-by: Wei Chen <wei.chen3@unisoc.com>
Change-Id: Ib6ec0a1419493801aeba2e045b33384f246f43b5
2022-06-27 21:13:31 +00:00
heshuai1
455e0a8535 ANDROID: sched: Add vendor hooks to compute new cpu freq.
add vendor hooks to compute new cpu freq for oem feature.

Bug: 235925535

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: I2b8e1f76f3b9792148f153190b862face679ebbd
2022-06-27 19:48:15 +00:00
heshuai1
c445fe4dc6 ANDROID: power: Add vendor hook to qos for GKI purpose.
Add the vendor hook to qos.c, because of some special cases related to
our feature. we add the hook at freq_qos_add_request and remove_request
to make sure we can go to our own qos process logic.

Bug: 187458531

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: I1fb8fd6134432ecfb44ad242c66ccd8280ab9b43
2022-06-24 20:32:46 +00:00