Commit Graph

1058064 Commits

Author SHA1 Message Date
Wenbin Mei
8144640150 UPSTREAM: dt-bindings: mmc: mtk-sd: Add hs400 dly3 setting
Add hs400 dly3 setting for mtk-sd yaml

Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210917124803.22871-2-wenbin.mei@mediatek.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Bug: 234554003
Signed-off-by: Peng Zhou <Peng.Zhou@mediatek.com>
Change-Id: I2738b6774108d3dc8a12291f879744fb92c2d25b
(cherry picked from commit fb4708e6cb)
2022-07-19 12:47:28 +00:00
Suren Baghdasaryan
eb998c1ff2 ANDROID: powerpc/mm: protect vm_file during speculative page fault handling
Use vma->file_ref_count to protect vma->vm_file from destruction during
speculative page fault handling.

Bug: 234527424
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I0ebebcafe5f50444e582ec5835eb6005fa85f5b1
2022-07-19 12:47:28 +00:00
Suren Baghdasaryan
510f79ba77 ANDROID: x86/mm: protect vm_file during speculative page fault handling
Use vma->file_ref_count to protect vma->vm_file from destruction during
speculative page fault handling.

Bug: 234527424
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Icdd558532872095869f9106cc7e4b7e07dc46748
2022-07-19 12:47:28 +00:00
Suren Baghdasaryan
c9acd461a2 ANDROID: arm64/mm: protect vm_file during speculative page fault handling
Use vma->file_ref_count to protect vma->vm_file from destruction during
speculative page fault handling.

Bug: 234527424
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I4c826fd5ef45576566e1eb8f8f23d17e620e7fc9
2022-07-19 12:47:27 +00:00
Suren Baghdasaryan
4daa3c254e ANDROID: add vma->file_ref_count to synchronize vma->vm_file destruction
In order to prevent destruction of vma->vm_file while it's being used
during speculative page fault handling, introduce an atomic refcounter.

Bug: 234527424
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I0e971156f3e76feb45136bac1582a7eaab8c75df
2022-07-19 12:47:27 +00:00
Suren Baghdasaryan
0864756fb0 Revert "ANDROID: Use the notifier lock to perform file-backed vma teardown"
This reverts commit dc8ac508afd3b105978fd3dd98462950daa5b297.
Reason for revert: performance regression.

Bug: 234527424
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I5811c7ee2feac7f9057ed0ccd848e5de71f79354
2022-07-19 12:47:27 +00:00
Suren Baghdasaryan
6338289f96 Revert "ANDROID: Fix build errors caused by missing mmu_notifier_lock definition"
This reverts commit dbc5eb8e31f70b6a559da56a93668d90ed38a5c0.
Reason for revert: performance regression.

Bug: 234527424
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I685f09cfe4d2b3fef9e88953f794186c0e790657
2022-07-19 12:47:27 +00:00
Capone Huang
c1a58dad6d ANDROID: Update symbol list for mtk
Leaf changes summary: 1 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

1 Added functions:

  [A] 'function int iterate_dir(file*, dir_context*)'

Bug: 236208914
Signed-off-by: Capone Huang <capone.huang@mediatek.corp-partner.google.com>
Change-Id: Ibea71fa232eb8d149b83bd8d2fdcb4e46c63f8b8
2022-07-19 12:47:27 +00:00
huang dezhi
ea1c621b81 ANDROID: GKI: add symbol list file for honor
add abi_gki_aarch64_honor

Leaf changes summary: 10 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 5 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 5 Added variables

5 Added functions:

  [A] 'function int __traceiter_android_vh_alter_mutex_list_add(void*, mutex*, mutex_waiter*, list_head*, bool*)'
  [A] 'function int __traceiter_android_vh_mutex_init(void*, mutex*)'
  [A] 'function int __traceiter_android_vh_mutex_unlock_slowpath(void*, mutex*)'
  [A] 'function int __traceiter_android_vh_mutex_wait_finish(void*, mutex*)'
  [A] 'function int __traceiter_android_vh_mutex_wait_start(void*, mutex*)'

