Commit Graph

979542 Commits

Author SHA1 Message Date
wangting11
2c68b9071d ANDROID: GKI: update xiaomi symbol list
Leaf changes summary: 17 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 10 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 7 Added variables

10 Added functions:

  [A] 'function int __traceiter_android_rvh_check_preempt_tick(void*, task_struct*, unsigned long int*, bool*, unsigned long int, cfs_rq*, sched_entity*, unsigned int)'
  [A] 'function int __traceiter_android_rvh_cpuset_fork(void*, task_struct*, int*)'
  [A] 'function int __traceiter_android_rvh_dequeue_entity(void*, cfs_rq*, sched_entity*)'
  [A] 'function int __traceiter_android_rvh_enqueue_entity(void*, cfs_rq*, sched_entity*)'
  [A] 'function int __traceiter_android_rvh_set_cpus_allowed_comm(void*, task_struct*, const cpumask*)'
  [A] 'function int __traceiter_android_vh_map_util_freq(void*, unsigned long int, unsigned long int, unsigned long int, unsigned long int*, cpufreq_policy*, bool*)'
  [A] 'function int __traceiter_android_vh_sched_setaffinity_early(void*, task_struct*, const cpumask*, int*)'
  [A] 'function void cpuset_cpus_allowed(task_struct*, cpumask*)'
  [A] 'function const char* drm_get_connector_type_name(unsigned int)'
  [A] 'function int gpio_request_array(const gpio*, size_t)'

7 Added variables:

  [A] 'tracepoint __tracepoint_android_rvh_check_preempt_tick'
  [A] 'tracepoint __tracepoint_android_rvh_cpuset_fork'
  [A] 'tracepoint __tracepoint_android_rvh_dequeue_entity'
  [A] 'tracepoint __tracepoint_android_rvh_enqueue_entity'
  [A] 'tracepoint __tracepoint_android_rvh_set_cpus_allowed_comm'
  [A] 'tracepoint __tracepoint_android_vh_map_util_freq'
  [A] 'tracepoint __tracepoint_android_vh_sched_setaffinity_early'

Bug: 197910412
Signed-off-by: ting wang <wangting11@xiaomi.com>
Change-Id: Iadbd3477ee983c254a06956295ce0a46b6dcbf91
2021-09-02 11:40:19 +00:00
Sami Tolvanen
8da32d526d ANDROID: cfi: explicitly clear diag in __cfi_slowpath
When CONFIG_CFI_PERMISSIVE is not set, ensure the third argument
passed to __cfi_check from __cfi_slowpath is NULL to avoid an invalid
memory access in __cfi_check_fail. __cfi_check_fail always traps
anyway, but the error message will be less confusing with this patch.

Note that kernels built with full LTO aren't affected as they always
clear the argument before a __cfi_slowpath call. Later kernel versions
are also not affected as they use -fno-sanitize-trap=cfi.

Bug: 196763360
Change-Id: Ifa5b4e324737a3069f7a772dd9b392042ec8407e
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
2021-09-02 08:55:56 +00:00
wangting11
b781144f8a ANDROID: GKI: update xiaomi symbol list
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 user_struct* find_user(kuid_t)'
  [A] 'function void free_uid(user_struct*)'

Bug: 197716484
Signed-off-by: ting wang <wangting11@xiaomi.com>
Change-Id: Ia0addb98ca8162fda44440262c32b6f37721de6c
2021-09-01 17:33:21 -07:00
huangqiujun
7ed18b3da9 ANDROID: GKI: Update symbols to symbol list
Update symbols to symbol list externed by oem modules.

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

10 Added functions:

  [A] 'function int __traceiter_android_vh_exclude_reserved_zone(void*, mm_struct*, vm_unmapped_area_info*)'
  [A] 'function int __traceiter_android_vh_exit_mm(void*, mm_struct*)'
  [A] 'function int __traceiter_android_vh_get_from_fragment_pool(void*, mm_struct*, vm_unmapped_area_info*, unsigned long int*)'
  [A] 'function int __traceiter_android_vh_include_reserved_zone(void*, mm_struct*, vm_unmapped_area_info*, unsigned long int*)'
  [A] 'function unsigned long int arch_mmap_rnd()'
  [A] 'function int ip_route_me_harder(net*, sock*, sk_buff*, unsigned int)'
  [A] 'function bool nf_ct_delete(nf_conn*, u32, int)'
  [A] 'function void tcp_parse_options(const net*, const sk_buff*, tcp_options_received*, int, tcp_fastopen_cookie*)'
  [A] 'function void unregister_net_sysctl_table(ctl_table_header*)'
  [A] 'function unsigned long int vm_unmapped_area(vm_unmapped_area_info*)'

4 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_exclude_reserved_zone'
  [A] 'tracepoint __tracepoint_android_vh_exit_mm'
  [A] 'tracepoint __tracepoint_android_vh_get_from_fragment_pool'
  [A] 'tracepoint __tracepoint_android_vh_include_reserved_zone'

Bug: 193384408

Change-Id: I894b9f459e1e8087d656af42470acef9f2839abc
Signed-off-by: huangqiujun <huangqiujun@oppo.com>
2021-08-30 12:33:56 +00:00
Kuan-Ying Lee
70fb50176e UPSTREAM: kasan, slub: reset tag when printing address
The address still includes the tags when it is printed.  With hardware
tag-based kasan enabled, we will get a false positive KASAN issue when
we access metadata.

Reset the tag before we access the metadata.

Link: https://lkml.kernel.org/r/20210804090957.12393-3-Kuan-Ying.Lee@mediatek.com
Fixes: aa1ef4d7b3 ("kasan, mm: reset tags when accessing metadata")
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Reviewed-by: Marco Elver <elver@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: Nicholas Tang <nicholas.tang@mediatek.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Bug: 197723947
(cherry picked from commit 340caf178d)
Change-Id: If721a44e7bb022fea317dfafb5252b13055eac7d
Signed-off-by: Yee Lee <yee.lee@mediatek.com>
2021-08-30 07:07:54 +00:00
Kuan-Ying Lee
bd5c75ce7b UPSTREAM: kasan, kmemleak: reset tags when scanning block
Patch series "kasan, slub: reset tag when printing address", v3.

With hardware tag-based kasan enabled, we reset the tag when we access
metadata to avoid from false alarm.

This patch (of 2):

Kmemleak needs to scan kernel memory to check memory leak.  With hardware
tag-based kasan enabled, when it scans on the invalid slab and
dereference, the issue will occur as below.

Hardware tag-based KASAN doesn't use compiler instrumentation, we can not
use kasan_disable_current() to ignore tag check.

Based on the below report, there are 11 0xf7 granules, which amounts to
176 bytes, and the object is allocated from the kmalloc-256 cache.  So
when kmemleak accesses the last 256-176 bytes, it causes faults, as those
are marked with KASAN_KMALLOC_REDZONE == KASAN_TAG_INVALID == 0xfe.

Thus, we reset tags before accessing metadata to avoid from false positives.

  BUG: KASAN: out-of-bounds in scan_block+0x58/0x170
  Read at addr f7ff0000c0074eb0 by task kmemleak/138
  Pointer tag: [f7], memory tag: [fe]

  CPU: 7 PID: 138 Comm: kmemleak Not tainted 5.14.0-rc2-00001-g8cae8cd89f05-dirty #134
  Hardware name: linux,dummy-virt (DT)
  Call trace:
   dump_backtrace+0x0/0x1b0
   show_stack+0x1c/0x30
   dump_stack_lvl+0x68/0x84
   print_address_description+0x7c/0x2b4
   kasan_report+0x138/0x38c
   __do_kernel_fault+0x190/0x1c4
   do_tag_check_fault+0x78/0x90
   do_mem_abort+0x44/0xb4
   el1_abort+0x40/0x60
   el1h_64_sync_handler+0xb4/0xd0
   el1h_64_sync+0x78/0x7c
   scan_block+0x58/0x170
   scan_gray_list+0xdc/0x1a0
   kmemleak_scan+0x2ac/0x560
   kmemleak_scan_thread+0xb0/0xe0
   kthread+0x154/0x160
   ret_from_fork+0x10/0x18

  Allocated by task 0:
   kasan_save_stack+0x2c/0x60
   __kasan_kmalloc+0xec/0x104
   __kmalloc+0x224/0x3c4
   __register_sysctl_paths+0x200/0x290
   register_sysctl_table+0x2c/0x40
   sysctl_init+0x20/0x34
   proc_sys_init+0x3c/0x48
   proc_root_init+0x80/0x9c
   start_kernel+0x648/0x6a4
   __primary_switched+0xc0/0xc8

  Freed by task 0:
   kasan_save_stack+0x2c/0x60
   kasan_set_track+0x2c/0x40
   kasan_set_free_info+0x44/0x54
   ____kasan_slab_free.constprop.0+0x150/0x1b0
   __kasan_slab_free+0x14/0x20
   slab_free_freelist_hook+0xa4/0x1fc
   kfree+0x1e8/0x30c
   put_fs_context+0x124/0x220
   vfs_kern_mount.part.0+0x60/0xd4
   kern_mount+0x24/0x4c
   bdev_cache_init+0x70/0x9c
   vfs_caches_init+0xdc/0xf4
   start_kernel+0x638/0x6a4
   __primary_switched+0xc0/0xc8

  The buggy address belongs to the object at ffff0000c0074e00
   which belongs to the cache kmalloc-256 of size 256
  The buggy address is located 176 bytes inside of
   256-byte region [ffff0000c0074e00, ffff0000c0074f00)
  The buggy address belongs to the page:
  page:(____ptrval____) refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x100074
  head:(____ptrval____) order:2 compound_mapcount:0 compound_pincount:0
  flags: 0xbfffc0000010200(slab|head|node=0|zone=2|lastcpupid=0xffff|kasantag=0x0)
  raw: 0bfffc0000010200 0000000000000000 dead000000000122 f5ff0000c0002300
  raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000
  page dumped because: kasan: bad access detected

  Memory state around the buggy address:
   ffff0000c0074c00: f0 f0 f0 f0 f0 f0 f0 f0 f0 fe fe fe fe fe fe fe
   ffff0000c0074d00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
  >ffff0000c0074e00: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 fe fe fe fe fe
                                                      ^
   ffff0000c0074f00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
   ffff0000c0075000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
  ==================================================================
  Disabling lock debugging due to kernel taint
  kmemleak: 181 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

