Commit Graph

1149425 Commits

Author SHA1 Message Date
Dezhi Huang
bcf27b22e4 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
2023-05-25 21:01:19 +00:00
Peifeng Li
07b9faefd4 ANDROID: ABI: Update oplus symbol list
2 function symbol(s) added
  'int __traceiter_android_vh_cleanup_old_buffers_bypass(void*, unsigned long, unsigned long*, bool*)'
  'int __traceiter_android_vh_dm_bufio_shrink_scan_bypass(void*, unsigned long, bool*)'

2 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_cleanup_old_buffers_bypass'
  'struct tracepoint __tracepoint_android_vh_dm_bufio_shrink_scan_bypass'

Bug: 281467813
Change-Id: Ic2d7e8f0e898f324a010cf0c8b4b32241aba3803
Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
2023-05-25 05:10:30 +00:00
Peifeng Li
0df40fbf03 ANDROID: vendor_hook: add hooks in dm_bufio.c
1. android_vh_dm_bufio_shrink_scan_bypass
To adjust dm_bufio-buffer shrinker's policy in some cases.
2. cleanup_old_buffers_bypass
To adjust the policy of dm_bufio-buffer periodic eviction
in some cases.

Bug: 281467813

Signed-off-by: Peifeng Li <lipeifeng@oppo.com>
Change-Id: I29a9d91d18d2e279170533db83b59cfc3b17ebe2
2023-05-25 05:10:22 +00:00
Harsh Jain
a154119473 ANDROID: abi_gki_aarch64_qcom: update QCOM symbol list
following symbols are added to abi symbol list.
	sysfs_update_group

Symbols added:
   sysfs_update_group

Bug: 281970901
Change-Id: I045fd322d8ae8d590105351ab19ea25776d4e345
Signed-off-by: Harsh Jain <quic_harshj@quicinc.com>
2023-05-25 00:48:57 +00:00
Dezhi Huang
50191081d8 ANDROID: ABI: Update honor symbol list
2 function symbol(s) added
  'int __traceiter_android_vh_do_shrink_slab(void*, struct shrinker*, long*)'
  'int __traceiter_android_vh_shrink_slab_bypass(gfp_t, int, struct mem_cgroup*, int, bool*)'

2 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_do_shrink_slab'
  'struct tracepoint __tracepoint_android_vh_shrink_slab_bypass'

Bug: 279793370
Change-Id: Ie0caa6124f819500a4d6de448da13cc4aa454a4f
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
2023-05-24 21:12:43 +00:00
Dezhi Huang
94b540c38d ANDROID: mm: create vendor hooks for do_shrink_slab()
The hook function: trace_android_vh_do_shrink_slab is added inside
of the function do_shrink_slab() to changed the numbers of page to
be reclaimed from kernel.

Bug: 279793370
Change-Id: I7c0b955be97f841c69bc99a152b59ed9823707ed
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
2023-05-24 21:12:43 +00:00
Dezhi Huang
da4e60efe1 ANDROID: mm: create vendor hooks for shrink_slab()
Trace_android_vh_shrink_slab_bypass is added in the beginning of
the function shrink_slab() to bypass kernel page reclaim in some
conditons.

Bug: 279793370
Change-Id: I6d5c8be28addf43d6fc9d07b5133135641590c3a
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
2023-05-24 21:12:43 +00:00
Prashanth K
751bcb9de0 BACKPORT: usb: dwc3: fix gadget mode suspend interrupt handler issue
When work in gadget mode, currently driver doesn't update software level
link_state correctly as link state change event is not enabled for most
devices, in function dwc3_gadget_suspend_interrupt(), it will only pass
suspend event to UDC core when software level link state changes, so when
interrupt generated in sequences of suspend -> reset -> conndone ->
suspend, link state is not updated during reset and conndone, so second
suspend interrupt event will not pass to UDC core.

Remove link_state compare in dwc3_gadget_suspend_interrupt() and add a
suspended flag to replace the compare function.

