Commit Graph

979557 Commits

Author SHA1 Message Date
Mike Rapoport
8cf5bb6946 UPSTREAM: mm: memblock: fix section mismatch warning again
Commit 34dc2efb39a2 ("memblock: fix section mismatch warning") marked
memblock_bottom_up() and memblock_set_bottom_up() as __init, but they
could be referenced from non-init functions like
memblock_find_in_range_node() on architectures that enable
CONFIG_ARCH_KEEP_MEMBLOCK.

For such builds kernel test robot reports:

   WARNING: modpost: vmlinux.o(.text+0x74fea4): Section mismatch in reference from the function memblock_find_in_range_node() to the function .init.text:memblock_bottom_up()
   The function memblock_find_in_range_node() references the function __init memblock_bottom_up().
   This is often because memblock_find_in_range_node lacks a __init  annotation or the annotation of memblock_bottom_up is wrong.

Replace __init annotations with __init_memblock annotations so that the
appropriate section will be selected depending on
CONFIG_ARCH_KEEP_MEMBLOCK.

Link: https://lore.kernel.org/lkml/202103160133.UzhgY0wt-lkp@intel.com
Link: https://lkml.kernel.org/r/20210316171347.14084-1-rppt@kernel.org
Fixes: 34dc2efb39a2 ("memblock: fix section mismatch warning")
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit a024b7c2850dddd01e65b8270f0971deaf272f27)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: Ic5c2281030801424904ba3df442464d670e37667
2021-09-08 20:50:48 +00:00
Pavel Hofman
f00a543047 FROMLIST: usb: gadget: u_audio: EP-OUT bInterval in fback frequency
The patch increases the bitshift in feedback frequency
calculation with EP-OUT bInterval value.