5 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_alter_mutex_list_add'
  [A] 'tracepoint __tracepoint_android_vh_mutex_init'
  [A] 'tracepoint __tracepoint_android_vh_mutex_unlock_slowpath'
  [A] 'tracepoint __tracepoint_android_vh_mutex_wait_finish'
  [A] 'tracepoint __tracepoint_android_vh_mutex_wait_start'

Bug: 231527236
Change-Id: Id3125e93696d91b3daed2ff74c17edb0235c3aa2
Signed-off-by: huang dezhi <huangdezhi@hihonor.com>
2022-07-19 12:47:27 +00:00
Quentin Perret
8ee914a539 ANDROID: KVM: arm64: Prevent kmemleak from accessing .hyp.data
We've recently added a .data section for the hypervisor, which kmemleak
is eager to parse. This clearly doesn't go well, so add the section to
kmemleak's block list.

Bug: 232768943
Bug: 235903024
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I29d81cb1246c590bd5203d560ea369e5f29d59b0
2022-07-19 12:47:27 +00:00
Xuewen Yan
aad764985c ANDROID: ABI: Update symbols to unisoc whitelist for the scheduler 4st
Update whitelist for the symbols used by the unisoc device and
update the ABI representation accordingly

Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

2 Added functions:

  [A] 'function int __traceiter_android_rvh_account_irq_end(void*, task_struct*, int, s64)'
  [A] 'function int __traceiter_android_rvh_account_irq_start(void*, task_struct*, int, s64)'

Bug: 235909063
Change-Id: Idfce8f81fbe6ed11d974dbcf6f04e768af54d0ca
Signed-off-by: Xuewen Yan <xuewen.yan@unisoc.com>
2022-07-19 12:47:27 +00:00
Peifeng Li
28f031bf96 ANDROID: GKI: Update symbols to symbol list
Leaf changes summary: 9 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 5 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 4 Added variables

5 Added functions:

  [A] 'function int __traceiter_android_vh_cma_drain_all_pages_bypass(void*, unsigned int, bool*)'
  [A] 'function int __traceiter_android_vh_drain_all_pages_bypass(void*, gfp_t, unsigned int, unsigned long int, int, unsigned long int, bool*)'
  [A] 'function int __traceiter_android_vh_page_referenced_check_bypass(void*, page*, unsigned long int, int, bool*)'
  [A] 'function int __traceiter_android_vh_pcplist_add_cma_pages_bypass(void*, int, bool*)'
  [A] 'function unsigned long int shrink_slab(gfp_t, int, mem_cgroup*, int)'

4 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_cma_drain_all_pages_bypass'
  [A] 'tracepoint __tracepoint_android_vh_drain_all_pages_bypass'
  [A] 'tracepoint __tracepoint_android_vh_page_referenced_check_bypass'
  [A] 'tracepoint __tracepoint_android_vh_pcplist_add_cma_pages_bypass'

Bug: 234405962
Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
Change-Id: Ie38bd63282c8ab0ec8f837e06bd5e9e6ab272ba6
2022-07-19 12:47:26 +00:00
Yunfei Wang
98496efc97 FROMLIST: iommu/mediatek: Allow page table PA up to 35bit
Single memory zone feature will remove ZONE_DMA32 and ZONE_DMA. So add
the quirk IO_PGTABLE_QUIRK_ARM_MTK_TTBR_EXT to let level 1 and level 2
pgtable support at most 35bit PA.

Signed-off-by: Ning Li <ning.li@mediatek.com>
Link: https://lore.kernel.org/linux-mediatek/20220616120713.12728-3-yf.wang@mediatek.com/
Bug: 235767992
Signed-off-by: Yunfei Wang <yf.wang@mediatek.com>
Change-Id: Iaf93281e99985403d92157aee13e2e449b876545
2022-07-19 12:47:26 +00:00
Yunfei Wang
293ec0920f FROMLIST: iommu/io-pgtable-arm-v7s: Add a quirk to allow pgtable PA up to 35bit
Single memory zone feature will remove ZONE_DMA32 and ZONE_DMA and
cause pgtable PA size larger than 32bit.