Link: https://lkml.kernel.org/r/20210804090957.12393-1-Kuan-Ying.Lee@mediatek.com
Link: https://lkml.kernel.org/r/20210804090957.12393-2-Kuan-Ying.Lee@mediatek.com
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Marco Elver <elver@google.com>
Cc: Nicholas Tang <nicholas.tang@mediatek.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Bug: 197723947
(cherry picked from commit 6c7a00b843 )
Change-Id: I236560a20bafe78643a182fb4c82f0bd7d15ed87
Signed-off-by: Yee Lee <Yee.lee@mediatek.com>
2021-08-30 07:02:08 +00:00
Todd Kjos
b683931b2a ANDROID: gki_defconfig: set DEFAULT_MMAP_MIN_ADDR=32768
Set CONFIG_DEFAULT_MMAP_MIN_ADDR=32768 to conform with
existing CTS test (which had an issue that prevented
reliable detection of this setting).

Bug: 197914473
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I5a86a7b11d32adf8689657e4559c1d870a5562c4
2021-08-27 21:57:15 +00:00
Kuan-Ying Lee
c0cce1da8b UPSTREAM: kasan, slub: reset tag when printing address
The address still includes the tags when it is printed.  With hardware
tag-based kasan enabled, we will get a false positive KASAN issue when
we access metadata.

Reset the tag before we access the metadata.

Link: https://lkml.kernel.org/r/20210804090957.12393-3-Kuan-Ying.Lee@mediatek.com
Fixes: aa1ef4d7b3 ("kasan, mm: reset tags when accessing metadata")
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Reviewed-by: Marco Elver <elver@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: Nicholas Tang <nicholas.tang@mediatek.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 340caf178d)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I18dcd88e9e638f9454f5aecf7f71e8aecb14f7cf
2021-08-27 12:26:10 -07:00
David Brazdil
3b6f980a85 UPSTREAM: KVM: arm64: Fix off-by-one in range_is_memory
Hyp checks whether an address range only covers RAM by checking the
start/endpoints against a list of memblock_region structs. However,
the endpoint here is exclusive but internally is treated as inclusive.
Fix the off-by-one error that caused valid address ranges to be
rejected.

Cc: Quentin Perret <qperret@google.com>
Fixes: 90134ac9ca ("KVM: arm64: Protect the .hyp sections from the host")
Signed-off-by: David Brazdil <dbrazdil@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210728153232.1018911-2-dbrazdil@google.com
(cherry picked from commit facee1be76)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I44dbdbd9fde3c4a44e9af1ad317e0123d5472685
2021-08-27 12:26:10 -07:00
Qi Zheng
3649d38887 UPSTREAM: mm: fix the deadlock in finish_fault()
Commit 63f3655f95 ("mm, memcg: fix reclaim deadlock with writeback")
fix the following ABBA deadlock by pre-allocating the pte page table
without holding the page lock.

	                                lock_page(A)
                                        SetPageWriteback(A)
                                        unlock_page(A)
  lock_page(B)
                                        lock_page(B)
  pte_alloc_one
    shrink_page_list
      wait_on_page_writeback(A)
                                        SetPageWriteback(B)
                                        unlock_page(B)

                                        # flush A, B to clear the writeback

Commit f9ce0be71d ("mm: Cleanup faultaround and finish_fault()
codepaths") reworked the relevant code but ignored this race.  This will
cause the deadlock above to appear again, so fix it.

Link: https://lkml.kernel.org/r/20210721074849.57004-1-zhengqi.arch@bytedance.com
Fixes: f9ce0be71d ("mm: Cleanup faultaround and finish_fault() codepaths")
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit e4dc348914)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I80977e6cf60c938e98f17130233e776a2d097870
2021-08-27 12:26:10 -07:00
Mark Rutland
09ec66de84 UPSTREAM: arm64: mte: fix restoration of GCR_EL1 from suspend
Since commit:

  bad1e1c663 ("arm64: mte: switch GCR_EL1 in kernel entry and exit")

we saved/restored the user GCR_EL1 value at exception boundaries, and
update_gcr_el1_excl() is no longer used for this. However it is used to
restore the kernel's GCR_EL1 value when returning from a suspend state.
Thus, the comment is misleading (and an ISB is necessary).

When restoring the kernel's GCR value, we need an ISB to ensure this is
used by subsequent instructions. We don't necessarily get an ISB by
other means (e.g. if the kernel is built without support for pointer
authentication). As __cpu_setup() initialised GCR_EL1.Exclude to 0xffff,
until a context synchronization event, allocation tag 0 may be used
rather than the desired set of tags.

This patch drops the misleading comment, adds the missing ISB, and for
clarity folds update_gcr_el1_excl() into its only user.

Fixes: bad1e1c663 ("arm64: mte: switch GCR_EL1 in kernel entry and exit")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210714143843.56537-2-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit 59f44069e0)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I1be6e588f9796ca5f01d2e9bd5e9743c40dc0778
2021-08-27 12:26:10 -07:00
Cristian Marussi
1e8a0d84dc UPSTREAM: firmware: arm_scmi: Avoid padding in sensor message structure
scmi_resp_sensor_reading_complete structure is meant to represent an
SCMI asynchronous reading complete message. The readings field with
a 64bit type forces padding and breaks reads in scmi_sensor_reading_get.

Split it in two adjacent 32bit readings_low/high subfields to avoid the
padding within the structure. Alternatively we could to mark the structure
packed.

Link: https://lore.kernel.org/r/20210628170042.34105-1-cristian.marussi@arm.com
Fixes: e2083d3673 ("firmware: arm_scmi: Add SCMI v3.0 sensors timestamped reads")
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
(cherry picked from commit 187a002b07)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Iac7e24f178da3486df742a76280c3a9a85d130e7
2021-08-27 12:26:10 -07:00
Marek Szyprowski
ea6f697c3d UPSTREAM: media: s5p-mfc: Fix display delay control creation
v4l2_ctrl_new_std() fails if the caller provides no 'step' parameter for
integer control, so define it to fix following error:

s5p_mfc_dec_ctrls_setup:1166: Adding control (1) failed

Fixes: c3042bff91 ("media: s5p-mfc: Use display delay and display enable std controls")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
(cherry picked from commit 61c6f04a98)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ifda5a90145658218ec4d4d5603cba46a22597988
2021-08-27 12:26:09 -07:00
Heikki Krogerus
2f13bd8f39 UPSTREAM: software node: Handle software node injection to an existing device properly
The function software_node_notify() - the function that creates
and removes the symlinks between the node and the device - was
called unconditionally in device_add_software_node() and
device_remove_software_node(), but it needs to be called in
those functions only in the special case where the node is
added to a device that has already been registered.

This fixes NULL pointer dereference that happens if
device_remove_software_node() is used with device that was
never registered.

Fixes: b622b24519 ("software node: Allow node addition to already existing device")
Reported-and-tested-by: Dominik Brodowski <linux@dominikbrodowski.net>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 5dca69e26f)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I1caca7eaaf76e9b6e48151cecf2219743690ba93
2021-08-27 12:26:09 -07:00
Minas Harutyunyan
2f34733fae UPSTREAM: usb: dwc3: Fix debugfs creation flow
Creation EP's debugfs called earlier than debugfs folder for dwc3
device created. As result EP's debugfs are created in '/sys/kernel/debug'
instead of '/sys/kernel/debug/usb/dwc3.1.auto'.

Moved dwc3_debugfs_init() function call before calling
dwc3_core_init_mode() to allow create dwc3 debugfs parent before
creating EP's debugfs's.

Fixes: 8d396bb0a5 ("usb: dwc3: debugfs: Add and remove endpoint dirs dynamically")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Link: https://lore.kernel.org/r/01fafb5b2d8335e98e6eadbac61fc796bdf3ec1a.1623948457.git.Minas.Harutyunyan@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 84524d1232)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Iee342e3a25f29ef212414fcfc4d1dd340cc2d314
2021-08-27 12:26:09 -07:00
Peter Chen
d42ca898a6 UPSTREAM: usb: dwc3: core: fix kernel panic when do reboot
When do system reboot, it calls dwc3_shutdown and the whole debugfs
for dwc3 has removed first, when the gadget tries to do deinit, and
remove debugfs for its endpoints, it meets NULL pointer dereference
issue when call debugfs_lookup. Fix it by removing the whole dwc3
debugfs later than dwc3_drd_exit.