Tests have revealed that Win10 and OSX UAC2 drivers require
the feedback frequency to be based on the actual packet
interval instead of on the USB2 microframe. Otherwise they
ignore the feedback value. Linux snd-usb-audio driver
detects the applied bitshift automatically.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Tested-by: Henrik Enquist <henrik.enquist@gmail.com>
Bug: 199044440
Link: https://lore.kernel.org/linux-usb/20210906130822.12256-1-pavel.hofman@ivitera.com/
Change-Id: Idf8f1c6cde108d7527be4cdd030d87ec645252fd
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-08 07:17:29 +00:00
Pavel Hofman
3f26745cae FROMLIST: usb: gadget: f_uac2: fixed EP-IN wMaxPacketSize
Async feedback patches broke enumeration on Windows 10 previously fixed
by commit 789ea77310f0 ("usb: gadget: f_uac2: always increase endpoint
max_packet_size by one audio slot").

While the existing calculation for EP OUT capture for async mode yields
size+1 frame due to uac2_opts->fb_max > 0, playback side lost the +1
feature.  Therefore the +1 frame addition must be re-introduced for
playback. Win10 enumerates the device only when both EP IN and EP OUT
max packet sizes are (at least) +1 frame.

Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com>
Tested-by: Henrik Enquist <henrik.enquist@gmail.com>
Tested-by: Jack Pham <jackp@codeaurora.org>
Bug: 199044440
Link: https://lore.kernel.org/linux-usb/b11414f0-1783-192e-2b79-066dd4c814d0@ivitera.com/
Change-Id: I74994d717b0eb543104e3ed7b20ca06c7c584be9
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-08 07:17:21 +00:00
Jack Pham
ab9ceb4334 FROMLIST: usb: gadget: f_uac2: Add missing companion descriptor for feedback EP
The f_uac2 function fails to enumerate when connected in SuperSpeed
due to the feedback endpoint missing the companion descriptor.
We can reuse the ss_epin_desc_comp descriptor and append it behind the
ss_epin_fback_desc both in the static definition of the ss_audio_desc
structure as well as its dynamic construction in setup_headers().

Fixes: 24f779dac8f3 ("usb: gadget: f_uac2/u_audio: add feedback endpoint support")
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Bug: 199044440
Link: https://lore.kernel.org/linux-usb/20210902014317.16775-1-jackp@codeaurora.org/
Change-Id: I0e8d73d69675b649c6b13a48900b391fd5423129
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-08 07:17:13 +00:00
Subbaraman Narayanamurthy
35afadf0da FROMLIST: thermal: Fix a NULL pointer dereference
of_parse_thermal_zones() parses the thermal-zones node and registers a
thermal_zone device for each subnode. However, if a thermal zone is
consuming a thermal sensor and that thermal sensor device hasn't probed
yet, an attempt to set trip_point_*_temp for that thermal zone device
can cause a NULL pointer dereference. Fix it.

 console:/sys/class/thermal/thermal_zone87 # echo 120000 > trip_point_0_temp
 ...
 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020
 ...
 Call trace:
  of_thermal_set_trip_temp+0x40/0xc4
  trip_point_temp_store+0xc0/0x1dc
  dev_attr_store+0x38/0x88
  sysfs_kf_write+0x64/0xc0
  kernfs_fop_write_iter+0x108/0x1d0
  vfs_write+0x2f4/0x368
  ksys_write+0x7c/0xec
  __arm64_sys_write+0x20/0x30
  el0_svc_common.llvm.7279915941325364641+0xbc/0x1bc
  do_el0_svc+0x28/0xa0
  el0_svc+0x14/0x24
  el0_sync_handler+0x88/0xec
  el0_sync+0x1c0/0x200

While at it, fix the possible NULL pointer dereference in other
functions as well: of_thermal_get_temp(), of_thermal_set_emul_temp(),
of_thermal_get_trend().

Cc: stable@vger.kernel.org
Suggested-by: David Collins <quic_collinsd@quicinc.com>
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>

Bug: 199134856
Link: https://lore.kernel.org/linux-pm/1631041289-11804-1-git-send-email-quic_subbaram@quicinc.com/T/#u
Change-Id: I6d5108d3abc7554f91f2e98f2617162224bf0ce3
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2021-09-07 12:26:49 -07:00
Jerome Brunet
3d371f087c UPSTREAM: usb: gadget: f_uac2: fixup feedback endpoint stop
When the uac2 function is stopped, there seems to be an issue reported on
some platforms (Intel Merrifield at least)

BUG: kernel NULL pointer dereference, address: 0000000000000008
...
RIP: 0010:dwc3_gadget_del_and_unmap_request+0x19/0xe0
...
Call Trace:
 dwc3_remove_requests.constprop.0+0x12f/0x170
 __dwc3_gadget_ep_disable+0x7a/0x160
 dwc3_gadget_ep_disable+0x3d/0xd0
 usb_ep_disable+0x1c/0x70
 u_audio_stop_capture+0x79/0x120 [u_audio]
 afunc_set_alt+0x73/0x80 [usb_f_uac2]
 composite_setup+0x224/0x1b90 [libcomposite]

The issue happens only when the gadget is using the sync type "async", not
"adaptive". This indicates that problem is coming from the feedback
endpoint, which is only used with async synchronization mode.

The problem is that request is freed regardless of usb_ep_dequeue(), which
ends up badly if the request is not actually dequeued yet.

Update the feedback endpoint free function to release the endpoint the same
way it is done for the data endpoint, which takes care of the problem.

Fixes: 24f779dac8f3 ("usb: gadget: f_uac2/u_audio: add feedback endpoint support")
Reported-by: Ferry Toth <ftoth@exalondelft.nl>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210827075853.266912-1-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: I96cc41a0dc0e3ad15f9c9bbe5737f22e0fc74433
(cherry picked from commit 75432ba583a8a374b8d1ad2d3ba559a78f7454fc)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 12:47:44 +00:00
Ruslan Bilovol
406a51b486 UPSTREAM: usb: gadget: u_audio: add real feedback implementation
This adds interface between userspace and feedback endpoint to report real
feedback frequency to the Host.

Current implementation adds new userspace interface ALSA mixer control
"Capture Pitch 1000000" (similar to aloop driver's "PCM Rate Shift 100000"
mixer control)

Value in PPM is chosen to have correction value agnostic of the actual HW
rate, which the application is not necessarily dealing with, while still
retaining a good enough precision to allow smooth clock correction on the
playback side, if necessary.

Similar to sound/usb/endpoint.c, a slow down is allowed up to 25%. This
has no impact on the required bandwidth. Speedup correction has an impact
on the bandwidth reserved for the isochronous endpoint. The default
allowed speedup is 500ppm. This seems to be more than enough but, if
necessary, this is configurable through a module parameter. The reserved
bandwidth is rounded up to the next packet size.

Usage of this new control is easy to implement in existing userspace tools
like alsaloop from alsa-utils.

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210603220104.1216001-4-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: If23b59a8bd19a32ba688c688fbfd9e34eb4330c7
(cherry picked from commit e89bb4288378b85c82212b60dc98ecda6b3d3a70)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 12:47:31 +00:00
Ruslan Bilovol
d33287acf3 UPSTREAM: usb: gadget: f_uac2: add adaptive sync support for capture
Current f_uac2 USB OUT (aka 'capture') synchronization
implements 'ASYNC' scenario which means USB Gadget has
it's own freerunning clock and can update Host about
real clock frequency through feedback endpoint so Host
can align number of samples sent to the USB gadget to
prevent overruns/underruns

In case if Gadget can has no it's internal clock and
can consume audio samples at any rate (for example,
on the Gadget side someone records audio directly to
a file, or audio samples are played through an
external DAC as soon as they arrive), UAC2 spec
suggests 'ADAPTIVE' synchronization type.

Change UAC2 driver to make it configurable through
additional 'c_sync' configfs file.

Default remains 'asynchronous' with possibility to
switch it to 'adaptive'

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210603220104.1216001-3-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: I5003048575535b97274fe9137b53894deb6647d6
(cherry picked from commit 40c73b30546e759bedcec607fedc2d4be954508f)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 10:52:14 +00:00
Ruslan Bilovol
c71892dd9e UPSTREAM: usb: gadget: f_uac2/u_audio: add feedback endpoint support
As per USB and UAC2 specs, asynchronous audio sink endpoint
requires explicit synchronization mechanism (Isochronous
Feedback Endpoint)

Implement feedback companion endpoint for ISO OUT endpoint

This patch adds all required infrastructure and USB requests
handling for feedback endpoint. Syncrhonization itself is
still dummy (feedback ep always reports 'nomimal frequency'
 e.g. no adjustement is needed). This satisfies hosts that
require feedback endpoint (like Win10) and poll it periodically

Actual synchronization mechanism should be implemented
separately

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20210603220104.1216001-2-jbrunet@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: I07b5b3e54251c68bff24a2c78ed4e0b30f107693
(cherry picked from commit 24f779dac8f3efb9629adc0e486914d93dc45517)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 06:19:13 +00:00
Ruslan Bilovol
a844dfbbcb UPSTREAM: usb: gadget: u_audio: convert to strscpy
Usage of strlcpy in Linux Kernel has been recently
deprecated [1], convert driver to strscpy

[1] https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/

Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
Link: https://lore.kernel.org/r/1614603943-11668-2-git-send-email-ruslan.bilovol@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 199044440
Change-Id: If27abc1574f89f344d191f538d671d0f8390d4cb
(cherry picked from commit d23922fcac48e57f3bf00b1dc4c9c0f5b4f6fe59)
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-07 06:18:44 +00:00
Jiewen Wang
955f917251 ANDROID: vendor_hooks: Add hook in try_to_unmap_one()
Add hook in try_to_unmap_one() to trace this function for debug memory
swap bugs.

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

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

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

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I0ad5f090d78b4c0b6c456bc2fe47716c6ba46791
2021-09-05 15:55:41 +00:00
Liujie Xie
94fbab9d6c ANDROID: vendor_hooks: Add hook in kmalloc_slab()
Add hook in kmalloc_slab() for debug kmalloc slab memory leak.

Bug: 197614797

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: I402a9f968f2bf1e75daa461c05a53a8fabf70028
2021-09-03 00:17:50 +00:00
Jack Pham
73839b71c8 FROMGIT: usb: dwc3: Decouple USB 2.0 L1 & L2 events
On DWC_usb3 revisions 3.00a and newer (including DWC_usb31 and
DWC_usb32) the GUCTL1 register gained the DEV_DECOUPLE_L1L2_EVT
field (bit 31) which when enabled allows the controller in device
mode to treat USB 2.0 L1 LPM & L2 events separately.

After commit d1d90dd27254 ("usb: dwc3: gadget: Enable suspend
events") the controller will now receive events (and therefore
interrupts) for every state change when entering/exiting either
L1 or L2 states.  Since L1 is handled entirely by the hardware
and requires no software intervention, there is no need to even
enable these events and unnecessarily notify the gadget driver.
Enable the aforementioned bit to help reduce the overall interrupt
count for these L1 events that don't need to be handled while
retaining the events for full L2 suspend/wakeup.

Tested-by: Jun Li <jun.li@nxp.com>
Tested-by: Amit Pundir <amit.pundir@linaro.org> # for RB5 (sm8250)
Tested-by: John Stultz <john.stultz@linaro.org> # for HiKey960 & db845c
Reviewed-by: Jun Li <jun.li@nxp.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Link: https://lore.kernel.org/r/20210812082635.12924-1-jackp@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 843714bb37d9a3780160d7b4a4a72b8077a77589
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Bug: 197291225
Change-Id: Id800cd1ae6d45108b17432ff864902f4d6d57759
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2021-09-02 13:06:32 +00:00
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: aa1ef4d7b3f6 ("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 340caf178ddc2efb0294afaf54c715f7928c258e)
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 6c7a00b843370feaf7710cef2350367c7e61cd1a )
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: aa1ef4d7b3f6 ("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 340caf178ddc2efb0294afaf54c715f7928c258e)
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: 90134ac9cabb6 ("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 facee1be7689f8cf573b9ffee6a5c28ee193615e)
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 f9ce0be71d1f ("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: f9ce0be71d1f ("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 e4dc3489143f84f7ed30be58b886bb6772f229b9)
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:

  bad1e1c663e0a72f ("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: bad1e1c663e0 ("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 59f44069e0527523f27948da7b77599a73dab157)
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: e2083d3673916 ("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 187a002b07e8089f0b5657eafec50b5d05625569)
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: c3042bff918a ("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 61c6f04a988e420a1fc5e8e81cf9aebf142a7bd6)
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: b622b24519f5 ("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 5dca69e26fe97f17d4a6cbd6872103c868577b14)
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: 8d396bb0a5b6 ("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 84524d1232ecca7cf8678e851b254f05cff4040a)
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: 5ff90af9da8f ("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 2a042767814bd0edf2619f06fecd374e266ea068)
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: 407f1d8c1b5f ("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 8fd0e995cc7b6a7a8a40bc03d52a2cd445beeff4)
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: 0fbeae70ee7c ("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 36cb555fae0875d5416e8514a84a427bec6e4cda)
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 6579c8d97ad7 ("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: 6579c8d97ad7 ("clk: Mark fwnodes when their clock provider is added")
Fixes: 3c9ea42802a1 ("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 bb4031b8af804244a7e4349d38f6624f68664bd6)
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: c34e85fa69b9 ("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 ef52b4a9fcc24e17e81cc60357e6107ae4e9c48e
 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 a20dcf53ea98 ("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: a20dcf53ea98 ("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 5571ea3117ca22849072adb58074fb5a2fd12c00
 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 9d4f24bfe043274d9274bcfe223b901bd8fb7182
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 131d326ba969847daa43d708ac11c27978d78566
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