Since Mediatek IOMMU hardware support at most 35bit PA in pgtable,
so add a quirk to allow the PA of pgtables support up to bit35.

Signed-off-by: Ning Li <ning.li@mediatek.com>
Link: https://lore.kernel.org/linux-mediatek/20220616120713.12728-2-yf.wang@mediatek.com/
Bug: 235767992
Signed-off-by: Yunfei Wang <yf.wang@mediatek.com>
Change-Id: I5dd226507bfbbbe85cb00aa27d03cd3592740055
2022-07-19 12:47:26 +00:00
Zhuguangqing
58e3f869fc ANDROID: Add vendor hooks to signal.
Add vendor hook to get signal for vendor-specific tuning.

Conflicts:
    drivers/android/vendor_hooks.c

Bug: 184898838

Signed-off-by: Zhuguangqing <zhuguangqing@xiaomi.com>
Change-Id: I83a28b0a6eb413976f4c57f2314d008ad792fa0d
(cherry picked from commit d623f1ff72)
2022-07-19 12:47:26 +00:00
Liujie Xie
77064627fb ANDROID: ashmem: Export is_ashmem_file
Export is_ashmem_file function which will be used
by the minidump module to get ashmem info.

Bug: 193397560
Change-Id: I5b7816ad4775e5cf2c4f41c28b1c8dacc2c85b7e
Signed-off-by: liuhailong <liuhailong@oppo.com>
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
(cherry picked from commit 7bcfde2601)
2022-07-19 12:47:26 +00:00
wudean
842c68a977 ANDROID: vendor_hooks: bypass shrink slab
Add hooks for bypass shrink slab.

Bug: 185951972
(cherry picked from commit 396a6adfd3)

Change-Id: I343e02ae5cd6d076d525d0e4bfc09ecdfeda1d7b
Signed-off-by: wudean <dean.wu@vivo.com>
2022-07-19 12:47:26 +00:00
Mukesh Ojha
89911c32cf FROMLIST: devcoredump : Serialize devcd_del work
In following scenario(diagram), when one thread X running dev_coredumpm()
adds devcd device to the framework which sends uevent notification to
userspace and another thread Y reads this uevent and call to
devcd_data_write() which eventually try to delete the queued timer that
is not initialized/queued yet.

So, debug object reports some warning and in the meantime, timer is
initialized and queued from X path. and from Y path, it gets reinitialized
again and timer->entry.pprev=NULL and try_to_grab_pending() stucks.

To fix this, introduce mutex and a boolean flag to serialize the behaviour.

 	cpu0(X)			                cpu1(Y)

    dev_coredump() uevent sent to user space
    device_add()  ======================> user space process Y reads the
                                          uevents writes to devcd fd
                                          which results into writes to

                                         devcd_data_write()
                                           mod_delayed_work()
                                             try_to_grab_pending()
                                               del_timer()
                                                 debug_assert_init()
   INIT_DELAYED_WORK()
   schedule_delayed_work()
                                                   debug_object_fixup()
                                                     timer_fixup_assert_init()
                                                       timer_setup()
                                                         do_init_timer()
                                                       /*
                                                        Above call reinitializes
                                                        the timer to
                                                        timer->entry.pprev=NULL
                                                        and this will be checked
                                                        later in timer_pending() call.
                                                       */
                                                 timer_pending()
                                                  !hlist_unhashed_lockless(&timer->entry)
                                                    !h->pprev
                                                /*
                                                  del_timer() checks h->pprev and finds
                                                  it to be NULL due to which
                                                  try_to_grab_pending() stucks.
                                                */
Bug: 235577024
Change-Id: I5e86abf72e8dff6952ba493fd9f43a26b2b40352
Link: https://lore.kernel.org/lkml/2e1f81e2-428c-f11f-ce92-eb11048cb271@quicinc.com/
Link: https://lore.kernel.org/lkml/1653660220-19197-1-git-send-email-quic_mojha@quicinc.com/
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
2022-07-19 12:47:26 +00:00
d wang
104c11e9af ANDROID: ABI: Update symbols used by the unisoc filesystem whitelist for
the 1st

