Commit Graph

213 Commits

Author SHA1 Message Date
Peifeng Li
a2485b8abd ANDROID: vendor_hooks: Add hooks to for alloc_contig_range
Provide a vendor hook to allow drain_all_pages to be skipped
during alloc_contig_range in some cases to avoid delays caused by
it in cases when the benefits of draining pcp lists are known
to be small.

Bug: 224732340
Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
Change-Id: I0a82f668cf985ad5344d666c0c6372a7e61c3798
2022-03-30 15:56:25 +00:00
Liujie Xie
95380146ce ANDROID: vendor_hooks: Add hook in shrink_node_memcgs
Add vendor hook in shrink_node_memcgs to adjust whether
to skip memory reclamation of memcg.

Bug: 226482420
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I925856353e63c5a821027de4f8476c833e21b982
2022-03-29 19:43:45 +00:00
Naina Mehta
fe75d58387 ANDROID: fault: Add vendor hook for TLB conflict
Add android_vh_handle_tlb_conf vendor hook to gracefully
handle TLB conflict.

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

1 Added variable:

  [A] 'tracepoint __tracepoint_android_vh_handle_tlb_conf'

Bug: 222637802
Change-Id: I3d6814cd950e77e1a15ce444764078692724cd0a
Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
2022-03-10 21:00:12 +00:00
Liujie Xie
ebbf267fc0 ANDROID: vendor_hooks: Add hooks for __alloc_pages_direct_reclaim
Provide a vendor hook to allow drain_all_pages to be skipped
during direct reclaim in some cases to avoid delays caused by
it in cases when the benefits of draining pcp lists are known
to be small.

Bug: 220811627
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I0805241f81e0a94afcf62c98e97cff125d4061e2
2022-03-04 00:43:37 +00:00
Liujie Xie
f2d0c30576 ANDROID: vendor_hooks: Add hooks for shrink_active_list
Provide a vendor hook to allow page_referenced to be skipped
during shrink_active_list to avoid heavy cpuloading caused by
it.

Bug: 220878851
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: Ie0e369f8f8739fea59a95470af20ab0e976869d1
2022-03-01 00:02:41 +00:00
Liujie Xie
acefa91e51 ANDROID: vendor_hooks: Add hooks for binder
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>
2022-02-27 04:29:51 +00:00
Greg Kroah-Hartman
e4d293dc33 Revert "ANDROID: vendor_hooks: Add hooks for binder proc transaction"
This reverts commit cb7e10d31b.

The hook android_vh_binder_proc_transaction_finish is not used by any
vendor, so remove it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 208910215
Cc: Liujie Xie <xieliujie@oppo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I19c6660c138dc88e554e62d309484d75ec24dc6c
2022-02-22 16:30:58 +00:00
Liujie Xie
cb7e10d31b 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>
2022-02-14 18:40:45 +00:00
Charan Teja Reddy
6a9ff8fa26 ANDROID: iommu: Add restricted vendor hook
Add restricted vendor hook for arch_setup_dma_ops to allow vendor
enhancements. This needs to be restricted vendor hook as it is
doing GFP_KERNEL allocation which are non-atomic in nature.

Bug: 214353193
Change-Id: I45f8f0404a247b67fd07a6831ff813bbc50fbca2
Signed-off-by: Charan Teja Reddy <quic_charante@quicinc.com>
2022-01-28 16:24:43 +00:00
Greg Kroah-Hartman
a0009ade38 Revert half of "ANDROID: cpu/hotplug: create vendor hook for cpu_up/cpu_down"
This reverts parts of commit f7d52eda9f.

The hook android_vh_cpu_down is not used by any vendor, so remove it to
help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 176152285
Cc: Stephen Dickey <dickey@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I66e5308f32b8b11741dd4ea659cd3f79fa9a6526
2022-01-21 13:13:16 +01:00
Greg Kroah-Hartman
a863cef344 Revert half of "ANDROID: arm64: add vendor hooks for bti and pauth fault"
This reverts half of commit 06d074249f.