Fixes: 799e9dc829 ("usb: dwc3: gadget: conditionally disable Link State change events")
Cc: stable <stable@kernel.org>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/20230512004524.31950-1-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 283221152
(cherry picked from commit 4e8ef34e36
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ usb-linus)
[prashk: Didn't add suspended flag in dwc3_gadget_func_wakeup() & dwc3_gadget_linksts_change_interrupt()]
Signed-off-by: Prashanth K <quic_prashk@quicinc.com>
Change-Id: Iaaf34456136e873f1ce5a8fa573f40e22873f2c4
2023-05-24 20:29:01 +00:00
zhuhanrui
364def466a ANDROID: GKI: update symbol list file for xiaomi
INFO: 1 function symbol(s) added
  'int power_supply_is_system_supplied()'

Bug: 279705118

Change-Id: Ic4bd24a5c639f13ff78ee840ea52612bdd6078c6
Signed-off-by: zhuhanrui <zhuhanrui@xiaomi.corp-partner.google.com>
2023-05-24 18:32:27 +00:00
Carlos Llamas
96cc797d2c ANDROID: 5/24/2023 KMI update
Set KMI_GENERATION=7 for 5/24 KMI update

3 function symbol(s) removed
  'int mmu_interval_notifier_insert(struct mmu_interval_notifier*, struct mm_struct*, unsigned long, unsigned long, const struct mmu_interval_notifier_ops*)'
  'void mmu_interval_notifier_remove(struct mmu_interval_notifier*)'
  'unsigned long mmu_interval_read_begin(struct mmu_interval_notifier*)'

function symbol changed from 'int gh_rm_call(struct gh_rm*, u32, void*, size_t, void**, size_t*)' to 'int gh_rm_call(void*, u32, const void*, size_t, void**, size_t*)'
  CRC changed from 0xfef4ce1d to 0xaa8c9d60
  type changed from 'int(struct gh_rm*, u32, void*, size_t, void**, size_t*)' to 'int(void*, u32, const void*, size_t, void**, size_t*)'
    parameter 1 type changed from 'struct gh_rm*' to 'void*'
      pointed-to type changed from 'struct gh_rm' to 'void'
    parameter 3 type changed from 'void*' to 'const void*'
      pointed-to type changed from 'void' to 'const void'
        qualifier const added

function symbol changed from 'int gh_rm_notifier_register(struct gh_rm*, struct notifier_block*)' to 'int gh_rm_notifier_register(void*, struct notifier_block*)'
  CRC changed from 0x412fac09 to 0xd5a6a3c9
  type changed from 'int(struct gh_rm*, struct notifier_block*)' to 'int(void*, struct notifier_block*)'
    parameter 1 type changed from 'struct gh_rm*' to 'void*'
      pointed-to type changed from 'struct gh_rm' to 'void'

function symbol changed from 'int gh_rm_notifier_unregister(struct gh_rm*, struct notifier_block*)' to 'int gh_rm_notifier_unregister(void*, struct notifier_block*)'
  CRC changed from 0xf4d771f8 to 0x2c865d28
  type changed from 'int(struct gh_rm*, struct notifier_block*)' to 'int(void*, struct notifier_block*)'
    parameter 1 type changed from 'struct gh_rm*' to 'void*'
      pointed-to type changed from 'struct gh_rm' to 'void'

function symbol 'int ___pskb_trim(struct sk_buff*, unsigned int)' changed
  CRC changed from 0x6c6bbe0a to 0xaf3987c4

function symbol 'struct sk_buff* __alloc_skb(unsigned int, gfp_t, int, int)' changed
  CRC changed from 0xd9823116 to 0xa873df72

function symbol 'void __balance_callbacks(struct rq*)' changed
  CRC changed from 0x6537022 to 0xec0d081

... 1278 omitted; 1281 symbols have only CRC changes

type 'struct sock' changed
  byte size changed from 768 to 776
  member 'u64 android_oem_data1' was added

type 'struct freq_qos_request' changed
  byte size changed from 56 to 64
  member 'u64 android_oem_data1' was added

type 'struct dev_pm_qos_request' changed
  byte size changed from 72 to 80
  member 'union { struct plist_node pnode; struct pm_qos_flags_request flr; struct freq_qos_request freq; } data' changed
    type 'union { struct plist_node pnode; struct pm_qos_flags_request flr; struct freq_qos_request freq; }' changed
      byte size changed from 56 to 64
  member 'struct device* dev' changed
    offset changed by 64

type 'struct devfreq' changed
  byte size changed from 1720 to 1736
  member 'struct dev_pm_qos_request user_max_freq_req' changed
    offset changed by 64
  11 members ('unsigned long scaling_min_freq' .. 'struct notifier_block nb_max') changed
    offset changed by 128

type 'struct gh_rm_platform_ops' changed
  byte size changed from 16 to 48
  member changed from 'int(* pre_mem_share)(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(* pre_mem_share)(void*, struct gh_rm_mem_parcel*)'
    type changed from 'int(*)(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(*)(void*, struct gh_rm_mem_parcel*)'
      pointed-to type changed from 'int(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(void*, struct gh_rm_mem_parcel*)'
        parameter 1 type changed from 'struct gh_rm*' to 'void*'
          pointed-to type changed from 'struct gh_rm' to 'void'
  member changed from 'int(* post_mem_reclaim)(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(* post_mem_reclaim)(void*, struct gh_rm_mem_parcel*)'
    type changed from 'int(*)(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(*)(void*, struct gh_rm_mem_parcel*)'
      pointed-to type changed from 'int(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(void*, struct gh_rm_mem_parcel*)'
        parameter 1 type changed from 'struct gh_rm*' to 'void*'
          pointed-to type changed from 'struct gh_rm' to 'void'
  member 'u64 android_backport_reserved1' was added
  member 'u64 android_backport_reserved2' was added
  member 'u64 android_backport_reserved3' was added
  member 'u64 android_backport_reserved4' was added

type 'struct nf_conn' changed
  byte size changed from 248 to 256
  member 'u64 android_oem_data1' was added

type 'struct tipc_sock' changed
  byte size changed from 1008 to 1016
  31 members ('u32 max_pkt' .. 'u8 conn_addrtype') changed
    offset changed by 64

type 'struct vsock_sock' changed
  byte size changed from 1224 to 1232
  25 members ('const struct vsock_transport* transport' .. 'void* trans') changed
    offset changed by 64

type 'struct gh_rm_mem_parcel' changed
  byte size changed from 48 to 112
  member 'u64 android_backport_reserved1' was added
  member 'u64 android_backport_reserved2' was added
  member 'u64 android_backport_reserved3' was added
  member 'u64 android_backport_reserved4' was added
  member 'u64 android_backport_reserved5' was added
  member 'u64 android_backport_reserved6' was added
  member 'u64 android_backport_reserved7' was added
  member 'u64 android_backport_reserved8' was added

type 'struct gh_rm_mem_entry' changed
  member '__le64 phys_addr' was added
  member '__le64 ipa_base' was removed

Bug: 283322303
Change-Id: I62859d103cd2151a8417a09b639cadc658314263
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2023-05-24 14:06:40 +00:00
Elliot Berman
d469524df8 ANDROID: virt: gunyah: Add KABI reservations
Add KABI reservations in KMI-tracked Gunyah structures which aren't part
of the hypervisor ABI itself.

function symbol 'int devm_gh_rm_register_platform_ops(struct device*, struct gh_rm_platform_ops*)' changed
  CRC changed from 0x51bb297d to 0x1f3ae551

function symbol 'int gh_rm_register_platform_ops(struct gh_rm_platform_ops*)' changed
  CRC changed from 0xf2b08039 to 0xc34a7803

function symbol 'void gh_rm_unregister_platform_ops(struct gh_rm_platform_ops*)' changed
  CRC changed from 0x41e9ce79 to 0xc1f09d18

type 'struct gh_rm_platform_ops' changed
  byte size changed from 16 to 48
  member 'u64 android_backport_reserved1' was added
  member 'u64 android_backport_reserved2' was added
  member 'u64 android_backport_reserved3' was added
  member 'u64 android_backport_reserved4' was added

type 'struct gh_rm_mem_parcel' changed
  byte size changed from 48 to 112
  member 'u64 android_backport_reserved1' was added
  member 'u64 android_backport_reserved2' was added
  member 'u64 android_backport_reserved3' was added
  member 'u64 android_backport_reserved4' was added
  member 'u64 android_backport_reserved5' was added
  member 'u64 android_backport_reserved6' was added
  member 'u64 android_backport_reserved7' was added
  member 'u64 android_backport_reserved8' was added

Bug: 282937940
Change-Id: I5abcb52630747f85d1b9cab51ff23b5d0c595da2
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-05-24 13:22:36 +00:00
Elliot Berman
9b5a362323 ANDROID: virt: gunyah: Sync with KMI impacting changes from v13
Sync with latest Gunyah patches:

https://lore.kernel.org/all/20230509204801.2824351-7-quic_eberman@quicinc.com/
https://lore.kernel.org/all/20230509204801.2824351-10-quic_eberman@quicinc.com/

function symbol changed from 'int gh_rm_call(void*, u32, void*, size_t, void**, size_t*)' to 'int gh_rm_call(void*, u32, const void*, size_t, void**, size_t*)'
  CRC changed from 0x162db09d to 0xaa8c9d60
  type changed from 'int(void*, u32, void*, size_t, void**, size_t*)' to 'int(void*, u32, const void*, size_t, void**, size_t*)'
    parameter 3 type changed from 'void*' to 'const void*'
      pointed-to type changed from 'void' to 'const void'
        qualifier const added

function symbol 'int devm_gh_rm_register_platform_ops(struct device*, struct gh_rm_platform_ops*)' changed
  CRC changed from 0xa6a1478a to 0x51bb297d

function symbol 'int gh_rm_register_platform_ops(struct gh_rm_platform_ops*)' changed
  CRC changed from 0x110877e8 to 0xf2b08039

function symbol 'void gh_rm_unregister_platform_ops(struct gh_rm_platform_ops*)' changed
  CRC changed from 0x2e3c1910 to 0x41e9ce79

type 'struct gh_rm_mem_entry' changed
  member '__le64 phys_addr' was added
  member '__le64 ipa_base' was removed

Bug: 279506910
Change-Id: I50b0c67b9fcc33612e278de76feec6e4c85ac74a
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-05-24 13:22:36 +00:00
Elliot Berman
04ea3d3ace ANDROID: virt: gunyah: Force struct gh_rm as opaque
struct gh_rm is an opaque pointer to everyone not the Gunyah Resource
Manager itself (drivers/virt/gunyah/rsc_mgr.c). The resource manager
provides functions (gh_rm_call, gh_rm_{un}register_notifier) for
entities to communicate with the resource manager. An opaque pointer is
provided to those entities and passed back in when making those calls.

Although Linux CRCs would be unaffected by internal changes to struct
gh_rm, Android KMI tracking unrolls the definition of struct gh_rm it
finds in drivers/virt/gunyah/rsc_mgr.c and would be subject to KMI
freeze. Since this is a private structure not accessible to vendor/OEM
drivers, replace the "struct gh_rm *" with "void *" on any KMI-tracked
symbol.

function symbol changed from 'int gh_rm_call(struct gh_rm*, u32, void*, size_t, void**, size_t*)' to 'int gh_rm_call(void*, u32, void*, size_t, void**, size_t*)'
  CRC changed from 0xfef4ce1d to 0x162db09d
  type changed from 'int(struct gh_rm*, u32, void*, size_t, void**, size_t*)' to 'int(void*, u32, void*, size_t, void**, size_t*)'
    parameter 1 type changed from 'struct gh_rm*' to 'void*'
      pointed-to type changed from 'struct gh_rm' to 'void'

function symbol changed from 'int gh_rm_notifier_register(struct gh_rm*, struct notifier_block*)' to 'int gh_rm_notifier_register(void*, struct notifier_block*)'
  CRC changed from 0x412fac09 to 0xd5a6a3c9
  type changed from 'int(struct gh_rm*, struct notifier_block*)' to 'int(void*, struct notifier_block*)'
    parameter 1 type changed from 'struct gh_rm*' to 'void*'
      pointed-to type changed from 'struct gh_rm' to 'void'

function symbol changed from 'int gh_rm_notifier_unregister(struct gh_rm*, struct notifier_block*)' to 'int gh_rm_notifier_unregister(void*, struct notifier_block*)'
  CRC changed from 0xf4d771f8 to 0x2c865d28
  type changed from 'int(struct gh_rm*, struct notifier_block*)' to 'int(void*, struct notifier_block*)'
    parameter 1 type changed from 'struct gh_rm*' to 'void*'
      pointed-to type changed from 'struct gh_rm' to 'void'

function symbol 'int devm_gh_rm_register_platform_ops(struct device*, struct gh_rm_platform_ops*)' changed
  CRC changed from 0xb51b6569 to 0xa6a1478a

function symbol 'int gh_rm_register_platform_ops(struct gh_rm_platform_ops*)' changed
  CRC changed from 0xa577ae43 to 0x110877e8

function symbol 'void gh_rm_unregister_platform_ops(struct gh_rm_platform_ops*)' changed
  CRC changed from 0x5759f053 to 0x2e3c1910

type 'struct gh_rm_platform_ops' changed
  member changed from 'int(* pre_mem_share)(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(* pre_mem_share)(void*, struct gh_rm_mem_parcel*)'
    type changed from 'int(*)(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(*)(void*, struct gh_rm_mem_parcel*)'
      pointed-to type changed from 'int(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(void*, struct gh_rm_mem_parcel*)'
        parameter 1 type changed from 'struct gh_rm*' to 'void*'
          pointed-to type changed from 'struct gh_rm' to 'void'
  member changed from 'int(* post_mem_reclaim)(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(* post_mem_reclaim)(void*, struct gh_rm_mem_parcel*)'
    type changed from 'int(*)(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(*)(void*, struct gh_rm_mem_parcel*)'
      pointed-to type changed from 'int(struct gh_rm*, struct gh_rm_mem_parcel*)' to 'int(void*, struct gh_rm_mem_parcel*)'
        parameter 1 type changed from 'struct gh_rm*' to 'void*'
          pointed-to type changed from 'struct gh_rm' to 'void'

Bug: 282937940
Change-Id: Ie775c668c95bee0d1c91862eebf8fd0f606ff309
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2023-05-24 13:22:36 +00:00
Nick Desaulniers
062e3b40a3 Revert "ANDROID: gki_config: use DWARFv5 rather than DWARFv4"
This reverts commit 509a7a32a5.

Qualcomm is reporting that internal debugging tools in addition to
Lauterbach Trace32 (T32) debugger (vLT_20230509_159359) are having
issues with DWARFv5.

Since the change to the DWARF debug info format was made after the
Android Feature Complete deadline, revert it from android14-* kernel
branches. We'll leave DWARFv5 for android-mainline and try again next
release in android15-*.

Bug: 281863640
Reported-by: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>
Change-Id: I5a1657bdf6785d23f3492dc12e6f3df0954b8deb
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2023-05-24 13:22:36 +00:00
Junki Min
084bdc3991 ANDROID: ABI: Update symbol list for Exynos SoC
Update symbols of Exynos SGPU driver.
Some symbols are removed since Exynos SGPU driver use them anymore.

3 function symbol(s) removed
  'int mmu_interval_notifier_insert(struct mmu_interval_notifier*, struct mm_struct*, unsigned long, unsigned long, const struct mmu_interval_notifier_ops*)'
  'void mmu_interval_notifier_remove(struct mmu_interval_notifier*)'
  'unsigned long mmu_interval_read_begin(struct mmu_interval_notifier*)'

Bug: 280531400
Change-Id: I79b21e5fdea8ded36d4a3745b67a9b546f8cb776
Signed-off-by: Junki Min <joonki.min@samsung.com>
2023-05-24 13:22:32 +00:00
heshuai1
f99c6b4917 ANDROID: power: Add ANDROID_OEM_DATA in freq_qos_request.
Add ANDROID_OEM_DATA to implement the OEM's "frequency watchdog".
Related commit: aosp/2550631

Bug: 235925535
Bug: 281920779

Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: Ie2bfc7251266e22a5ee69b226dfd85d6e9cac2f5
(cherry picked from commit b7a7765d8af9896a30165a0c64758f2a67af938c)
2023-05-24 13:15:37 +00:00
Vignesh Saravanaperumal
d9146ee91d 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
2023-05-24 13:15:37 +00:00
Vignesh Saravanaperumal
4ef54c6ff7 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
2023-05-24 13:15:37 +00:00
Vignesh Saravanaperumal
b0e271f248 ANDROID: GKI: add vendor padding variable in struct sock
Some vendors want to add things to 'struct sock', so give them a u64
where they can then have a pointer off to their private data and they
can do whatever they want to do without breaking or changing any abi for
anyone else.

Note, usually an android trace hook is also needed to use this properly,
so be aware that this will be required as well.

Bug: 171013716
Signed-off-by: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Change-Id: Iab0b5570753d4a9722ecf9ca9eeb9b9887e2a9d9
2023-05-24 13:15:37 +00:00
Vignesh Saravanaperumal
18f9c42c86 ANDROID: GKI: add vendor padding variable in struct nf_conn
Some vendors want to add things to 'struct nf_conn', so give them a u64
where they can then have a pointer off to their private data and they
can do whatever they want to do without breaking or changing any abi for
anyone else.

Note, usually an android trace hook is also needed to use this properly,
so be aware that this will be required as well.

Bug: 171013716
Signed-off-by: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Change-Id: I245c162ee3fb083e3f39cf7bec3bd78cb624e005
2023-05-24 13:15:37 +00:00
Vignesh Saravanaperumal
0822f7154f ANDROID: GKI: add vendor padding variable in struct skb_shared_info
Some vendors want to add things to 'struct skb_shared_info', so give
them an array to place their data.

Bug: 171013716
Signed-off-by: Vignesh Saravanaperumal <vignesh1.s@samsung.com>
Change-Id: Ia0024e3e8de89f4ef335fa26208ec6c45abafb22
2023-05-24 13:15:36 +00:00
Tudor Ambarus
ae6e8fb652 UPSTREAM: ext4: avoid a potential slab-out-of-bounds in ext4_group_desc_csum
commit 4f04351888 upstream.

When modifying the block device while it is mounted by the filesystem,
syzbot reported the following:

BUG: KASAN: slab-out-of-bounds in crc16+0x206/0x280 lib/crc16.c:58
Read of size 1 at addr ffff888075f5c0a8 by task syz-executor.2/15586

CPU: 1 PID: 15586 Comm: syz-executor.2 Not tainted 6.2.0-rc5-syzkaller-00205-gc96618275234 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1b1/0x290 lib/dump_stack.c:106
 print_address_description+0x74/0x340 mm/kasan/report.c:306
 print_report+0x107/0x1f0 mm/kasan/report.c:417
 kasan_report+0xcd/0x100 mm/kasan/report.c:517
 crc16+0x206/0x280 lib/crc16.c:58
 ext4_group_desc_csum+0x81b/0xb20 fs/ext4/super.c:3187
 ext4_group_desc_csum_set+0x195/0x230 fs/ext4/super.c:3210
 ext4_mb_clear_bb fs/ext4/mballoc.c:6027 [inline]
 ext4_free_blocks+0x191a/0x2810 fs/ext4/mballoc.c:6173
 ext4_remove_blocks fs/ext4/extents.c:2527 [inline]
 ext4_ext_rm_leaf fs/ext4/extents.c:2710 [inline]
 ext4_ext_remove_space+0x24ef/0x46a0 fs/ext4/extents.c:2958
 ext4_ext_truncate+0x177/0x220 fs/ext4/extents.c:4416
 ext4_truncate+0xa6a/0xea0 fs/ext4/inode.c:4342
 ext4_setattr+0x10c8/0x1930 fs/ext4/inode.c:5622
 notify_change+0xe50/0x1100 fs/attr.c:482
 do_truncate+0x200/0x2f0 fs/open.c:65
 handle_truncate fs/namei.c:3216 [inline]
 do_open fs/namei.c:3561 [inline]
 path_openat+0x272b/0x2dd0 fs/namei.c:3714
 do_filp_open+0x264/0x4f0 fs/namei.c:3741
 do_sys_openat2+0x124/0x4e0 fs/open.c:1310
 do_sys_open fs/open.c:1326 [inline]
 __do_sys_creat fs/open.c:1402 [inline]
 __se_sys_creat fs/open.c:1396 [inline]
 __x64_sys_creat+0x11f/0x160 fs/open.c:1396
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f72f8a8c0c9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f72f97e3168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f72f8bac050 RCX: 00007f72f8a8c0c9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000280
RBP: 00007f72f8ae7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd165348bf R14: 00007f72f97e3300 R15: 0000000000022000

Replace
	le16_to_cpu(sbi->s_es->s_desc_size)
with
	sbi->s_desc_size

It reduces ext4's compiled text size, and makes the code more efficient
(we remove an extra indirect reference and a potential byte
swap on big endian systems), and there is no downside. It also avoids the
potential KASAN / syzkaller failure, as a bonus.

Reported-by: syzbot+fc51227e7100c9294894@syzkaller.appspotmail.com
Reported-by: syzbot+8785e41224a3afd04321@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?id=70d28d11ab14bd7938f3e088365252aa923cff42
Link: https://syzkaller.appspot.com/bug?id=b85721b38583ecc6b5e72ff524c67302abbc30f3
Link: https://lore.kernel.org/all/000000000000ece18705f3b20934@google.com/
Fixes: 717d50e497 ("Ext4: Uninitialized Block Groups")
Cc: stable@vger.kernel.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Link: https://lore.kernel.org/r/20230504121525.3275886-1-tudor.ambarus@linaro.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 269155298
Bug: 270466805
Change-Id: Id14192ab0905c36e154d07d461afb56af7b61488
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2023-05-24 06:38:08 +00:00
Kajetan Puchalski
43fd17a542 UPSTREAM: cpuidle: teo: Introduce util-awareness
Modern interactive systems, such as recent Android phones, tend to have
power efficient shallow idle states. Selecting deeper idle states on a
device while a latency-sensitive workload is running can adversely
impact performance due to increased latency. Additionally, if the CPU
wakes up from a deeper sleep before its target residency as is often the
case, it results in a waste of energy on top of that.

At the moment, none of the available idle governors take any scheduling
information into account. They also tend to overestimate the idle
duration quite often, which causes them to select excessively deep idle
states, thus leading to increased wakeup latency and lower performance
with no power saving. For 'menu' while web browsing on Android for
instance, those types of wakeups ('too deep') account for over 24% of
all wakeups.

At the same time, on some platforms idle state 0 can be power efficient
enough to warrant wanting to prefer it over idle state 1. This is
because the power usage of the two states can be so close that
sufficient amounts of too deep state 1 sleeps can completely offset the
state 1 power saving to the point where it would've been more power
efficient to just use state 0 instead. This is, of course, for systems
where state 0 is not a polling state, such as arm-based devices.

Sleeps that happened in state 0 while they could have used state 1 ('too
shallow') only save less power than they otherwise could have. Too deep
sleeps, on the other hand, harm performance and nullify the potential
power saving from using state 1 in the first place. While taking this
into account, it is clear that on balance it is preferable for an idle
governor to have more too shallow sleeps instead of more too deep sleeps
on those kinds of platforms.

This patch specifically tunes TEO to prefer shallower idle states in
order to reduce wakeup latency and achieve better performance.

To this end, before selecting the next idle state it uses the avg_util
signal of a CPU's runqueue in order to determine to what extent the CPU
is being utilized. This util value is then compared to a threshold
defined as a percentage of the CPU's capacity (capacity >> 6 ie. ~1.5%
in the current implementation). If the util is above the threshold, the
index of the idle state selected by TEO metrics will be reduced by 1,
thus selecting a shallower state. If the util is below the threshold,
the governor defaults to the TEO metrics mechanism to try to select the
deepest available idle state based on the closest timer event and its
own correctness.

The main goal of this is to reduce latency and increase performance for
some workloads. Under some workloads it will result in an increase in
power usage (Geekbench 5) while for other workloads it will also result
in a decrease in power usage compared to TEO (PCMark Web, Jankbench,
Speedometer).

It can provide drastically decreased latency and performance benefits in
certain types of workloads that are sensitive to latency.

Example test results:

1. GB5 (better score, latency & more power usage)

| metric                                | menu           | teo               | teo-util-aware    |
| ------------------------------------- | -------------- | ----------------- | ----------------- |
| gmean score                           | 2826.5 (0.0%)  | 2764.8 (-2.18%)   | 2865 (1.36%)      |
| gmean power usage [mW]                | 2551.4 (0.0%)  | 2606.8 (2.17%)    | 2722.3 (6.7%)     |
| gmean too deep %                      | 14.99%         | 9.65%             | 4.02%             |
| gmean too shallow %                   | 2.5%           | 5.96%             | 14.59%            |
| gmean task wakeup latency (asynctask) | 78.16μs (0.0%) | 61.60μs (-21.19%) | 54.45μs (-30.34%) |

2. Jankbench (better score, latency & less power usage)

| metric                                | menu           | teo               | teo-util-aware    |
| ------------------------------------- | -------------- | ----------------- | ----------------- |
| gmean frame duration                  | 13.9 (0.0%)    | 14.7 (6.0%)       | 12.6 (-9.0%)      |
| gmean jank percentage                 | 1.5 (0.0%)     | 2.1 (36.99%)      | 1.3 (-17.37%)     |
| gmean power usage [mW]                | 144.6 (0.0%)   | 136.9 (-5.27%)    | 121.3 (-16.08%)   |
| gmean too deep %                      | 26.00%         | 11.00%            | 2.54%             |
| gmean too shallow %                   | 4.74%          | 11.89%            | 21.93%            |
| gmean wakeup latency (RenderThread)   | 139.5μs (0.0%) | 116.5μs (-16.49%) | 91.11μs (-34.7%)  |
| gmean wakeup latency (surfaceflinger) | 124.0μs (0.0%) | 151.9μs (22.47%)  | 87.65μs (-29.33%) |

Bug: 258723112
Change-Id: Ifcf37e02c597ab5276656379d95dc6efc0d32771
Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
[ rjw: Comment edits and white space adjustments ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 9ce0f7c4bc)
Signed-off-by: Qais Yousef <qyousef@google.com>
2023-05-23 18:50:16 +00:00
Kajetan Puchalski
6b94fb8b5c UPSTREAM: cpuidle: teo: Optionally skip polling states in teo_find_shallower_state()
Add a no_poll flag to teo_find_shallower_state() that will let the
function optionally not consider polling states.

This allows the caller to guard against the function inadvertently
resulting in TEO putting the CPU in a polling state when that
behaviour is undesirable.

Bug: 258723112
Change-Id: I31553993715a25c3ed04ec985416cfb0e222973d
Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 27f8508801)
Signed-off-by: Qais Yousef <qyousef@google.com>
2023-05-23 18:50:16 +00:00
xieliujie
86a6bbdc8f ANDROID: ABI: Update oplus symbol list
1 function symbol(s) added
  'wait_queue_head_t* drm_crtc_vblank_waitqueue(struct drm_crtc*)'