[ 2924.958838] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000002
....
[ 2925.030994] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--)
[ 2925.037005] pc : inode_permission+0x2c/0x198
[ 2925.041281] lr : lookup_one_len_common+0xb0/0xf8
[ 2925.045903] sp : ffff80001276ba70
[ 2925.049218] x29: ffff80001276ba70 x28: ffff0000c01f0000 x27: 0000000000000000
[ 2925.056364] x26: ffff800011791e70 x25: 0000000000000008 x24: dead000000000100
[ 2925.063510] x23: dead000000000122 x22: 0000000000000000 x21: 0000000000000001
[ 2925.070652] x20: ffff8000122c6188 x19: 0000000000000000 x18: 0000000000000000
[ 2925.077797] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000004
[ 2925.084943] x14: ffffffffffffffff x13: 0000000000000000 x12: 0000000000000030
[ 2925.092087] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f x9 : ffff8000102b2420
[ 2925.099232] x8 : 7f7f7f7f7f7f7f7f x7 : feff73746e2f6f64 x6 : 0000000000008080
[ 2925.106378] x5 : 61c8864680b583eb x4 : 209e6ec2d263dbb7 x3 : 000074756f307065
[ 2925.113523] x2 : 0000000000000001 x1 : 0000000000000000 x0 : ffff8000122c6188
[ 2925.120671] Call trace:
[ 2925.123119]  inode_permission+0x2c/0x198
[ 2925.127042]  lookup_one_len_common+0xb0/0xf8
[ 2925.131315]  lookup_one_len_unlocked+0x34/0xb0
[ 2925.135764]  lookup_positive_unlocked+0x14/0x50
[ 2925.140296]  debugfs_lookup+0x68/0xa0
[ 2925.143964]  dwc3_gadget_free_endpoints+0x84/0xb0
[ 2925.148675]  dwc3_gadget_exit+0x28/0x78
[ 2925.152518]  dwc3_drd_exit+0x100/0x1f8
[ 2925.156267]  dwc3_remove+0x11c/0x120
[ 2925.159851]  dwc3_shutdown+0x14/0x20
[ 2925.163432]  platform_shutdown+0x28/0x38
[ 2925.167360]  device_shutdown+0x15c/0x378
[ 2925.171291]  kernel_restart_prepare+0x3c/0x48
[ 2925.175650]  kernel_restart+0x1c/0x68
[ 2925.179316]  __do_sys_reboot+0x218/0x240
[ 2925.183247]  __arm64_sys_reboot+0x28/0x30
[ 2925.187262]  invoke_syscall+0x48/0x100
[ 2925.191017]  el0_svc_common.constprop.0+0x48/0xc8
[ 2925.195726]  do_el0_svc+0x28/0x88
[ 2925.199045]  el0_svc+0x20/0x30
[ 2925.202104]  el0_sync_handler+0xa8/0xb0
[ 2925.205942]  el0_sync+0x148/0x180
[ 2925.209270] Code: a9025bf5 2a0203f5 121f0056 370802b5 (79400660)
[ 2925.215372] ---[ end trace 124254d8e485a58b ]---
[ 2925.220012] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 2925.227676] Kernel Offset: disabled
[ 2925.231164] CPU features: 0x00001001,20000846
[ 2925.235521] Memory Limit: none
[ 2925.238580] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

Fixes: 5ff90af9da ("usb: dwc3: debugfs: Add and remove endpoint dirs dynamically")
Cc: Jack Pham <jackp@codeaurora.org>
Tested-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20210608105656.10795-1-peter.chen@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2a04276781)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Iddaf66ebdbc4074b55aa1acb7280608babb1665c
2021-08-27 12:26:09 -07:00
Marco Elver
71710d40d9 UPSTREAM: kfence: use TASK_IDLE when awaiting allocation
Since wait_event() uses TASK_UNINTERRUPTIBLE by default, waiting for an
allocation counts towards load.  However, for KFENCE, this does not make
any sense, since there is no busy work we're awaiting.

Instead, use TASK_IDLE via wait_event_idle() to not count towards load.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1185565
Link: https://lkml.kernel.org/r/20210521083209.3740269-1-elver@google.com
Fixes: 407f1d8c1b ("kfence: await for allocation using wait_event")
Signed-off-by: Marco Elver <elver@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: David Laight <David.Laight@ACULAB.COM>
Cc: Hillf Danton <hdanton@sina.com>
Cc: <stable@vger.kernel.org>	[5.12+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 8fd0e995cc)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I837f80e59c11d0322063bac0b2873c25ff528ab6
2021-08-27 12:26:09 -07:00
Axel Lin
1ea718cd9e UPSTREAM: regulator: scmi: Fix off-by-one for linear regulators .n_voltages setting
For linear regulators, the .n_voltages is (max_uv - min_uv) / uv_step + 1.

Fixes: 0fbeae70ee ("regulator: add SCMI driver")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20210521073020.1944981-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 36cb555fae)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I443aedf5fb2f0062e9e4926596ba649997f0afc9
2021-08-27 12:26:09 -07:00
Tudor Ambarus
be7c2833df UPSTREAM: clk: Skip clk provider registration when np is NULL
commit 6579c8d97a ("clk: Mark fwnodes when their clock provider is added")
revealed that clk/bcm/clk-raspberrypi.c driver calls
devm_of_clk_add_hw_provider(), with a NULL dev->of_node, which resulted in a
NULL pointer dereference in of_clk_add_hw_provider() when calling
fwnode_dev_initialized().

Returning 0 is reducing the if conditions in driver code and is being
consistent with the CONFIG_OF=n inline stub that returns 0 when CONFIG_OF
is disabled. The downside is that drivers will maybe register clkdev lookups
when they don't need to and waste some memory.

Fixes: 6579c8d97a ("clk: Mark fwnodes when their clock provider is added")
Fixes: 3c9ea42802 ("clk: Mark fwnodes when their clock provider is added/removed")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Reviewed-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20210426065618.588144-1-tudor.ambarus@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit bb4031b8af)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I13085a7a65f8577833fccafbfc42a8227bc562d8
2021-08-27 12:26:09 -07:00
Kyle Tso
f20cbf56db FROMGIT: usb: typec: tcpm: Raise vdm_sm_running flag only when VDM SM is running
If the port is going to send Discover_Identity Message, vdm_sm_running
flag was intentionally set before entering Ready States in order to
avoid the conflict because the port and the port partner might start
AMS at almost the same time after entering Ready States.

However, the original design has a problem. When the port is doing
DR_SWAP from Device to Host, it raises the flag. Later in the
tcpm_send_discover_work, the flag blocks the procedure of sending the
Discover_Identity and it might never be cleared until disconnection.

Since there exists another flag send_discover representing that the port
is going to send Discover_Identity or not, it is enough to use that flag
to prevent the conflict. Also change the timing of the set/clear of
vdm_sm_running to indicate whether the VDM SM is actually running or
not.

Fixes: c34e85fa69 ("usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work")
Cc: stable <stable@vger.kernel.org>
Cc: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210826124201.1562502-1-kyletso@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ef52b4a9fc
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus)

Bug: 191450181
Signed-off-by: Kyle Tso <kyletso@google.com>
Change-Id: I8cb84dfce764428a8fb33897f29fd8d0eb1c388e
2021-08-27 15:20:16 +00:00
Hans de Goede
b58b8007b1 FROMGIT: usb: typec: tcpm: Fix VDMs sometimes not being forwarded to alt-mode drivers
Commit a20dcf53ea ("usb: typec: tcpm: Respond Not_Supported if no
snk_vdo"), stops tcpm_pd_data_request() calling tcpm_handle_vdm_request()
when port->nr_snk_vdo is not set. But the VDM might be intended for an
altmode-driver, in which case nr_snk_vdo does not matter.

This change breaks the forwarding of connector hotplug (HPD) events
for displayport altmode on devices which don't set nr_snk_vdo.

tcpm_pd_data_request() is the only caller of tcpm_handle_vdm_request(),
so we can move the nr_snk_vdo check to inside it, at which point we
have already looked up the altmode device so we can check for this too.

Doing this check here also ensures that vdm_state gets set to
VDM_STATE_DONE if it was VDM_STATE_BUSY, even if we end up with
responding with PD_MSG_CTRL_NOT_SUPP later.

Note that tcpm_handle_vdm_request() was already sending
PD_MSG_CTRL_NOT_SUPP in some circumstances, after moving the nr_snk_vdo
check the same error-path is now taken when that check fails. So that
we have only one error-path for this and not two. Replace the
tcpm_queue_message(PD_MSG_CTRL_NOT_SUPP) used by the existing error-path
with the more robust tcpm_pd_handle_msg() from the (now removed) second
error-path.

Fixes: a20dcf53ea ("usb: typec: tcpm: Respond Not_Supported if no snk_vdo")
Cc: stable <stable@vger.kernel.org>
Cc: Kyle Tso <kyletso@google.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: Kyle Tso <kyletso@google.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210816154632.381968-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5571ea3117
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus)

Bug: 191450181
Signed-off-by: Kyle Tso <kyletso@google.com>
Change-Id: Iaeb5164f96ab2b6ff5d6d37e8824a01b0b63ae63
2021-08-27 15:19:42 +00:00
Jindong Yue
49a70f3362 ANDROID: GKI: Add usb/mmc/v4l2 related symbols for i.MX
Leaf changes summary: 29 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 29 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