The hooks android_rvh_do_bti is not used by any vendor, so remove them
to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203187389
Cc: Sangmoon Kim <sangmoon.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I840399ee4461c6bffa8c8b63d9cd5748d88d2aae
2022-01-21 13:13:16 +01:00
Greg Kroah-Hartman
4b3396046c Revert "ANDROID: vendor_hooks: Add a hook for task tagging"
This reverts commit cadbca1c5e.

The hook android_vh_set_task_comm is not used by any vendor, so remove
it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 189352151
Cc: ted.lin <ted.lin@oneplus.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I005ad1c1a55f8646e5bbccd142827eed553411f6
2022-01-21 13:11:10 +01:00
Greg Kroah-Hartman
d8fe0b1fc2 Revert "ANDROID: GKI: net: add vendor hooks for 'struct nf_conn' lifecycle"
This reverts commit 4d30956478.

The hooks android_rvh_nf_conn_alloc and android_rvh_nf_conn_free were
not used by any vendor, so remove them to help with merge issues with
future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 171013716
Cc: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I069a798036056feadb2c933da42d405b7bf22cd4
2022-01-21 13:11:10 +01:00
Greg Kroah-Hartman
92ab2aeca5 Revert "ANDROID: GKI: net: add vendor hooks for 'struct sock' lifecycle"
This reverts commit 0ed7424fa0.

The hooks android_rvh_sk_alloc and android_rvh_sk_free are not used by
any vendor, so remove them to help with merge issues with future LTS
releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 171013716
Cc: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5fa860e75a0640bc02d1dffeb556497badd6f3bf
2022-01-21 13:11:10 +01:00
Greg Kroah-Hartman
b3e6d6eec6 Revert "ANDROID: vendor_hooks: add hook and OEM data for slab shrink"
This reverts commit bf769b7216.

The hook android_vh_do_shrink_slab is not used by any vendor, so remove
it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 188684131
Cc: rongqianfeng <rongqianfeng@vivo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I814e3aad76770140063fad4a81951fc025b2b1dd
2022-01-21 13:11:10 +01:00
Greg Kroah-Hartman
e09000ee19 Revert half of "ANDROID: vendor_hooks: Add hooks for memory when debug"
This reverts parts of commit 24149445ad.

The hooks android_vh_alloc_pages_slowpath,
android_vh_print_slabinfo_header, and android_vh_cache_show are not used
by any vendor, so remove them to help with merge issues with future LTS
releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 182443489
Cc: Liujie Xie <xieliujie@oppo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I63621110c0c38b7e5d5e5e6f85c513bf00ecc00b
2022-01-21 13:11:10 +01:00
Greg Kroah-Hartman
3f305a9101 Revert half of "ANDROID: gic-v3: Add vendor hook to GIC v3"
This reverts parts of commit 00c6f53e03.

The hook android_vh_gic_v3_affinity_init is not used by any vendor, so
remove it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 172637074
Cc: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I30cc4ebf738b77c2ea48df1d74ef5663f0ae1be6
2022-01-21 13:11:10 +01:00
Greg Kroah-Hartman
64095600fd Revert "ANDROID: vendor_hooks: Add hooks to recognize special worker thread."
This reverts commit 8f3f46d77c.

The hook android_vh_create_worker is not used by any vendor, so remove
it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 184571803
Cc: Liujie Xie <xieliujie@oppo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3112f4e067c27ecb6889333bb58f9342df0ecb63
2022-01-20 10:04:49 +01:00
Greg Kroah-Hartman
7887091009 Revert "ANDROID: sysrq: add vendor hook for sysrq crash information"
This reverts commit 0d8928ed6e.

The hook android_vh_sysrq_crash is not used by any vendor, so remove
it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 170234110
Cc: Sangmoon Kim <sangmoon.kim@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1b4b9280081e0fb569bb74c7f0d3efcb18728b48
2022-01-20 10:04:49 +01:00
Greg Kroah-Hartman
63e7148b27 Revert "ANDROID: user: Add vendor hook to user for GKI purpose"
This reverts commit c9b8fa644f.