Bug: 283132152
Change-Id: I7720932125ff7f00d7b8fbcdcf77ccd36fdc0969
Signed-off-by: xieliujie <xieliujie@oppo.com>
2023-05-23 18:06:03 +00:00
Jeson Gao
a4b671b432 ANDROID: thermal: Add vendor hooks for thermal
Need to get the request frequency and target frequency
use it to do frequency check and modify it according to
the platform thermal requirements.

Bug: 208166320

Signed-off-by: Jeson Gao <jeson.gao@unisoc.com>
Signed-off-by: Di Shen <di.shen@unisoc.com>
Change-Id: I776b43c8f559b8a072abd8d3abcb3528348b2c5d
(cherry picked from commit fc827b344f)
(cherry picked from commit 11f1be4453)
2023-05-23 13:56:53 +00:00
Dezhi Huang
549ce7cdbb ANDROID: GKI: Update symbol list for honor
INFO: ABI DIFFERENCES HAVE BEEN DETECTED!
INFO: 2 function symbol(s) added
  'int __traceiter_android_vh_get_page_wmark(void*, unsigned int, unsigned long*)'
  'int __traceiter_android_vh_page_add_new_anon_rmap(void*, struct page*, struct vm_area_struct*, unsigned long)'

INFO: 2 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_get_page_wmark'
  'struct tracepoint __tracepoint_android_vh_page_add_new_anon_rmap'