29 Added functions:

  [A] 'function int __v4l2_ctrl_s_ctrl_int64(v4l2_ctrl*, s64)'
  [A] 'function int _vb2_fop_release(file*, mutex*)'
  [A] 'function unsigned long int* bitmap_alloc(unsigned int, unsigned int)'
  [A] 'function int ehci_handshake(ehci_hcd*, void*, u32, u32, int)'
  [A] 'function int ehci_hub_control(usb_hcd*, u16, u16, u16, char*, u16)'
  [A] 'function void ehci_init_driver(hc_driver*, const ehci_driver_overrides*)'
  [A] 'function int ehci_setup(usb_hcd*)'
  [A] 'function int gpiod_set_array_value_cansleep(unsigned int, gpio_desc**, gpio_array*, unsigned long int*)'
  [A] 'function void media_graph_walk_cleanup(media_graph*)'
  [A] 'function int media_graph_walk_init(media_graph*, media_device*)'
  [A] 'function int mmc_gpio_set_cd_wake(mmc_host*, bool)'
  [A] 'function int mmc_pwrseq_register(mmc_pwrseq*)'
  [A] 'function void mmc_pwrseq_unregister(mmc_pwrseq*)'
  [A] 'function void mmc_retune_timer_stop(mmc_host*)'
  [A] 'function int of_usb_update_otg_caps(device_node*, usb_otg_caps*)'
  [A] 'function power_supply* power_supply_get_by_phandle(device_node*, const char*)'
  [A] 'function void sdhci_dumpregs(sdhci_host*)'
  [A] 'function int sdhci_execute_tuning(mmc_host*, u32)'
  [A] 'function int sdhci_resume_host(sdhci_host*)'
  [A] 'function int sdhci_suspend_host(sdhci_host*)'
  [A] 'function void usb_phy_set_charger_state(usb_phy*, usb_charger_state)'
  [A] 'function void usb_phy_set_event(usb_phy*, unsigned long int)'
  [A] 'function void usb_udc_vbus_handler(usb_gadget*, bool)'
  [A] 'function v4l2_async_subdev* v4l2_async_notifier_add_devname_subdev(v4l2_async_notifier*, const char*, unsigned int)'
  [A] 'function int v4l2_ctrl_subdev_log_status(v4l2_subdev*)'
  [A] 'function int v4l2_g_parm_cap(video_device*, v4l2_subdev*, v4l2_streamparm*)'
  [A] 'function int v4l2_s_parm_cap(video_device*, v4l2_subdev*, v4l2_streamparm*)'
  [A] 'function int vb2_expbuf(vb2_queue*, v4l2_exportbuffer*)'
  [A] 'function size_t vb2_read(vb2_queue*, char*, size_t, loff_t*, int)'

Bug: 194108974
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: Ied5d5860e5c0be618f3b91b88226733bd57d8d80
2021-08-27 01:57:31 +00:00
Jindong Yue
e18d6a73b9 ANDROID: GKI: Add clk/pinctrl/irq related symbols for i.MX
Leaf changes summary: 53 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 50 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 3 Added variables

50 Added functions:

  [A] 'function void __bitmap_replace(unsigned long int*, const unsigned long int*, const unsigned long int*, const unsigned long int*, unsigned int)'
  [A] 'function clk_hw* __clk_hw_register_fixed_rate(device*, device_node*, const char*, const char*, const clk_hw*, const clk_parent_data*, unsigned long int, unsigned long int, unsigned long int, unsigned long int)'
  [A] 'function int __device_reset(device*, bool)'
  [A] 'function regmap* __regmap_init_mmio_clk(device*, const char*, void*, const regmap_config*, lock_class_key*, const char*)'
  [A] 'function int clk_bulk_get(device*, int, clk_bulk_data*)'
  [A] 'function void clk_bulk_put(int, clk_bulk_data*)'
  [A] 'function clk_hw* clk_hw_register_composite(device*, const char*, const char* const*, int, clk_hw*, const clk_ops*, clk_hw*, const clk_ops*, clk_hw*, const clk_ops*, unsigned long int)'
  [A] 'function bool clk_is_match(const clk*, const clk*)'
  [A] 'function unsigned int clk_mux_index_to_val(u32*, unsigned int, u8)'
  [A] 'function void dev_pm_opp_put_supported_hw(opp_table*)'
  [A] 'function int dev_pm_set_wake_irq(device*, int)'
  [A] 'function gpio_desc* devm_fwnode_gpiod_get_index(device*, fwnode_handle*, const char*, int, gpiod_flags, const char*)'
  [A] 'function irq_chip_generic* devm_irq_alloc_generic_chip(device*, const char*, int, unsigned int, void*, irq_flow_handler_t)'
  [A] 'function int devm_irq_setup_generic_chip(device*, irq_chip_generic*, u32, irq_gc_flags, unsigned int, unsigned int)'
  [A] 'function phy* devm_of_phy_get(device*, device_node*, const char*)'
  [A] 'function int dmaenginem_async_device_register(dma_device*)'
  [A] 'function int down_killable(semaphore*)'
  [A] 'function void* gen_pool_dma_alloc(gen_pool*, size_t, dma_addr_t*)'
  [A] 'function int gpiod_get_direction(gpio_desc*)'
  [A] 'function int ir_raw_event_store_edge(rc_dev*, bool)'
  [A] 'function irq_domain* irq_domain_add_legacy(device_node*, unsigned int, unsigned int, irq_hw_number_t, const irq_domain_ops*, void*)'
  [A] 'function void irq_gc_ack_set_bit(irq_data*)'
  [A] 'function void irq_gc_mask_clr_bit(irq_data*)'
  [A] 'function void irq_gc_mask_set_bit(irq_data*)'
  [A] 'function void mctrl_gpio_disable_ms(mctrl_gpios*)'
  [A] 'function void mctrl_gpio_enable_ms(mctrl_gpios*)'
  [A] 'function unsigned int mctrl_gpio_get(mctrl_gpios*, unsigned int*)'
  [A] 'function mctrl_gpios* mctrl_gpio_init(uart_port*, unsigned int)'
  [A] 'function void mctrl_gpio_set(mctrl_gpios*, unsigned int)'
  [A] 'function gen_pool* of_gen_pool_get(device_node*, const char*, int)'
  [A] 'function int of_genpd_add_subdomain(of_phandle_args*, of_phandle_args*)'
  [A] 'function int of_regulator_match(device*, device_node*, of_regulator_match*, unsigned int)'
  [A] 'function group_desc* pinctrl_generic_get_group(pinctrl_dev*, unsigned int)'
  [A] 'function int pinctrl_generic_get_group_count(pinctrl_dev*)'
  [A] 'function const char* pinctrl_generic_get_group_name(pinctrl_dev*, unsigned int)'
  [A] 'function int pinctrl_generic_get_group_pins(pinctrl_dev*, unsigned int, const unsigned int**, unsigned int*)'
  [A] 'function function_desc* pinmux_generic_get_function(pinctrl_dev*, unsigned int)'
  [A] 'function int pinmux_generic_get_function_count(pinctrl_dev*)'
  [A] 'function int pinmux_generic_get_function_groups(pinctrl_dev*, unsigned int, const char* const**, unsigned int* const)'
  [A] 'function const char* pinmux_generic_get_function_name(pinctrl_dev*, unsigned int)'
  [A] 'function void pwm_free(pwm_device*)'
  [A] 'function pwm_device* pwm_request(int, const char*)'
  [A] 'function int regulator_desc_list_voltage_linear_range(const regulator_desc*, unsigned int)'
  [A] 'function void reset_controller_unregister(reset_controller_dev*)'
  [A] 'function scatterlist* sg_last(scatterlist*, unsigned int)'
  [A] 'function int thermal_zone_bind_cooling_device(thermal_zone_device*, int, thermal_cooling_device*, unsigned long int, unsigned long int, unsigned int)'
  [A] 'function int timer_of_init(device_node*, timer_of*)'
  [A] 'function int uart_get_rs485_mode(uart_port*)'
  [A] 'function void uart_handle_cts_change(uart_port*, unsigned int)'
  [A] 'function void uart_handle_dcd_change(uart_port*, unsigned int)'

3 Added variables:

  [A] 'const clk_ops clk_fractional_divider_ops'
  [A] 'unsigned int hrtimer_resolution'
  [A] 'void ()* pm_power_off_prepare'

Bug: 194108974
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: Ida28fe4fbc488adc958e76cf40733a973848493e
2021-08-26 18:47:49 +00:00
Jindong Yue
7652f868f4 ANDROID: GKI: Add phy/net/pci related symbols for i.MX
Leaf changes summary: 65 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 65 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