Update whitelist for the symbols used by the unisoc device and update
the ABI representation accordingly

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

1 Added function:

  [A] 'function void blk_stat_enable_accounting(request_queue*)'

Bug: 236086883
Change-Id: I4569707b8548c97ef65f11938e29e53f860faa45
Signed-off-by: d wang <dongwei.wang@unisoc.com>
2022-07-19 12:47:26 +00:00
Patrick Daly
63d1aaef59 FROMLIST: of: of_reserved_mem: Increase limit for reserved_mem regions
The reserved_mem array must be statically allocated because it is used
prior to memblock being aware of all "no-map" or otherwise reserved
regions which have fixed physical addresses. Due to this limitation,
if one architecture/board has a large number of reserved_mem regions,
this limit must be raised for all.

In particular, certain new qcom boards currently have 63 reserved memory
regions, which when new features are added, pushes them over the existing
limit of 64.

A generalized breakdown by region type:
13 for linux-loaded device firmware
9 for guest-vms or inter-vm communication
15 cma heaps/dma-buf heaps
24 for bootloaders/hypervisor/secure-world devices or software
2 misc

Although this number could be reduced by a minor amount by combining
physically adjacent regions, this comes at the cost of losing
documention on what/who the regions are used by. In addition, combining
adjacent regions is not possible if there are phandles in devicetree
refering to the regions in question, such as "memory-region".

Vmlinux size before:
text      data      bss     dec       hex      filename
31030829  15807732  588524  47427085  2d3ae0d  dist/vmlinux

text      data      bss     dec       hex      filename
31030877  15807668  592108  47430653  2d3bbfd  dist/vmlinux

Bug: 229767760
Link: https://lore.kernel.org/linux-devicetree/1650488954-26662-1-git-send-email-quic_pdaly@quicinc.com/T/#u
Change-Id: I2bdc6ad1ecfe273aad3c72390283b6d1247b18c3
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
Signed-off-by: Sukadev Bhattiprolu <quic_sukadev@quicinc.com>
2022-07-19 12:47:25 +00:00
xieliujie
ad2d36f06f ANDROID: vendor_hooks: Add hook for binder
Add hook to support oem's performance feature.

Bug: 186482511

Signed-off-by: xieliujie <xieliujie@oppo.com>
Change-Id: Ib495e80e569cc293eaa98d87a050aee8915eb415
(cherry picked from commit 2337b9185a)
2022-07-19 03:54:51 +00:00
Chetan C R
e6e44e9a85 ANDROID: GKI: Update abi_gki_aarch64_qcom for devm_of_clk_del_provider
Add devm_of_clk_del_provider symbol.

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

1 Added function:

  [A] 'function void devm_of_clk_del_provider(device*)'

Bug: 235919751
Change-Id: I14494bf4cab4bbf70eb76d751cdb201f4c4ed65e
Signed-off-by: Chetan C R <quic_cchinnad@quicinc.com>
2022-07-19 03:54:51 +00:00
Greg Kroah-Hartman
3cf5c7059d Revert "ANDROID: umh: Enable usermode helper for required use cases"
This reverts commit c555553a40d6795e0c5d18b8ee94ac516a0aef09.