Bug: 279793368
Change-Id: Ib43b33d822accfae3d2910e984a8d057a89cb80a
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
2023-05-22 21:07:05 +00:00
Dezhi Huang
784f566942 ANDROID: mm: create vendor hooks for page alloc
Add vendor hook inside of get_page_from_freelist() to check
and modify the watermark in some special situations.
Additional page flag bit will be set for future identification.

Separately, a vendor hook inside of page_add_new_anon_rmap()
is added to set the referenced bit in some situations, e.g.
if the special bit in the page flag mentioned before is set,
we will give this page one more chance before it gets reclaimed.

Bug: 279793368
Change-Id: I363853a050a87201f6f368ccc580485dddd6c6b6
Signed-off-by: Dezhi Huang <huangdezhi@hihonor.com>
2023-05-22 21:07:05 +00:00
xieliujie
3abed61c35 ANDROID: ABI: Update oplus symbol list
1 function symbol(s) added
  'int __traceiter_android_vh_cpufreq_acct_update_power(void*, u64, struct task_struct*, unsigned int)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_cpufreq_acct_update_power'

Bug: 283132152
Change-Id: I7c766314f22e80678a03cc493520c7633c56594c
Signed-off-by: xieliujie <xieliujie@oppo.com>
2023-05-22 20:26:30 +00:00
zhengding chen
fdfaf852cd 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 3983753280)
2023-05-22 20:26:30 +00:00
Junki Min
e6c15792a6 ANDROID: ABI: Update symbol list for Exynos SoC
Update symbols of Exynos driver.
No function/variable symbols newly added/removed on ABI, but only
update list of Exynos.