65 Added functions:

  [A] 'function int __genphy_config_aneg(phy_device*, bool)'
  [A] 'function int __mdiobus_read(mii_bus*, int, u32)'
  [A] 'function int __mdiobus_write(mii_bus*, int, u32, u16)'
  [A] 'function int __phy_modify(phy_device*, u32, u16, u16)'
  [A] 'function int dw_pcie_ep_raise_legacy_irq(dw_pcie_ep*, u8)'
  [A] 'function int dw_pcie_ep_raise_msi_irq(dw_pcie_ep*, u8, u8)'
  [A] 'function int dw_pcie_ep_raise_msix_irq(dw_pcie_ep*, u8, u16)'
  [A] 'function void dw_pcie_ep_reset_bar(dw_pcie*, pci_barno)'
  [A] 'function u8 dw_pcie_find_capability(dw_pcie*, u8)'
  [A] 'function u16 dw_pcie_find_ext_capability(dw_pcie*, u8)'
  [A] 'function int dw_pcie_link_up(dw_pcie*)'
  [A] 'function int dw_pcie_wait_for_link(dw_pcie*)'
  [A] 'function int ethnl_cable_test_fault_length(phy_device*, u8, u32)'
  [A] 'function int ethnl_cable_test_result(phy_device*, u8, u8)'
  [A] 'function int genphy_aneg_done(phy_device*)'
  [A] 'function int genphy_read_abilities(phy_device*)'
  [A] 'function int genphy_read_lpa(phy_device*)'
  [A] 'function int genphy_read_mmd_unsupported(phy_device*, int, u16)'
  [A] 'function int genphy_read_status(phy_device*)'
  [A] 'function int genphy_soft_reset(phy_device*)'
  [A] 'function int genphy_suspend(phy_device*)'
  [A] 'function int genphy_update_link(phy_device*)'
  [A] 'function int genphy_write_mmd_unsupported(phy_device*, int, u16, u16)'
  [A] 'function int iw_handler_get_spy(net_device*, iw_request_info*, iwreq_data*, char*)'
  [A] 'function int iw_handler_get_thrspy(net_device*, iw_request_info*, iwreq_data*, char*)'
  [A] 'function int iw_handler_set_spy(net_device*, iw_request_info*, iwreq_data*, char*)'
  [A] 'function int iw_handler_set_thrspy(net_device*, iw_request_info*, iwreq_data*, char*)'
  [A] 'function char* iwe_stream_add_event(iw_request_info*, char*, char*, iw_event*, int)'
  [A] 'function char* iwe_stream_add_point(iw_request_info*, char*, char*, iw_event*, char*)'
  [A] 'function char* iwe_stream_add_value(iw_request_info*, char*, char*, char*, iw_event*, int)'
  [A] 'function void mdio_device_reset(mdio_device*, int)'
  [A] 'function bool mdiobus_is_registered_device(mii_bus*, int)'
  [A] 'function int of_get_phy_mode(device_node*, __anonymous_enum__*)'
  [A] 'function phy_device* of_phy_connect(net_device*, device_node*, void (net_device*)*, u32, phy_interface_t)'
  [A] 'function phy_device* of_phy_find_device(device_node*)'
  [A] 'function pci_power_t pci_choose_state(pci_dev*, pm_message_t)'
  [A] 'function void pci_disable_msix(pci_dev*)'
  [A] 'function int pci_enable_msix_range(pci_dev*, msix_entry*, int, int)'
  [A] 'function int pci_msi_enabled()'
  [A] 'function int pci_reset_function(pci_dev*)'
  [A] 'function int pci_try_set_mwi(pci_dev*)'
  [A] 'function int phy_drivers_register(phy_driver*, int, module*)'
  [A] 'function void phy_drivers_unregister(phy_driver*, int)'
  [A] 'function int phy_init_hw(phy_device*)'
  [A] 'function int phy_modify(phy_device*, unsigned int, unsigned short int, unsigned short int)'
  [A] 'function int phy_modify_changed(phy_device*, u32, u16, u16)'
  [A] 'function int phy_modify_paged(phy_device*, int, u32, u16, u16)'
  [A] 'function int phy_modify_paged_changed(phy_device*, int, u32, u16, u16)'
  [A] 'function int phy_read_mmd(phy_device*, int, unsigned int)'
  [A] 'function int phy_read_paged(phy_device*, int, u32)'
  [A] 'function void phy_remove_link_mode(phy_device*, u32)'
  [A] 'function int phy_reset_after_clk_enable(phy_device*)'
  [A] 'function void phy_resolve_aneg_pause(phy_device*)'
  [A] 'function int phy_restore_page(phy_device*, int, int)'
  [A] 'function int phy_select_page(phy_device*, int)'
  [A] 'function int phy_set_max_speed(phy_device*, u32)'
  [A] 'function void phy_set_sym_pause(phy_device*, bool, bool, bool)'
  [A] 'function void phy_support_sym_pause(phy_device*)'
  [A] 'function int phy_write_mmd(phy_device*, int, unsigned int, unsigned short int)'
  [A] 'function int phy_write_paged(phy_device*, int, u32, u16)'
  [A] 'function u64 timecounter_cyc2time(timecounter*, u64)'
  [A] 'function void tso_build_data(const sk_buff*, tso_t*, int)'
  [A] 'function void tso_build_hdr(const sk_buff*, char*, tso_t*, int, bool)'
  [A] 'function int tso_count_descs(const sk_buff*)'
  [A] 'function int tso_start(sk_buff*, tso_t*)'

Bug: 194108974
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: I8d6810c2df3ea9b584d149c4508061fd86886d50
2021-08-26 14:33:24 +00:00
Jindong Yue
d587a4f210 ANDROID: GKI: Add audio/rproc related symbols for i.MX
Leaf changes summary: 31 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 31 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

31 Added functions:

  [A] 'function mbox_chan* mbox_request_channel_byname(mbox_client*, const char*)'
  [A] 'function int regmap_attach_dev(device*, regmap*, const regmap_config*)'
  [A] 'function int rpmsg_sendto(rpmsg_endpoint*, void*, int, u32)'
  [A] 'function int rpmsg_trysendto(rpmsg_endpoint*, void*, int, u32)'
  [A] 'function void rproc_add_carveout(rproc*, rproc_mem_entry*)'
  [A] 'function void* rproc_da_to_va(rproc*, u64, size_t, bool*)'
  [A] 'function resource_table* rproc_elf_find_loaded_rsc_table(rproc*, const firmware*)'
  [A] 'function int rproc_elf_load_rsc_table(rproc*, const firmware*)'
  [A] 'function int rproc_elf_load_segments(rproc*, const firmware*)'
  [A] 'function int rproc_elf_sanity_check(rproc*, const firmware*)'
  [A] 'function rproc_mem_entry* rproc_mem_entry_init(device*, void*, dma_addr_t, size_t, u32, int (rproc*, rproc_mem_entry*)*, int (rproc*, rproc_mem_entry*)*, const char*, ...)'
  [A] 'function int rproc_of_parse_firmware(device*, int, const char**)'
  [A] 'function irqreturn_t rproc_vq_interrupt(rproc*, int)'
  [A] 'function int snd_dmaengine_pcm_close_release_chan(snd_pcm_substream*)'
  [A] 'function dma_chan* snd_dmaengine_pcm_get_chan(snd_pcm_substream*)'
  [A] 'function int snd_dmaengine_pcm_open(snd_pcm_substream*, dma_chan*)'
  [A] 'function int snd_dmaengine_pcm_open_request_chan(snd_pcm_substream*, dma_filter_fn, void*)'
  [A] 'function snd_pcm_uframes_t snd_dmaengine_pcm_pointer(snd_pcm_substream*)'
  [A] 'function int snd_dmaengine_pcm_refine_runtime_hwparams(snd_pcm_substream*, snd_dmaengine_dai_dma_data*, snd_pcm_hardware*, dma_chan*)'
  [A] 'function void snd_dmaengine_pcm_set_config_from_dai_data(const snd_pcm_substream*, const snd_dmaengine_dai_dma_data*, dma_slave_config*)'
  [A] 'function int snd_dmaengine_pcm_trigger(snd_pcm_substream*, int)'
  [A] 'function int snd_hwparams_to_dma_slave_config(const snd_pcm_substream*, const snd_pcm_hw_params*, dma_slave_config*)'
  [A] 'function int snd_pcm_format_big_endian(snd_pcm_format_t)'
  [A] 'function int snd_pcm_format_linear(snd_pcm_format_t)'
  [A] 'function int snd_pcm_format_unsigned(snd_pcm_format_t)'
  [A] 'function int snd_soc_dai_active(snd_soc_dai*)'
  [A] 'function snd_pcm_substream* snd_soc_dpcm_get_substream(snd_soc_pcm_runtime*, int)'
  [A] 'function int snd_soc_get_dai_name(of_phandle_args*, const char**)'
  [A] 'function void snd_soc_jack_notifier_register(snd_soc_jack*, notifier_block*)'
  [A] 'function snd_soc_component* snd_soc_lookup_component_nolocked(device*, const char*)'
  [A] 'function const soc_device_attribute* soc_device_match(const soc_device_attribute*)'

Bug: 194108974
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: I115a71eb56747c3edcf54ccacd832917140080e4
2021-08-26 12:31:18 +00:00
Jindong Yue
e8ab8b22f1 ANDROID: GKI: Add display related symbols for i.MX
Leaf changes summary: 60 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 60 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