Reason for revert: The binaries, and /sbin/ is not even present on Android systems.  This patch was never tested :(

Bug: 202192667
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia1c35eba4a89a62ba678d8004742563372d3d920
2022-07-19 03:54:51 +00:00
Eric Biggers
4881c12c76 ANDROID: GKI: update module list for fips140 build
This fixes the following build error:

    ERROR: modules list out of date
    Update it with:
    cp [...]/out/android13-5.15/common/modules.order common/android/gki_aarch64_fips140_modules

Bug: 188620248
Change-Id: I5e06053001a3ea3cf488e9ad0af8f6e4af2de0a2
Signed-off-by: Eric Biggers <ebiggers@google.com>
2022-07-19 03:54:51 +00:00
Liangcai Fan
bf46e6f5db BACKPORT: mm: khugepaged: recalculate min_free_kbytes after stopping khugepaged
When initializing transparent huge pages, min_free_kbytes would be
calculated according to what khugepaged expected.

So when transparent huge pages get disabled, min_free_kbytes should be
recalculated instead of the higher value set by khugepaged.

Link: https://lkml.kernel.org/r/1633937809-16558-1-git-send-email-liangcaifan19@gmail.com
Signed-off-by: Liangcai Fan <liangcaifan19@gmail.com>
Signed-off-by: Chunyan Zhang <zhang.lyra@gmail.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit bd3400ea17)

Bug: 235523176
Signed-off-by: Chinwen Chang <chinwen.chang@mediatek.com>
Change-Id: I815893d25186847933db2a0872528fb15a00b3c8
2022-07-19 03:54:51 +00:00
Naina Mehta
62bb81afc5 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>
Signed-off-by: Vamsi Krishna Lanka <quic_vamslank@quicinc.com>
2022-07-19 03:54:50 +00:00
Bart Van Assche
4e2d8ca450 BACKPORT: FROMLIST: block/bfq: Enable I/O statistics
BFQ uses io_start_time_ns. That member variable is only set if I/O
statistics are enabled. Hence this patch that enables I/O statistics
at the time BFQ is associated with a request queue.

Compile-tested only.