Bug: 283658626
Signed-off-by: Junki Min <joonki.min@samsung.com>
Change-Id: Ib471bafa11943d7388de593712b114d17c72436c
2023-05-22 10:32:36 +09:00
xieliujie
cffbdd825e ANDROID: ABI: Update oplus symbol list
5 function symbol(s) added
  'int __traceiter_android_vh_dup_task_struct(void*, struct task_struct*, struct task_struct*)'
  'int __traceiter_android_vh_exit_signal(void*, struct task_struct*)'
  'int __traceiter_android_vh_irqtime_account_process_tick(void*, struct task_struct*, struct rq*, int, int)'
  'int __traceiter_android_vh_sched_stat_runtime_rt(void*, struct task_struct*, u64)'
  'int __traceiter_sched_stat_runtime(void*, struct task_struct*, u64, u64)'

5 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_dup_task_struct'
  'struct tracepoint __tracepoint_android_vh_exit_signal'
  'struct tracepoint __tracepoint_android_vh_irqtime_account_process_tick'
  'struct tracepoint __tracepoint_android_vh_sched_stat_runtime_rt'
  'struct tracepoint __tracepoint_sched_stat_runtime'

Bug: 283132152
Change-Id: Ia6e1b49df5e66b51d49e9a642b0dcf13598c6faa
Signed-off-by: xieliujie <xieliujie@oppo.com>
2023-05-19 19:41:20 +00:00
Liangliang Li
527e7b1ee8 ANDROID: vendor_hooks: Add hooks for account irqtime process tick
Add a hook in irqtime_account_process_tick, which helps to get
information about the high load task.