The hooks android_vh_alloc_uid and android_vh_free_user are not used by
any vendor, so remove them to help with merge issues with future LTS
releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 187458531
Cc: heshuai1 <heshuai1@xiaomi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2aa3f95ab52c2d81eb790ba8b64b864f8189222b
2022-01-20 10:04:49 +01:00
Greg Kroah-Hartman
18975040b9 Revert portions of "ANDROID: sched: Add vendor hooks for sched."
This reverts part of commit 54f66141a8.

The hook android_rvh_entity_tick is not used by any vendor, so remove
it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 183674818
Cc: lijianzhong <lijianzhong@xiaomi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I92acc11802939d1ebfcc8253490193019567695d
2022-01-20 10:04:49 +01:00
Greg Kroah-Hartman
96c08d9210 Revert portions of "ANDROID: vendor_hooks: Add hooks for scheduler"
This reverts part of commit 53e8099784.

The hook android_rvh_check_preempt_wakeup_ignore is not used by any
vendor, so remove it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 182441701
Cc: xieliujie <xieliujie@oppo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I69bdc14143760bfdd07bbd72ed3d5a4127fbc4c8
2022-01-20 10:04:49 +01:00
Liujie Xie
05c23b7a50 ANDROID: vendor_hooks: Add hooks for binder
We want to add some hooks in the binder module so that we can reduce
block time until binder thread is available
Here are what new hooks do for:
1、android_vh_binder_looper_state_registered: choose a binder thread(do proc work) as a low-level thread.Only this thread has power to excute background binder transaction.
2、android_vh_binder_thread_read: let binder thread do works which come from
our list.
3、android_vh_binder_free_proc: free some pointers and variable.
4、android_vh_binder_thread_release: free the list that we create before.
5、android_vh_binder_has_work_ilocked: to check if our list has work.
6、android_vh_binder_read_done: because of we add hook in binder_has_work_ilocked,
binder_has_work_ilocked may return true, so we try to wake up low-level thread immediately.

Bug: 212483521
Change-Id: Ic40f452cc4dcf8fc85422e23e6f1a7ad77547309
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
2022-01-07 16:09:31 +00:00
Liujie Xie
a7ab784f60 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
2021-12-20 04:23:00 +00:00
Chris Goldsworthy
84fc3abca0 ANDROID: dma-contiguous: Add tracehook to allow subpage allocations in dma_alloc_contiguous
Add a tracehook to allow callers into dma_alloc_contiguous() to make
use of the built-in CMA area if the caller has addressing limitations;
this provides a means of allocating from memory whose bounds are
restricted to the lower 4 GB of memory, without having to enable DMA32
(assuming the default CMA area has been restricted to the appropriate
address ranges).

Leaf changes summary: 1 artifact changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

1 Added variable:

  [A] 'tracepoint __tracepoint_android_vh_subpage_dma_contig_alloc'

Bug: 199917449
Change-Id: Ia86fb416376bca231405b06ab27b0674c8fe3e14
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2021-12-17 02:31:49 -08:00
Liujie Xie
05aa93d251 ANDROID: vendor_hooks: Add hooks for binder proc transaction
When binder transaction happened, We want to know it's transaction code
and it is oneway or not.

Bug: 208910215

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: Ic03e5481e96e120a1953a101895714db04ca2bdf
2021-12-03 12:42:11 +08:00
Tengfei Fan
53a812c6bb ANDROID: sched: add hook point in do_sched_yield()
When a task yields, it relinquishes the cpu and
scheduler is tasked to find another task.
However our vendor scheduler logic implementation
could return the same task leading to a loop where
the yielded task gets to run back, so add hook point
in do_sched_yield() for vendor can do some work
before task is scheduled.

Bug: 205804537
Change-Id: I6528c3f4b0ee360559ef9c97cb1eb2b2d1357870
Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
2021-11-22 16:13:52 +00:00
Liangliang Li
2f3f5731de ANDROID: GKI: Add vendor hook to binder transaction
We want to get binder free space information in the binder
transaction, but this needs to hold the mutex lock. So we add
this restrict hook to do this.