60 Added functions:

  [A] 'function void cec_fill_conn_info_from_drm(cec_connector_info*, const drm_connector*)'
  [A] 'function cec_notifier* cec_notifier_cec_adap_register(device*, const char*, cec_adapter*)'
  [A] 'function void cec_notifier_cec_adap_unregister(cec_notifier*, cec_adapter*)'
  [A] 'function cec_notifier* cec_notifier_conn_register(device*, const char*, const cec_connector_info*)'
  [A] 'function void cec_notifier_conn_unregister(cec_notifier*)'
  [A] 'function void cec_notifier_set_phys_addr(cec_notifier*, u16)'
  [A] 'function void cec_notifier_set_phys_addr_from_edid(cec_notifier*, const edid*)'
  [A] 'function drm_bridge* devm_drm_panel_bridge_add(device*, drm_panel*)'
  [A] 'function phy* devm_phy_optional_get(device*, const char*)'
  [A] 'function void devm_remove_action(device*, void (void*)*, void*)'
  [A] 'function drm_bridge_state* drm_atomic_get_new_bridge_state(drm_atomic_state*, drm_bridge*)'
  [A] 'function u32* drm_atomic_helper_bridge_propagate_bus_fmt(drm_bridge*, drm_bridge_state*, drm_crtc_state*, drm_connector_state*, u32, unsigned int*)'
  [A] 'function void drm_atomic_helper_commit_tail_rpm(drm_atomic_state*)'
  [A] 'function void drm_bridge_connector_disable_hpd(drm_connector*)'
  [A] 'function void drm_bridge_connector_enable_hpd(drm_connector*)'
  [A] 'function drm_connector* drm_bridge_connector_init(drm_device*, drm_encoder*)'
  [A] 'function void drm_bus_flags_from_videomode(const videomode*, u32*)'
  [A] 'function int drm_connector_attach_content_protection_property(drm_connector*, bool)'
  [A] 'function int drm_connector_attach_max_bpc_property(drm_connector*, int, int)'
  [A] 'function int drm_connector_set_panel_orientation(drm_connector*, drm_panel_orientation)'
  [A] 'function hdmi_quantization_range drm_default_rgb_quant_range(const drm_display_mode*)'
  [A] 'function int drm_display_info_set_bus_formats(drm_display_info*, const u32*, unsigned int)'
  [A] 'function drm_gem_object* drm_gem_cma_create_object_default_funcs(drm_device*, size_t)'
  [A] 'function int drm_gem_cma_dumb_create(drm_file*, drm_device*, drm_mode_create_dumb*)'
  [A] 'function int drm_hdcp_check_ksvs_revoked(drm_device*, u8*, u32)'
  [A] 'function void drm_hdmi_avi_infoframe_colorspace(hdmi_avi_infoframe*, const drm_connector_state*)'
  [A] 'function void drm_hdmi_avi_infoframe_quant_range(hdmi_avi_infoframe*, const drm_connector*, const drm_display_mode*, hdmi_quantization_range)'
  [A] 'function int drm_hdmi_vendor_infoframe_from_display_mode(hdmi_vendor_infoframe*, const drm_connector*, const drm_display_mode*)'
  [A] 'function int drm_mode_create_hdmi_colorspace_property(drm_connector*)'
  [A] 'function drm_display_mode* drm_mode_find_dmt(drm_device*, int, int, int, bool)'
  [A] 'function bool drm_mode_is_420_also(const drm_display_info*, const drm_display_mode*)'
  [A] 'function int drm_of_encoder_active_endpoint(device_node*, drm_encoder*, of_endpoint*)'
  [A] 'function int drm_of_find_panel_or_bridge(const device_node*, int, int, drm_panel**, drm_bridge**)'
  [A] 'function drm_bridge* drm_panel_bridge_add_typed(drm_panel*, u32)'
  [A] 'function void drm_panel_bridge_remove(drm_bridge*)'
  [A] 'function int drm_panel_of_backlight(drm_panel*)'
  [A] 'function int drm_plane_create_color_properties(drm_plane*, u32, u32, drm_color_encoding, drm_color_range)'
  [A] 'function void drm_property_destroy(drm_device*, drm_property*)'
  [A] 'function ssize_t drm_scdc_read(i2c_adapter*, u8, void*, size_t)'
  [A] 'function bool drm_scdc_set_high_tmds_clock_ratio(i2c_adapter*, bool)'
  [A] 'function bool drm_scdc_set_scrambling(i2c_adapter*, bool)'
  [A] 'function ssize_t drm_scdc_write(i2c_adapter*, u8, void*, size_t)'
  [A] 'function int hdmi_avi_infoframe_check(hdmi_avi_infoframe*)'
  [A] 'function ssize_t hdmi_drm_infoframe_pack(hdmi_drm_infoframe*, void*, size_t)'
  [A] 'function ssize_t hdmi_vendor_infoframe_pack(hdmi_vendor_infoframe*, void*, size_t)'
  [A] 'function int mipi_dsi_dcs_enter_sleep_mode(mipi_dsi_device*)'
  [A] 'function int mipi_dsi_dcs_exit_sleep_mode(mipi_dsi_device*)'
  [A] 'function int mipi_dsi_dcs_get_display_brightness(mipi_dsi_device*, u16*)'
  [A] 'function int mipi_dsi_dcs_set_display_off(mipi_dsi_device*)'
  [A] 'function int mipi_dsi_dcs_set_display_on(mipi_dsi_device*)'
  [A] 'function int mipi_dsi_dcs_set_pixel_format(mipi_dsi_device*, u8)'
  [A] 'function int mipi_dsi_dcs_set_tear_on(mipi_dsi_device*, mipi_dsi_dcs_tear_mode)'
  [A] 'function int mipi_dsi_dcs_set_tear_scanline(mipi_dsi_device*, u16)'
  [A] 'function int mipi_dsi_dcs_soft_reset(mipi_dsi_device*)'
  [A] 'function int of_drm_get_panel_orientation(const device_node*, drm_panel_orientation*)'
  [A] 'function int of_get_display_timing(const device_node*, const char*, display_timing*)'
  [A] 'function i2c_adapter* of_get_i2c_adapter_by_node(device_node*)'
  [A] 'function int phy_mipi_dphy_get_default_config(unsigned long int, unsigned int, unsigned int, phy_configure_opts_mipi_dphy*)'
  [A] 'function int phy_validate(phy*, phy_mode, int, phy_configure_opts*)'
  [A] 'function void videomode_from_timing(const display_timing*, videomode*)'

Bug: 194108974
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: Ide4bc8d26f9968079b73d8f4204cef35992a9f62
2021-08-26 12:29:40 +00:00
Wesley Cheng
8cfe4f1f9e FROMLIST: usb: dwc3: gadget: Stop EP0 transfers during pullup disable
During a USB cable disconnect, or soft disconnect scenario, a pending
SETUP transaction may not be completed, leading to the following
error:

    dwc3 a600000.dwc3: timed out waiting for SETUP phase

If this occurs, then the entire pullup disable routine is skipped and
proper cleanup and halting of the controller does not complete.

Instead of returning an error (which is ignored from the UDC
perspective), allow the pullup disable routine to continue, which
will also handle disabling of EP0/1.  This will end any active
transfers as well.  Ensure to clear any delayed_status also, as the
timeout could happen within the STATUS stage.

Cc: <stable@vger.kernel.org>
Fixes: bb01473648 ("usb: dwc3: gadget: don't clear RUN/STOP when it's invalid to do so")
Reviewed-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>

Bug: 196421704
Link: https://lore.kernel.org/linux-usb/20210825042855.7977-1-wcheng@codeaurora.org/
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Change-Id: Ia3077a4588f63a2bbe0cd97af1fd748228f2ed07
2021-08-25 20:35:19 +00:00
Nitin Rawat
f90feddc7e ANDROID: abi_gki_aarch64_qcom: Add mmc clk scaling functions
Leaf changes summary: 10 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 10 Added
functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added
variable

10 Added functions:

[A] 'function int mmc_hs200_tuning(mmc_card*)'
[A] 'function mmc_issue_type mmc_issue_type(mmc_queue*, request*)'
[A] 'function int mmc_select_bus_width(mmc_card*)'
[A] 'function int mmc_select_hs(mmc_card*)'
[A] 'function int mmc_select_hs400(mmc_card*)'
[A] 'function int mmc_select_hs_ddr(mmc_card*)'
[A] 'function int mmc_select_timing(mmc_card*)'
[A] 'function void mmc_set_clock(mmc_host*, unsigned int)'
[A] 'function void mmc_set_initial_state(mmc_host*)'
[A] 'function void mmc_set_timing(mmc_host*, unsigned int)'

Bug: 192337957
Change-Id: Ie32ae76557a56ab6cfc747e9e13ec3f9f6cf71c2
Signed-off-by: Ram Prakash Gupta <ramprka@codeaurora.org>
Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>
2021-08-25 15:45:13 +05:30
Ram Prakash Gupta
072eded7ca FROMLIST: mmc: core: Export core functions required for clk scaling
Export core function required for clk scaling post design change.
This would help make clk scaling part of vendor module.

Bug: 192337957
Link: https://lore.kernel.org/lkml/1571668177-3766-2-git-send-email-
rampraka@codeaurora.org/
Change-Id: I0c5eccb2052197b3a290f7322429cab679c5ade5
Signed-off-by: Nitin Rawat <nitirawa@codeaurora.org>
Signed-off-by: Ram Prakash Gupta <rampraka@codeaurora.org>
2021-08-25 15:44:36 +05:30
huangqiujun
bef08a94ff ANDROID: GKI: Update symbols to symbol list
Update symbols to symbol list externed by oem modules.

Leaf changes summary: 15 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 8 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 7 Added variables