Bug: 187904818

Change-Id: I644f7d66b09d047ca6b0a0fbd2915a6387c8c007
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
(cherry picked from commit fe580539f6)
(cherry picked from commit bf3b384e08)
2023-05-19 19:41:20 +00:00
Liangliang Li
3b573277d4 ANDROID: vendor_hooks: Add hooks to dup_task_struct
Add hook to dup_task_struct for vendor data fields initialisation.

Bug: 188004638

Change-Id: I4b58604ee822fb8d1e0cc37bec72e820e7318427
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
(cherry picked from commit f66d96b14a)
(cherry picked from commit bafafe0ec4)
2023-05-19 19:41:20 +00:00
Liujie Xie
310995a546 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 a61d61bab7)
Signed-off-by: Carlos Llamas <cmllamas@google.com>
(cherry picked from commit b7a1174cc5dfc68cf769547b91958df407e55981)
(cherry picked from commit e1f430a487)
2023-05-19 19:41:20 +00:00
xieliujie
bf8bbc3ff8 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
(cherry picked from commit 709679142d583b0b7338d931fdd43b27b1bbf9e0)
(cherry picked from commit 226f36eddd)
2023-05-19 19:41:20 +00:00
Thierry Strudel
bfbebce3f7 ANDROID: power: wakeup_reason: change abort log
Logging callback symbolic name is generating too many different
messages making Abort analysis miss big trends.
Stick to console reported message providing sufficient information.