Bug: 205648032
Change-Id: Ie1f377018da686bd62f5ac2d1e5421899741e6d5
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
2021-11-17 16:49:10 +00:00
Liujie Xie
7e2fbdaeab 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

Bug: 205906618

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I8eba66fd0c6d36393ca39045cf228b659834e0ae
Signed-off-by: xieliujie <xieliujie@oppo.com>
2021-11-11 18:50:16 +00:00
Liujie Xie
a61d61bab7 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
2021-11-11 22:15:49 +08:00
Sangmoon Kim
06d074249f ANDROID: arm64: add vendor hooks for bti and pauth fault
Add hooks to gather data of unusual aborts and summarize it with
other information.

Bug: 203187389

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I37b3047e72f64dc210d3d3bffe5ee207daeba8d6
2021-11-10 06:04:24 +00:00
Elliot Berman
14eae186e4 ANDROID: rproc: Add vendor hook when setting recovery mode
Add vendor hook when setting recovery mode to notify coprocessor when
mode is changed.

Bug: 205534894
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Change-Id: Ie41170deb0426a7bcfeed8a51cc4e8e1a427592a
2021-11-08 20:26:18 +00:00
Bicycle Tsai
8d68a30fe1 ANDROID: ASoC: soc-pcm: Get all BEs along DAPM path
dpcm_end_walk_at_be() stops the graph walk when first BE is found for
the given FE component. In a component model we may want to connect
multiple DAIs from different components.

android_vh_snd_soc_card_get_comp_chain can be registered here
to allows DAI/component chaining.

Later PCM operations can be called for all these listed components for a
valid DAPM path.

ALSA machine driver can setup component_chaining like below code slice.

static void my_board_component_chaining_hook(void *data, bool *ret)
{
        *ret = true;
}

static int my_board_dev_probe(struct platform_device *pdev)
{

        register_trace_android_vh_snd_soc_card_get_comp_chain(
                my_board_component_chaining_hook, NULL);

        return 0;
}

static int my_board_dev_remove(struct platform_device *pdev)
{
        unregister_trace_android_vh_snd_soc_card_get_comp_chain(
                my_board_component_chaining_hook, NULL);

        return 0;
}

static struct platform_driver my_board_driver = {
        ...
        .probe = my_board_dev_probe,
        .remove = my_board_dev_remove,
        ...
};

Bug: 198732156
Signed-off-by: Bicycle Tsai <bicycle.tsai@mediatek.com>
Change-Id: Ife5df291d40af9ec83d57462b6a08aba95d9119d
2021-10-29 22:04:59 +08:00
Greg Kroah-Hartman
a32d8ee384 Revert "ANDROID: mpam: add vendor hook to record MPAM"
This reverts commit 1aa1f6a7cf.

The hook android_vh_mpam_set is not used by any vendor, so remove
it to help with merge issues with future LTS releases.

If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.

Bug: 203756332
Bug: 165333282
Cc: C-J.Chen <C-J.Chen@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I18356743538df7d41a00f54479bf2a0bc3a62e06
2021-10-27 08:05:03 +02:00
Liujie Xie
69c931581f ANDROID: vendor_hooks: export hooks of mem_cgroup subsystem
Forgot export hooks for driver, fix it.

Fixes: 1cdcf76b15 ("ANDROID: vendor_hooks: add hooks in mem_cgroup subsystem")
Bug: 192052083

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I79779406b4dab52ceca02bd5de909d3a0c127cb9
2021-10-18 19:01:26 +00:00
Guangming Cao
dccb021dc4 ANDROID: iommu: Add vendor hook to tracing iova alloc & free in iova_domain
Add struct (iova_domain *) in iova alloc & free vendor hook by create a new vendor hook.
Thus we can know the iova we are operating belongs to which iova domain.

Bug: 201255968