8 Added functions:

  [A] 'function int __traceiter_android_vh_account_task_time(void*, task_struct*, rq*, int)'
  [A] 'function int __traceiter_android_vh_binder_priority_skip(void*, task_struct*, bool*)'
  [A] 'function int __traceiter_android_vh_process_killed(void*, task_struct*, bool*)'
  [A] 'function int __traceiter_android_vh_tune_inactive_ratio(void*, unsigned long int*, int)'
  [A] 'function int __traceiter_sched_stat_blocked(void*, task_struct*, u64)'
  [A] 'function int __traceiter_sched_stat_iowait(void*, task_struct*, u64)'
  [A] 'function int __traceiter_sched_stat_wait(void*, task_struct*, u64)'
  [A] 'function int __traceiter_task_rename(void*, task_struct*, const char*)'

7 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_account_task_time'
  [A] 'tracepoint __tracepoint_android_vh_binder_priority_skip'
  [A] 'tracepoint __tracepoint_android_vh_tune_inactive_ratio'
  [A] 'tracepoint __tracepoint_sched_stat_blocked'
  [A] 'tracepoint __tracepoint_sched_stat_iowait'
  [A] 'tracepoint __tracepoint_sched_stat_wait'
  [A] 'tracepoint __tracepoint_task_rename'

Bug: 193384408

Change-Id: I4a7a80787e872b633e2dd3950f5bc8fae813f798
Signed-off-by: huangqiujun <huangqiujun@oppo.com>
2021-08-25 01:17:36 +00:00
Maulik Shah
ffa937b6db ANDROID: abi_gki_aarch64_qcom: Add irq_domain_disconnect_hierarchy symbol
This change adds irq_domain_disconnect_hierarchy symbol to whitelist.

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 int irq_domain_disconnect_hierarchy(irq_domain*,
unsigned int)'

Bug: 196928089
Change-Id: I43c1c4fc04ffe7e75a4a7126ea1e2cb74182ae79
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
2021-08-25 00:42:01 +00:00
Marc Zyngier
34f60eead2 FROMGIT: irqchip/qcom-pdc: Trim unused levels of the interrupt hierarchy
The QCOM PDC driver creates a bunch of unnecessary levels in
the interrupt hierarchy when dealing with non-wakeup-capable
interrupts. By definition, these lines are terminated at the
PDC level, and everything below this is completely fake.

This also results in additional complexity as most of the
callbacks have to check for the validity of the parent level.
Needless to say, this doesn't look very good.

Solve this by disconnecting the interrupt hierarchy below
the last valid level, and considerably simplify the handling
of all the other interrupts by avoiding now unnecessary cheks.
In most cases, the standard irq_*_parent() handlers are directly
used.

This also cures an issue reporting by Maulik where gpio_to_irq()
returns an error after having observed a set of invalid levels.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Tested-by: Maulik Shah <mkshah@codeaurora.org>
Link: https://lore.kernel.org/r/1629705880-27877-3-git-send-email-mkshah@codeaurora.org

Bug: 196928089
(cherry picked from commit 9d4f24bfe0
https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/irqchip-next)

Change-Id: Idec7d3b80e0d170be425f1e24efd41ad451bff4e
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
2021-08-25 00:41:53 +00:00
Maulik Shah
4c9aa4c6f0 FROMGIT: irqdomain: Export irq_domain_disconnect_hierarchy()
Export irq_domain_disconnect_hierarchy() so irqchip module drivers
can use it.

Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/1629705880-27877-2-git-send-email-mkshah@codeaurora.org

Bug: 196928089
(cherry picked from commit 131d326ba9
https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git irq/irqchip-next)

Change-Id: Ia38d7a23f60930970dde2edfad95a6924e807939
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
2021-08-25 00:41:42 +00:00
Siddharth Gupta
d6f6a6cd65 ANDROID: GKI: Add devcoredump API to symbol list
This change adds the dev_coredumpm() API to the symbol list
to allow for custom read and free functions to be called to
dump data.

Bug: 197318507
Change-Id: Ib84b25dd2f075ae9bf8919dcd76451fff5e86f2b
Signed-off-by: Siddharth Gupta <quic_sidgup@quicinc.com>
2021-08-25 00:38:55 +00:00
Hajun Sung
db490c7269 ANDROID: Update the exynos symbol list
Leaf changes summary: 3 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, 1 Added variable

2 Added functions:

  [A] 'function int __traceiter_android_vh_do_wake_up_sync(void*, wait_queue_head*, int*)'
  [A] 'function void __wake_up_sync_key(wait_queue_head*, unsigned int, void*)'

1 Added variable:

  [A] 'tracepoint __tracepoint_android_vh_do_wake_up_sync'

Bug: 197604288

Change-Id: I9919ba5e18325d2d3dacee009b5f480bc6c5dacc
Signed-off-by: Hajun Sung <hajun.sung@samsung.com>
2021-08-24 19:55:28 +09:00
Marco Elver
228d32e2d0 UPSTREAM: kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE
Originally the addr != NULL check was meant to take care of the case
where __kfence_pool == NULL (KFENCE is disabled).  However, this does
not work for addresses where addr > 0 && addr < KFENCE_POOL_SIZE.

This can be the case on NULL-deref where addr > 0 && addr < PAGE_SIZE or
any other faulting access with addr < KFENCE_POOL_SIZE.  While the
kernel would likely crash, the stack traces and report might be
confusing due to double faults upon KFENCE's attempt to unprotect such
an address.

Fix it by just checking that __kfence_pool != NULL instead.

Link: https://lkml.kernel.org/r/20210818130300.2482437-1-elver@google.com
Fixes: 0ce20dd840 ("mm: add Kernel Electric-Fence infrastructure")
Signed-off-by: Marco Elver <elver@google.com>
Reported-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Acked-by: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>    [5.12+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit a7cb5d23ea)
Bug: 196937223
Bug: 197197917
Test: local QEMU runs with init/main.c modified to access the NULL page
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I6a339e8c6b4d2bdc3ee9bd575725489a8233aade
2021-08-23 17:41:40 +02:00
Todd Kjos
e113eb454e ANDROID: xt_quota2: set usersize in xt_match registration object
Expicitly set what is visible to userspace

Bug: 196046570
Test: passed netd test suites
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Iacec0ef8ae290e01f1b60508d8abcd40a3653c83
2021-08-20 11:52:24 -07:00
Todd Kjos
60a4c35570 ANDROID: xt_quota2: clear quota2_log message before sending
Initialize message buffer for quota2_log to avoid sending
random data.

Bug: 196046570
Test: passed netd test suites
Fixes: 10cda83af9 ("ANDROID: netfilter: xt_quota2: adding the
original quota2 from xtables-addons")
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Ic9f34aaa2593809b375fc649b74567190c99dc62
2021-08-20 11:52:13 -07:00
Sam Liddicott
4b05a506bd ANDROID: xt_quota2: remove trailing junk which might have a digit in it
Make sure string only contains the characters specified by userspace.

Fix cherry-picked from xtables-extensions project

Signed-off-by: Sam Liddicott <sam@liddicott.com>
Bug: 196046570
Test: passed netd test suites
Fixes: 10cda83af9 ("ANDROID: netfilter: xt_quota2: adding the
original quota2 from xtables-addons")
Signed-off-by: Todd Kjos <tkjos@google.com>
(cherry picked from https://git.code.sf.net/p/xtables-addons/xtables-addons
bc2bcc383c70b293bd816c29523a952ca8736fb5)
Change-Id: I965448564906e5fbf0fe6d6414f44d9e257ea195
2021-08-20 11:52:02 -07:00
linjunting
9f19de4e29 ANDROID: GKI: Update symbols to abi_gki_aarch64_oplus
Add the below to ABI symbol list -
        console_printk
        kmsg_dump_get_line
        send_sig_info

Bug: 197173550
Signed-off-by: linjunting <linjunting@oppo.com>
Change-Id: Ia515c994dbf31a4f4e902a11835a635ab2b319b7
2021-08-20 02:29:28 +00:00
Elliot Berman
5cd4b1ce23 UPSTREAM: cfi: Use rcu_read_{un}lock_sched_notrace
If rcu_read_lock_sched tracing is enabled, the tracing subsystem can
perform a jump which needs to be checked by CFI. For example, stm_ftrace
source is enabled as a module and hooks into enabled ftrace events. This
can cause an recursive loop where find_shadow_check_fn ->
rcu_read_lock_sched -> (call to stm_ftrace generates cfi slowpath) ->
find_shadow_check_fn -> rcu_read_lock_sched -> ...

To avoid the recursion, either the ftrace codes needs to be marked with
__no_cfi or CFI should not trace. Use the "_notrace" in CFI to avoid
tracing so that CFI can guard ftrace.

Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Cc: stable@vger.kernel.org
Fixes: cf68fffb66 ("add support for Clang CFI")
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210811155914.19550-1-quic_eberman@quicinc.com

Bug: 194223154
Change-Id: I7d112496c7f503f95ba69390f6454623cf6dfed2
(cherry picked from commit 14c4c8e415)
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2021-08-19 21:20:03 +00:00
CCJ Yeh
580b7fa7d9 ANDROID: Update symbol list for mtk
Leaf changes summary: 6 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 3 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 3 Added variables

3 Added functions:

  [A] 'function int __traceiter_android_vh_freq_qos_add_request(void*, freq_constraints*, freq_qos_request*, freq_qos_req_type, int, int)'
  [A] 'function int __traceiter_android_vh_freq_qos_remove_request(void*, freq_qos_request*)'
  [A] 'function int __traceiter_android_vh_freq_qos_update_request(void*, freq_qos_request*, int)'

3 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_freq_qos_add_request'
  [A] 'tracepoint __tracepoint_android_vh_freq_qos_remove_request'
  [A] 'tracepoint __tracepoint_android_vh_freq_qos_update_request'

Bug: 197069923
Signed-off-by: CCJ Yeh <ccj.yeh@mediatek.com>
Change-Id: I8541fb4bb327f6887e86ac4b23951ea56a9430a1
2021-08-19 17:18:55 +00:00
Miklos Szeredi
70f3f9db21 UPSTREAM: af_unix: fix garbage collect vs MSG_PEEK
unix_gc() assumes that candidate sockets can never gain an external
reference (i.e.  be installed into an fd) while the unix_gc_lock is
held.  Except for MSG_PEEK this is guaranteed by modifying inflight
count under the unix_gc_lock.

MSG_PEEK does not touch any variable protected by unix_gc_lock (file
count is not), yet it needs to be serialized with garbage collection.
Do this by locking/unlocking unix_gc_lock:

 1) increment file count

 2) lock/unlock barrier to make sure incremented file count is visible
    to garbage collection

 3) install file into fd