Bug: 280678242
Signed-off-by: Thierry Strudel <tstrudel@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:9f8f2ea03ede21d8928793c4be87eeb76d81bc7f)
Merged-In: Ic0ea662a60919454060e3a085aeabd8a4099e0b4
Change-Id: Ic0ea662a60919454060e3a085aeabd8a4099e0b4
2023-05-19 06:57:11 +00:00
xiaofeng
295ed6f497 ANDROID: GKI: Update symbol list for xiaomi
2 function symbol(s) added
  'int __traceiter_android_vh_psi_event(struct psi_trigger *t)'
  'int __traceiter_android_vh_psi_group(struct psi_group *group)'

2 variable symbol(s) added
  'struct tracepoint __tracepoint_android_vh_psi_event'
  'struct tracepoint __tracepoint_android_vh_psi_group'

Bug: 282873533
Change-Id: I8ea4ac7d986b18d41a42afb57f5fc6e90a9b3961
Signed-off-by: xiaofeng <xiaofeng5@xiaomi.com>
2023-05-18 21:53:34 +00:00
Georgi Djakov
d39f39ccb9 ANDROID: psi: Add vendor hooks for PSI tracing
Add hooks to capture various per-zone memory stats when
a trigger threshold is hit.

Bug: 268290366
Change-Id: Ibe39263ddb05ffc3fa63b5225497a90c6480c8d7
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
2023-05-18 21:53:34 +00:00
Theodore Ts'o
dbc72667a2 UPSTREAM: ext4: fix invalid free tracking in ext4_xattr_move_to_block()
commit b87c7cdf2b upstream.

In ext4_xattr_move_to_block(), the value of the extended attribute
which we need to move to an external block may be allocated by
kvmalloc() if the value is stored in an external inode.  So at the end
of the function the code tried to check if this was the case by
testing entry->e_value_inum.

However, at this point, the pointer to the xattr entry is no longer
valid, because it was removed from the original location where it had
been stored.  So we could end up calling kvfree() on a pointer which
was not allocated by kvmalloc(); or we could also potentially leak
memory by not freeing the buffer when it should be freed.  Fix this by
storing whether it should be freed in a separate variable.

Cc: stable@kernel.org
Link: https://lore.kernel.org/r/20230430160426.581366-1-tytso@mit.edu
Link: https://syzkaller.appspot.com/bug?id=5c2aee8256e30b55ccf57312c16d88417adbd5e1
Link: https://syzkaller.appspot.com/bug?id=41a6b5d4917c0412eb3b3c3c604965bed7d7420b
Reported-by: syzbot+64b645917ce07d89bde5@syzkaller.appspotmail.com
Reported-by: syzbot+0d042627c4f2ad332195@syzkaller.appspotmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 281332515
Bug: 281333738
Change-Id: Id1fbcc337821d66df53c2826bf3158963f8b0673
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
2023-05-18 21:46:56 +00:00
Alice Chao
7ce023f185 FROMGIT: scsi: ufs: core: mcq: Fix &hwq->cq_lock deadlock issue
When ufshcd_err_handler() is executed, CQ event interrupt can enter waiting
for the same lock. This can happen in ufshcd_handle_mcq_cq_events() and
also in ufs_mtk_mcq_intr(). The following warning message will be generated
when &hwq->cq_lock is used in IRQ context with IRQ enabled. Use
ufshcd_mcq_poll_cqe_lock() with spin_lock_irqsave instead of spin_lock to
resolve the deadlock issue.

[name:lockdep&]WARNING: inconsistent lock state
[name:lockdep&]--------------------------------
[name:lockdep&]inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage.
[name:lockdep&]kworker/u16:4/260 [HC0[0]:SC0[0]:HE1:SE1] takes:
  ffffff8028444600 (&hwq->cq_lock){?.-.}-{2:2}, at:
ufshcd_mcq_poll_cqe_lock+0x30/0xe0
[name:lockdep&]{IN-HARDIRQ-W} state was registered at:
  lock_acquire+0x17c/0x33c
  _raw_spin_lock+0x5c/0x7c
  ufshcd_mcq_poll_cqe_lock+0x30/0xe0
  ufs_mtk_mcq_intr+0x60/0x1bc [ufs_mediatek_mod]
  __handle_irq_event_percpu+0x140/0x3ec
  handle_irq_event+0x50/0xd8
  handle_fasteoi_irq+0x148/0x2b0
  generic_handle_domain_irq+0x4c/0x6c
  gic_handle_irq+0x58/0x134
  call_on_irq_stack+0x40/0x74
  do_interrupt_handler+0x84/0xe4
  el1_interrupt+0x3c/0x78
<snip>

Possible unsafe locking scenario:
       CPU0
       ----
  lock(&hwq->cq_lock);
  <Interrupt>
    lock(&hwq->cq_lock);
  *** DEADLOCK ***
2 locks held by kworker/u16:4/260:

[name:lockdep&]
 stack backtrace:
CPU: 7 PID: 260 Comm: kworker/u16:4 Tainted: G S      W  OE
6.1.17-mainline-android14-2-g277223301adb #1
Workqueue: ufs_eh_wq_0 ufshcd_err_handler

 Call trace:
  dump_backtrace+0x10c/0x160
  show_stack+0x20/0x30
  dump_stack_lvl+0x98/0xd8
  dump_stack+0x20/0x60
  print_usage_bug+0x584/0x76c
  mark_lock_irq+0x488/0x510
  mark_lock+0x1ec/0x25c
  __lock_acquire+0x4d8/0xffc
  lock_acquire+0x17c/0x33c
  _raw_spin_lock+0x5c/0x7c
  ufshcd_mcq_poll_cqe_lock+0x30/0xe0
  ufshcd_poll+0x68/0x1b0
  ufshcd_transfer_req_compl+0x9c/0xc8
  ufshcd_err_handler+0x3bc/0xea0
  process_one_work+0x2f4/0x7e8
  worker_thread+0x234/0x450
  kthread+0x110/0x134
  ret_from_fork+0x10/0x20

Bug: 267974767
(cherry picked from commit 948afc6961
 https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 6.4/scsi-staging)
Fixes: ed975065c3 ("scsi: ufs: core: mcq: Add completion support in poll")
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Alice Chao <alice.chao@mediatek.com>
Link: https://lore.kernel.org/r/20230424080400.8955-1-alice.chao@mediatek.com
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Change-Id: Ib75c41579138a14e820eba19b876cd4ae786dd67
Signed-off-by: Alice Chao <alice.chao@mediatek.com>
2023-05-18 21:32:33 +00:00
xieliujie
bae70267ba ANDROID: ABI: Update oplus symbol list
1 variable symbol(s) added
  'struct update_util_data* cpufreq_update_util_data'

Bug: 283132152
Change-Id: Icc09071a8d19608dd16a629980722dc958f54385
Signed-off-by: xieliujie <xieliujie@oppo.com>
2023-05-18 20:39:10 +00:00
Liujie Xie
2878003246 ANDROID: android: Export symbols for invoking cpufreq_update_util()
In order to update cpufreq, vendor modules invoke cpufreq_update_util(),
but when we build our modules, report error:
ERROR: modpost: "cpufreq_update_util_data" [xxx.ko] undefined!

Bug: 192218676
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: Ib1da70229f04b08d8d812d065021dec0bf891e0e
(cherry picked from commit 8943a2e7a3)
(cherry picked from commit d1bc61dd85e8d28f1df0e22e2d73aa9e99cb645e)
2023-05-18 20:39:10 +00:00
xieliujie
546b0f9d8b ANDROID: ABI: Update oplus symbol list
1 function symbol(s) added
  'int __traceiter_task_rename(void*, struct task_struct*, const char*)'

1 variable symbol(s) added
  'struct tracepoint __tracepoint_task_rename'

Bug: 283132152
Change-Id: Idbb6e338e0959b3cd2f5f4cc2f1e1ff17e4a9b72
Signed-off-by: xieliujie <xieliujie@oppo.com>
2023-05-18 20:38:34 +00:00
Liujie Xie
e3e91e9f2a ANDROID: vendor_hooks: Export the tracepoints task_rename
Export the tracepoint task_rename to identify specific new task,
to customize task's util for power and performance, or optimize
task schedule parameters.

Bug: 189985971

Change-Id: I3bb71eae316e3096d361e7b47012ba46ea4be509
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
(cherry picked from commit 016d3f7b69)
(cherry picked from commit cfc14a391adb4d44d8186694b4884815bd85be6c)
2023-05-18 20:38:34 +00:00
Veerendranath Jakkam
42b899d573 ANDROID: Add macros to create reserved data fields to backport upstream changes
Adds various macros to create reserved data fields in kernel data
structures before the freeze and to use reserved data fields to backport
upstream changes after the freeze.

Bug: 233387627
Change-Id: Ifbf8444861fa805593ce9b4837cd2653b7b7a0b0
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2023-05-18 18:16:11 +00:00
Minchan Kim
718da042d1 ANDROID: retry page allocation from buddy on lock contention
spin_trylock may fail due to a parallel drain in rmqueue_pcplist.
In the case, it should retry to allocate with buddy.
It matches with upstream policy.

Fixes: 433445e9a1 ("ANDROID: mm: add cma pcp list")
Change-Id: I07367888d7ede38e09f9d882fc2485baa175fe64
Signed-off-by: Minchan Kim <minchan@google.com>
2023-05-18 17:41:28 +00:00
Dan Carpenter
0ef5d2caad UPSTREAM: KVM: arm64: Fix buffer overflow in kvm_arm_set_fw_reg()
commit a25bc8486f upstream.

The KVM_REG_SIZE() comes from the ioctl and it can be a power of two
between 0-32768 but if it is more than sizeof(long) this will corrupt
memory.

Fixes: 99adb56763 ("KVM: arm/arm64: Add save/restore support for firmware workaround state")
Change-Id: I37107d3a62db584e9d026d5ecaf7d0cc15a4b716
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/4efbab8c-640f-43b2-8ac6-6d68e08280fe@kili.mountain
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 8d6a870a42)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-05-18 16:17:42 +00:00
Quentin Perret
270a77dd07 ANDROID: arm64: Check FGT cap before touching HFGWTR_EL2
Writing to HFGWTR_EL2 is undefined on CPUs without the capability,
so make sure not to touch the register when that is the case.

Bug: 282917063
Bug: 282993310
Change-Id: I85211105d6b1fbee854b4f13f037b8573c5a211c
Signed-off-by: Quentin Perret <qperret@google.com>
2023-05-18 09:10:22 +00:00
Quentin Perret
95cd5f8f94 Revert "ANDROID: Partially Revert "ANDROID: KVM: arm64: Allow tweaking HFGWTR_EL2 from modules""
This reverts commit 6cf9fb4579. It was a
temporary workaround which will be replaced a proper fix shortly.

Bug: 282917063
Bug: 282993310
Change-Id: I0caec4a63aabaecbf3fa7ec5d5b4c6930ea6efcd
Signed-off-by: Quentin Perret <qperret@google.com>
2023-05-18 09:10:22 +00:00