Change-Id: I7df419650af2e85a3b2b8c3d6995247694bdc953
Signed-off-by: Chao Hao <chao.hao@mediatek.com>
Signed-off-by: Guangming Cao <Guangming.Cao@mediatek.com>
2021-10-09 10:07:26 +08:00
Konstantin Vyshetsky
e774e4eca6 ANDROID: scsi: ufs: add complete init vendor hook
Currently the core UFS driver does not have a vops to notify when the
device is operational. This commit introduces a hook, which serves to
notify device completing initialization and is ready to accept I/O.

This is required by the FIPS140-2 [1] self integrity test of inline
encryption engine, which must run whenever the host controller is reset.
The code requires sleeping while waiting for I/O to complete and allocating
some memory dynamically, which requires the vendor hook to be restricted.

[1] https://csrc.nist.gov/publications/detail/fips/140/2/final

Bug: 185809932
Signed-off-by: Konstantin Vyshetsky <vkon@google.com>
Change-Id: I6f476f9c2e2b50574d2898c3f1ef6b648d92df24
2021-10-04 18:26:03 +00:00
Jiewen Wang
955f917251 ANDROID: vendor_hooks: Add hook in try_to_unmap_one()
Add hook in try_to_unmap_one() to trace this function for debug memory
swap bugs.

Bug: 198385827
Change-Id: I1fdbe60e09bb491b949e06a07133710453ecca03
Signed-off-by: Jiewen Wang <jiewen.wang@vivo.com>
2021-09-06 17:00:04 +08:00
Jiewen Wang
878e0caa77 ANDROID: vendor_hooks: Add hook in mmap_region()
Add hook in mmap_region() to record the vma and address information
of monitored processes.

Bug: 198385827
Change-Id: I0bde29113b47ca7f4a9f5d42a54188e791ca3b7e
Signed-off-by: Jiewen Wang <jiewen.wang@vivo.com>
2021-09-06 16:51:38 +08:00
Liujie Xie
b0778aaff4 ANDROID: vendor_hooks: export android_vh_kmalloc_slab
export android_vh_kmalloc_slab for driver