This is a lock barrier (unlike smp_mb()) that ensures that garbage
collection is run completely before or completely after the barrier.

Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit cbcf01128d)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 196926917
Change-Id: Iaae09d2603c9a680b596d0501479296491ee3d64
2021-08-19 13:28:02 +00:00
Jindong Yue
4ff1a38f8d ANDROID: GKI: Add initial symbol list for i.MX
Add initial i.MX symbol list file: abi_gki_aarch64_imx.
No new symbols added.

Bug: 194108974
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: Ic948edbb9a9b9ef866702e4901d714b0c89881bf
2021-08-19 11:11:52 +08:00
Sudarshan Rajagopalan
51b382a231 ANDROID: GKI: Update abi_gki_aarch64_qcom for balance reclaim symbols
Add the below to qcom ABI symbol list -

    __tracepoint_android_rvh_set_balance_anon_file_reclaim
    __traceiter_android_rvh_set_balance_anon_file_reclaim

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

1 Added function:

[A] 'function int
__traceiter_android_rvh_set_balance_anon_file_reclaim(void*, bool*)'

1 Added variable:

[A] 'tracepoint __tracepoint_android_rvh_set_balance_anon_file_reclaim'

Bug: 175415908
Change-Id: Idcc9f3f11e247bba8baa1a73501cc4fb195ea92c
Signed-off-by: Sudarshan Rajagopalan <sudaraja@codeaurora.org>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
2021-08-18 09:31:49 -07:00
Jian Gong
d734d9dc3b ANDROID: ABI: update symbols to A12-K5.10 unisoc whitelist for the first time
Update whitelist for the symbols used by the unisoc device and
update the ABI representation accordingly.

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

18 Added functions:

  [A] 'function int __clk_mux_determine_rate(clk_hw*, clk_rate_request*)'
  [A] 'function regmap* device_node_to_regmap(device_node*)'
  [A] 'function hwspinlock* devm_hwspin_lock_request_specific(device*, unsigned int)'
  [A] 'function dma_chan* of_dma_simple_xlate(of_phandle_args*, of_dma*)'
  [A] 'function nvmem_cell* of_nvmem_cell_get(device_node*, const char*)'
  [A] 'function pinctrl_dev* pinctrl_register(pinctrl_desc*, device*, void*)'
  [A] 'function void pinctrl_unregister(pinctrl_dev*)'
  [A] 'function int pinctrl_utils_add_map_mux(pinctrl_dev*, pinctrl_map**, unsigned int*, unsigned int*, const char*, const char*)'
  [A] 'function power_supply_battery_ocv_table* power_supply_find_ocv2cap_table(power_supply_battery_info*, int, int*)'
  [A] 'function int power_supply_get_battery_info(power_supply*, power_supply_battery_info*)'
  [A] 'function int power_supply_ocv2cap_simple(power_supply_battery_ocv_table*, int, int)'
  [A] 'function void power_supply_put_battery_info(power_supply*, power_supply_battery_info*)'
  [A] 'function int power_supply_temp2resist_simple(power_supply_resistance_temp_table*, int, int)'
  [A] 'function void sdhci_enable_v4_mode(sdhci_host*)'
  [A] 'function int sdhci_request_atomic(mmc_host*, mmc_request*)'
  [A] 'function int sdhci_runtime_resume_host(sdhci_host*, int)'
  [A] 'function int sdhci_runtime_suspend_host(sdhci_host*)'
  [A] 'function void usb_phy_get_charger_current(usb_phy*, unsigned int*, unsigned int*)'

Bug: 197050615
Change-Id: Idbc4441d41a561098d52c7a01393697216ad34d8
Signed-off-by: Jian Gong <jian.gong@unisoc.com>
2021-08-18 15:23:05 +00:00
Yanfei Xu
205686b558 FROMGIT: rcu: Fix stall-warning deadlock due to non-release of rcu_node ->lock
If rcu_print_task_stall() is invoked on an rcu_node structure that does
not contain any tasks blocking the current grace period, it takes an
early exit that fails to release that rcu_node structure's lock.  This
results in a self-deadlock, which is detected by lockdep.

To reproduce this bug:

tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --duration 3 --trust-make --configs "TREE03" --kconfig "CONFIG_PROVE_LOCKING=y" --bootargs "rcutorture.stall_cpu=30 rcutorture.stall_cpu_block=1 rcutorture.fwd_progress=0 rcutorture.test_boost=0"

This will also result in other complaints, including RCU's scheduler
hook complaining about blocking rather than preemption and an rcutorture
writer stall.

Only a partial RCU CPU stall warning message will be printed because of
the self-deadlock.

This commit therefore releases the lock on the rcu_print_task_stall()
function's early exit path.

Fixes: c583bcb8f5 ("rcu: Don't invoke try_invoke_on_locked_down_task() with irqs disabled")
Tested-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
BUG: 196874644
(cherry picked from commit dc87740c8a
 https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev)
Signed-off-by: Cheng Jui Wang <cheng-jui.wang@mediatek.com>
Change-Id: I0942973e3fbac2d666d8eb9ed59b1701af13248a
2021-08-18 15:05:21 +00:00
chihhao.chen
2493757f88 BACKPORT: ALSA: usb-audio: fix incorrect clock source setting
The following scenario describes an echo test for
Samsung USBC Headset (AKG) with VID/PID (0x04e8/0xa051).

We first start a capture stream(USB IN transfer) in 96Khz/24bit/1ch mode.
In clock find source function, we get value 0x2 for clock selector
and 0x1 for clock source.

Kernel-4.14 behavior
Since clock source is valid so clock selector was not set again.
We pass through this function and start a playback stream(USB OUT transfer)
in 48Khz/32bit/2ch mode. This time we get value 0x1 for clock selector
and 0x1 for clock source. Finally clock id with this setting is 0x9.

Kernel-5.10 behavior
Clock selector was always set one more time even it is valid.
When we start a playback stream, we will get 0x2 for clock selector
and 0x1 for clock source. In this case clock id becomes 0xA.
This is an incorrect clock source setting and results in severe noises.
We see wrong data rate in USB IN transfer.
(From 288 bytes/ms becomes 144 bytes/ms) It should keep in 288 bytes/ms.

This earphone works fine on older kernel version load because
this is a newly-added behavior.

Bug: 196943902
Link: https://lore.kernel.org/patchwork/patch/1466711/
cherry picked from commit 4511781f95
Signed-off-by: chihhao.chen <chihhao.chen@mediatek.com>
Change-Id: I02731595572e3066fc1abda6009ca6c032b467e8
2021-08-18 11:44:28 +00:00
Bart Van Assche
d0331b15e6 ANDROID: scsi: ufs: Add more logging
The logs attached to bug 196797012 show that the error handler has been
activated and also that a SECURITY PROTOCOL OUT command is being
retried but not why. Hence this patch that adds more logging.

Notes:
- The code that initializes the completion status to
  OCS_INVALID_COMMAND_STATUS was introduced by the initial UFS commit.
  See also 7a3e97b0dc ("[SCSI] ufshcd: UFS Host controller driver").
- The behavior to retry a command if the controller did not overwrite
  the completion status was introduced by commit e8e7f27139 ("scsi:
  ufs: Improve UFS fatal error handling") without explaining why. From
  that commit:

  +       case OCS_INVALID_COMMAND_STATUS:
  +               result |= DID_REQUEUE << 16;
  +               break;

Bug: 196797012
Change-Id: I86ce4149babde1daf07af94464b878e9e697b37b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2021-08-17 10:35:48 -07:00
Cheng Jui Wang
62a5f8e3ac ANDROID: Update symbol list for mtk
1. Generated with:
  BUILD_CONFIG=common/build.config.gki.aarch64 build/build_abi.sh --update

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 long long unsigned int task_sched_runtime(task_struct*)'

Bug: 195914330
Signed-off-by: Poting Chen <poting.chen@mediatek.com>
Signed-off-by: Cheng Jui Wang <cheng-jui.wang@mediatek.com>
Change-Id: Id6e5618313c097a83d8a714c63b76f9f515448b7
2021-08-16 20:48:34 +00:00