Reported-by: Cixi Geng <cixi.geng1@unisoc.com>
Cc: Cixi Geng <cixi.geng1@unisoc.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
[ bvanassche: Left out the blk_stat_disable_accounting() call since ]
[ commit 68497092bd ("block: make queue stat accounting a         ]
[ reference") from kernel v5.17 has not been backported to the      ]
[ android13-5.15 branch.                                            ]
Bug: 235453574
Link: https://lore.kernel.org/linux-block/20220613163234.3593026-1-bvanassche@acm.org/T/#u
Change-Id: I5fad0fb3c7e9c6007aadd94ebb73d91c41143549
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-07-19 03:54:50 +00:00
Ray Chi
3a6c1e3359 ANDROID: usb: dwc3: export tracepoint for dwc3 read/write
There are two tracepoints in dwc3_readl() and dwc3_writel().
This patch will export the tracepoints so that vendor modules
can use them.

Bug: 184920962
Signed-off-by: Ray Chi <raychi@google.com>
Change-Id: I1170d853be1fa1c47afbba133567b1996418d8e8
2022-07-19 03:54:50 +00:00
Oh Eomji
8906b02221 ANDROID: usb: add EXPORT_TRACE_SYMBOL to export tracepoint
To use the tracepoint in kernel module, add EXPORT_TRACE_SYMBOL_GPL to
export the dwc3_ep_queue tracepoint.

Bug: 181736013
Change-Id: I211e747e10d232342cbaf877d7ad670c60e3ad0f
Signed-off-by: Oh Eomji <eomji.oh@samsung.com>
2022-07-19 03:54:50 +00:00
Mayank Rana
4d399cb1d3 UPSTREAM: usb: dwc3: core: Add error log when core soft reset failed
DWC3 controller soft reset is important operation for USB functionality.
In case when it fails, currently there is no failure log. Hence add
error log when core soft reset failed.

Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 235863377
(cherry picked from commit 859bdc3595)
Change-Id: I60500f66af47d93cf9d60bdecab32e6dc48d4b7c
Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
2022-07-19 03:54:50 +00:00
Chao Yu
99caff3b22 ANDROID: GKI: Update symbols to abi_gki_aarch64_oplus
Leaf changes summary: 12 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 12 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

12 Added functions:

  [A] 'function int __bio_crypt_clone(bio*, bio*, gfp_t)'
  [A] 'function int __blkdev_issue_discard(block_device*, sector_t, sector_t, gfp_t, int, bio**)'
  [A] 'function unsigned long int __page_file_index(page*)'
  [A] 'function void address_space_init_once(address_space*)'
  [A] 'function void bio_crypt_set_ctx(bio*, const blk_crypto_key*, const u64*, gfp_t)'
  [A] 'function int blkdev_issue_flush(block_device*)'
  [A] 'function long int congestion_wait(int, long int)'
  [A] 'function void migrate_page_copy(page*, page*)'
  [A] 'function bool prepare_to_wait_exclusive(wait_queue_head*, wait_queue_entry*, int)'
  [A] 'function void* radix_tree_delete_item(xarray*, unsigned long int, void*)'
  [A] 'function void** radix_tree_lookup_slot(const xarray*, unsigned long int)'
  [A] 'function void radix_tree_replace_slot(xarray*, void**, void*)'

Bug: 232178651

Signed-off-by: Chao Yu <chao@kernel.org>
Change-Id: Ie3aa930a0d446f4f9cb0023bd59e92cdbce92c2b
2022-07-19 03:54:50 +00:00
zhang chuang
3c5df4a52e ANDROID: Add hook to show vendor info for transactions
When watchdog or anr occur, we need to read
dev/binderfs/binder_logs/proc/pid or dev/binderfs/binder_logs/state
node to know the time-consuming information of the binder call.
We need to add the time-consuming information of binder transaction.

Bug: 190413570

Signed-off-by: zhang chuang <zhangchuang3@xiaomi.com>
Change-Id: I0423d4e821d5cd725a848584133dc7245cbc233a
(cherry picked from commit eabe9707f2)
Signed-off-by: Carlos Llamas <cmllamas@google.com>
[cmllamas: fix trivial merge conflict in vendor_hooks.c]
2022-07-19 03:54:50 +00:00
kamasali
401ae69f82 ANDROID: GKI: Update abi_gki_aarch64_qcom for partial init tracepoint
Add __tracepoint_android_rvh_partial_init symbol
Add __tracepoint_android_rvh_cache_card_csd symbol

Leaf changes summary: 2 artifacts 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, 2 Added variables

2 Added variables:

  [A] 'tracepoint __tracepoint_android_rvh_mmc_cache_card_properties'
  [A] 'tracepoint __tracepoint_android_rvh_partial_init'

Bug: 231654364

Signed-off-by: kamasali <quic_kamasali@quicinc.com>
Change-Id: I1e52438ebac1afe649c1cdf194eb3befba2b7987
2022-07-19 03:54:50 +00:00
kamasali
10bac17ee9 ANDROID: vendor_hooks: Add hook for partial_init
Need this vendor hook to support patial init functionality. This hook needs to be restricted as the additional vendor handling need to perform operations (such as wait_for_completion) in non-atomic context.
One of the main functionality of Partial init feature is to reduce latency during resume.

Bug: 231654364
Link: https://lore.kernel.org/lkml/ea318551ec0b43429ce47bfac9ebf285@quicinc.com/#r

Change-Id: Ia1cb0b7173db3318d2d6686f4bd4719f3cfefd8b
Signed-off-by: kamasali <quic_kamasali@quicinc.com>
2022-07-19 03:54:45 +00:00
Dezhi Huang
0f656fd2a1 ANDROID: mutex: Add vendor hook to init mutex oem data.
Add hooks to init oem data of mutex.

Bug: 231527236
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
Change-Id: Id0aeac168e81bd3d88051657c32ba709c329dbdd
2022-07-19 03:52:57 +00:00
CC Chou
b57c3d8b54 FROMLIST: scsi: ufs-mediatek: Introduce workaround for power mode change
Some MediaTek SoC chips need special flow for power mode change,
especially for chips supporting HS-G5.

Enable the workaround by setting the host-specific capability.

Bug: 235550312
Link: https://lore.kernel.org/linux-scsi/20220609085751.25305-4-stanley.chu@mediatek.com/
Change-Id: I7da0d429f97f89f1c3b08c683102608e720365a9
Signed-off-by: CC Chou <cc.chou@mediatek.com>
Signed-off-by: Eddie Huang <eddie.huang@mediatek.com>
Signed-off-by: Dennis Yu <tun-yu.yu@mediatek.com>
Signed-off-by: Peter Wang <peter.want@medaitek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
2022-07-19 03:52:56 +00:00
Stanley Chu
7d1e95a4ac FROMLIST: scsi: ufs: Fix ADAPT logic for HS-G5
ADAPT now is added not only for HS Gear4 mode but also higher gears.
Fix the logic for higher gears.

Bug: 235550312
Link: https://lore.kernel.org/linux-scsi/20220609085751.25305-3-stanley.chu@mediatek.com/
Change-Id: Ib832610d34e5facf53698337e4ed610a92c772b5
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
2022-07-19 03:52:56 +00:00
Stanley Chu
f18e88a018 FROMLIST: scsi: ufs: Export ufshcd_uic_change_pwr_mode()
Export ufshcd_uic_change_pwr_mode() to allow vendors to
use it for SoC-specific power mode change design limitation.

Bug: 235550312
Link: https://lore.kernel.org/linux-scsi/20220609085751.25305-2-stanley.chu@mediatek.com/
Change-Id: I43a31489ec727199a0e40cfc99202fdfd0a16214
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
2022-07-19 03:52:56 +00:00
Jing-Ting Wu
17b8066964 ANDROID: Update symbol list for mtk
Leaf changes summary: 4 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 4 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

4 Added functions:

  [A] 'function int __traceiter_android_rvh_get_nohz_timer_target(void*, int*, bool*)'
  [A] 'function int __traceiter_android_rvh_rto_next_cpu(void*, int, cpumask*, int*)'
  [A] 'function int __traceiter_android_rvh_set_cpus_allowed_ptr_locked(void*, const cpumask*, const cpumask*, unsigned int*)'
  [A] 'function int cpumask_any_distribute(const cpumask*)'

Bug: 235429072

Change-Id: Ia6384daf4dff842f4673796b8323412bf0384a3a
Signed-off-by: Jing-Ting Wu <Jing-Ting.Wu@mediatek.com>
2022-07-19 03:52:56 +00:00
Li Jun
dd202bf18a BACKPORT: FROMGIT: usb: dwc3: add power down scale setting
Some SoC(e.g NXP imx8MQ) may have a wrong default power down scale
setting so need init it to be the correct value, the power down
scale setting description in DWC3 databook:

Power Down Scale (PwrDnScale)
The USB3 suspend_clk input replaces pipe3_rx_pclk as a clock source to
a small part of the USB3 core that operates when the SS PHY is in its
lowest power (P3) state, and therefore does not provide a clock.
The Power Down Scale field specifies how many suspend_clk periods fit
into a 16 kHz clock period. When performing the division, round up the
remainder.
For example, when using an 8-bit/16-bit/32-bit PHY and 25-MHz Suspend
clock,
Power Down Scale = 25000 kHz/16 kHz = 13'd1563 (rounder up)

So use the suspend clock rate to calculate it.

Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1654568404-3461-1-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 234219431
(cherry picked from commit 3497b9a5c8
 git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing)
[jindong: rebase to v5.15, get "suspend" clk from of to replace nonexistent dwc->susp_clk]
Change-Id: I0ce2c8041810d4add84b628fc8c3964063aacd5c
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
2022-07-19 03:52:56 +00:00
Manaf Meethalavalappu Pallikunhi
2d80f682ca FROMLIST: power_supply: Register cooling device outside of probe
Registering the cooling device from the probe can result in the
execution of get_property() function before it gets initialized.

To avoid this, register the cooling device from a workqueue
instead of registering in the probe.

Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>

Bug: 211709650
Link: https://lore.kernel.org/linux-pm/1640162489-7847-1-git-send-email-quic_manafm@quicinc.com/
Change-Id: Id1aa63da9c4e43272c78b50b8b61a92b2d4f617d
Signed-off-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
2022-07-19 03:52:56 +00:00
Liangliang Li
47fc7fad0e 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>
(cherry picked from commit 81c8161bed)
2022-07-19 03:52:56 +00:00
Liangliang Li
9a7758d97f 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>
(cherry picked from commit 2f3f5731de)
2022-07-19 03:52:56 +00:00
Carlos Llamas
f21743ac08 ANDROID: binder: fix race in priority restore
During a reply, the target gets woken up and then the priority of the
replier is restored. The order is such to allow the target to process
the reply ASAP. Otherwise, we risk the sender getting scheduled out
before the wakeup happens. This strategy reduces transaction latency.

However, a subsequent transaction from the same target could be started
before the priority of the replier gets restored. At this point we save
the wrong priority and it gets reinstated at the end of the transaction.

This patch allows the incoming transaction to detect the race condition
and save the correct next priority. Additionally, the replier will abort
its pending priority restore which allows the new transaction to always
run at the desired priority.

Bug: 148101660
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I6fec41ae1a1342023f78212ab1f984e26f068221
(cherry picked from commit cac827f261)
[cmllamas: fixed trivial merge conflict]
2022-07-19 03:52:55 +00:00
Carlos Llamas
748c28bb08 ANDROID: binder: switch task argument for binder_thread
Refactor binder priority functions to take in 'struct binder_thread *'
instead of just 'struct task_struct *'. This allows access to other
thread fields used in subsequent patches. In any case, the same task
reference is still available under thread->task.

There is no functional impact from this patch.

Bug: 148101660
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I67b599884580d957d776500e467827e5035c99f6
(cherry picked from commit 759d98484b)
2022-07-19 03:52:55 +00:00
Carlos Llamas
feedc1fbb0 ANDROID: binder: pass desired priority by reference
Avoid making unnecessary stack copies of struct binder_priority and pass
the argument by reference instead. Rename 'desired_prio' to 'desired' to
match the usage in other priority functions.

There is no functional impact from this patch.

Bug: 148101660
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I66ff5305296e7b9dba56ed265236f2af518f66e0
(cherry picked from commit 52d85f8a16)
2022-07-19 03:52:55 +00:00
Carlos Llamas
11a03007fd ANDROID: binder: fold common setup of node_prio
The setup of node_prio is always the same, so just fold this logic into
binder_transaction_priority() to avoid duplication. Let's pass the node
reference instead, which also gives access to node->inherit_rt.

There is no functional impact from this patch.

Bug: 148101660
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: Ib390204556e69c4bc8492cd9cd873773f9cdce42
(cherry picked from commit 498bf715b7)
2022-07-19 03:52:55 +00:00
Liujie Xie
78ac5ea5e3 ANDROID: vendor_hooks: Add hooks for account process tick
Add a hook in account_process_tick, which help us to get information
about the high load task and the cpu they running on.

Bug: 183260319
Change-Id: I54162ce3c65bd69e08d2d4747e4d4883efe4c442
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
(cherry picked from commit 63399b4e2e)
2022-07-19 03:52:55 +00:00
xieliujie
e1960b400c 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>
Change-Id: I6332623732e2d6826b8b61087ca74e55393e0c3d
(cherry picked from commit 80b4341d05)
2022-07-19 03:52:55 +00:00
Roger Quadros
2a2e84e7b1 UPSTREAM: usb: gadget: f_mass_storage: Make CD-ROM emulation work with Mac OS-X
Mac OS-X expects CD-ROM TOC in raw format (i.e. format:2). It also
sends the READ_TOC CDB in old style SFF8020i format. i.e. 2 format bits
are encoded in MSBs of CDB byte 9.

This patch will enable CD-ROM emulation to work with Mac OS-X. Tested on
Mac OS X v10.6.3.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Roger Quadros <roger.quadros@nokia.com>
Signed-off-by: Jack Pham <quic_jackp@quicinc.com>
Link: https://lore.kernel.org/r/20220124160150.19499-1-quic_jackp@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 235304500
(cherry picked from commit 89ada0fe66)
Change-Id: Ibc4b89260f3ca788edae401d60e1392322e785a0
2022-07-19 03:52:55 +00:00