Fixes: commit 94fbab9d6c ("ANDROID: vendor_hooks: Add hook in
kmalloc_slab()")
Bug: 197614797

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I0ad5f090d78b4c0b6c456bc2fe47716c6ba46791
2021-09-05 15:55:41 +00:00
Sajid Dalvi
bce9e7942a ANDROID: PCI/PM: Use usleep_range for d3hot_delay
This patch implements a vendor hook that changes d3hot_delay to use
usleep_range() instead of msleep() to reduce the resume time from 20ms to 10ms.

The call sequence is as follows:
pci_pm_resume_noirq()
pci_pm_default_resume_early()
pci_power_up()
pci_raw_set_power_state() --> msleep(10)

The default d3hot_delay is 10ms. Using msleep for delays less than 20ms could
result in delays up to 20ms.
Reference: Documentation/timers/timers-howto.rst

Using usleep_range() results in the delay being closer to 10ms and this reduces
the resume time.

Bug: 194231641
Change-Id: If3e4dcfb99edad302371273933fa6784854cf892
Signed-off-by: Sajid Dalvi <sdalvi@google.com>
2021-08-04 19:48:57 -05:00
Eric Biggers
e2e063f507 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.

Bug: 162257402
Bug: 181905172
Change-Id: I0b25393a5131941f085892560e08a64e63cd1369
Signed-off-by: Eric Biggers <ebiggers@google.com>
2021-07-28 15:32:51 +00:00
Liangliang Li
81c8161bed ANDROID: vendor_hooks: Add hooks to tcp/udp send/recv msg functions.
Add hook to tcp/udp to collect network info and do performance tuning.

Bug: 190523684

Change-Id: Id790a381d5ce6c35a747697510f14678ccf3ff2f
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
2021-07-28 09:53:04 +08:00
Shaleen Agrawal
f3e3a45d2b ANDROID: sched: add restricted hook to override show_cpufinfo_max_freq
Need restricted hook so that it can sleep.

The old non-restricted versions need to stay in place as a consequence
of KMI freeze.

Bug: 194431527
Change-Id: I7093b66f95c3b9c473386ade60d8897426ddbb13
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
2021-07-26 20:51:32 +00:00
Louis Kuo
e6a59da61e ANDROID: media: v4l2-core: Fix deadlock in vendor hook
The vendor hook functions we implemented will invoke callback functions which have do some sleep or spinlock
operations and have risk of deadlock due to preemption disabled of normal vendor hook function.
So we have to use restricted vendor hook function instead.
Due to KMI freeze we could not change the existing hooks.

trace_android_rvh_media_device_setup_link	=>invoke setup_link, link_notify callback
trace_android_rvh_v4l2subdev_set_xxx		=>invoke set_xxx callback

Bug: 193870284

Signed-off-by: Louis Kuo <louis.kuo@mediatek.com>
Change-Id: I94fe2e112b6c3d9ac5177abb30a99b7007068f7e
2021-07-21 13:05:27 +00:00
xieliujie
4322bb07e8 ANDROID: vendor_hooks: Modify the function name
Vendor hook is add in the commit:
https://android-review.googlesource.com/c/kernel/common/+/1687592
When we register the vendor hook and build, there is build error:
too long symbol "__tracepoint_android_vh_binder_transaction_priority_skip"
So, I shorten the function name
android_vh_binder_transaction_priority_skip -->
android_vh_binder_priority_skip

Bug: 186482511

Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: I27f39dd32436b09257bcf6e746f4ccdfbd6d6cfe
2021-07-15 16:50:42 +00:00
Vignesh Saravanaperumal
0ed7424fa0 ANDROID: GKI: net: add vendor hooks for 'struct sock' lifecycle
Some vendors want to add a field when a 'sruct sock' is added so give a
hook to handle this.  Any memory allocated when
trace_android_rvh_sk_alloc() is called needs to be freed when
trace_android_rvh_sk_free() is called.

Note, if trace_android_rvh_sk_alloc() fails, be sure to be able to
handle this in trace_android_rvh_sk_free(), but that should not be an
issue as that needs to be addressed in vendor code that runs for 'struct
sock' objects that have been created before the vendor code is loaded no
matter what.

Bug: 171013716
Signed-off-by: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Change-Id: I108a2f31d2dcc228f46159816deee6235afafbbd
2021-07-14 20:52:04 -07:00
Vignesh Saravanaperumal
4d30956478 ANDROID: GKI: net: add vendor hooks for 'struct nf_conn' lifecycle
Some vendors want to add a field when a 'sruct nf_conn' is added so give a
hook to handle this.  Any memory allocated when
trace_android_rvh_nf_conn_alloc() is called needs to be freed when
trace_android_rvh_nf_conn_free() is called.

Note, if trace_android_rvh_nf_conn_alloc() fails, be sure to be able to
handle this in trace_android_rvh_nf_conn_free(), but that should not be
an issue as that needs to be addressed in vendor code that runs for
'struct nf_conn' objects that have been created before the vendor code
is loaded no matter what.

Bug: 171013716
Signed-off-by: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Change-Id: I4d2b025196a3df7ba4adec313c90483811cac728
2021-07-14 20:52:03 -07:00
Robert Lee
13bc06efd9 ANDROID: ALSA: compress: add vendor hook to support pause in draining
Add a hook to query from vendor's compress driver if it is support pause
in draining and if the platform need to keep in draining state.

Bug: 184020292
Bug: 178992384

Change-Id: Id2e2ff72d7ee66fc633473ec109ed3d8a2baaeff
Signed-off-by: Robert Lee <lerobert@google.com>
2021-07-14 17:10:01 +00:00
Yang Yang
2faed77792 ANDROID: vendor_hooks: add vendor hook in blk_mq_rq_ctx_init()
This vendor hook let us initialize payload of the request.

Bug: 188749221
Change-Id: I51d6a3010ac0ab36066dbe1368158592832112b7
Signed-off-by: Yang Yang <yang.yang@vivo.com>
2021-07-14 14:17:35 +00:00