Commit graph

855765 commits

Author SHA1 Message Date
qctecmdr
2d773a4e21 Merge "msm: ipa3: increasing the uC interrupt timeout value" 2021-09-25 01:48:43 -07:00
qctecmdr
8ff847b6c8 Merge "msm: synx: acquire ref of synx handle in each function" 2021-09-25 01:48:40 -07:00
Linyu Yuan
3015fd7f89 usb: dwc3: dwc3-msm: optimize perf vote work
static variable for irq_counter/perf_mode fail for multiple controller,
change to allocate them for each controller instance.

irq_cnt will record irq number for each perf work schedule duration,
it will clear when work execution/cancel.

Change-Id: I1e07277fcd609b37728a9a716cdf5f75ccc35d9b
Signed-off-by: Linyu Yuan <linyyuan@codeaurora.org>
2021-09-24 02:19:27 -07:00
Mukesh Kumar Savaliya
e4c740102a i2c: i2c-qcom-geni: Change the high and low time for SCL
This change is to meet the spec for i2c at 400KHz. Note that there
is a QUP FW change along with this and then only this will work.
FW change takes care of the duty cycle, clock on/off.

Associated FW change is good to have for this SW change.
FW change CR :  TBD separately by HW team.
CR fixed : 3017809.

Change-Id: I2446b736ef5f6cfa5310f4a30a717272d433a655
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2021-09-24 00:36:25 +05:30
Eric Dumazet
bc79b64847 net: qrtr: fix a kernel-infoleak in qrtr_recvmsg()
struct sockaddr_qrtr has a 2-byte hole, and qrtr_recvmsg() currently
does not clear it before copying kernel data to user space.

It might be too late to name the hole since sockaddr_qrtr structure is uapi.

BUG: KMSAN: kernel-infoleak in kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
CPU: 0 PID: 29705 Comm: syz-executor.3 Not tainted 5.11.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x21c/0x280 lib/dump_stack.c:120
 kmsan_report+0xfb/0x1e0 mm/kmsan/kmsan_report.c:118
 kmsan_internal_check_memory+0x202/0x520 mm/kmsan/kmsan.c:402
 kmsan_copy_to_user+0x9c/0xb0 mm/kmsan/kmsan_hooks.c:249
 instrument_copy_to_user include/linux/instrumented.h:121 [inline]
 _copy_to_user+0x1ac/0x270 lib/usercopy.c:33
 copy_to_user include/linux/uaccess.h:209 [inline]
 move_addr_to_user+0x3a2/0x640 net/socket.c:237
 ____sys_recvmsg+0x696/0xd50 net/socket.c:2575
 ___sys_recvmsg net/socket.c:2610 [inline]
 do_recvmmsg+0xa97/0x22d0 net/socket.c:2710
 __sys_recvmmsg net/socket.c:2789 [inline]
 __do_sys_recvmmsg net/socket.c:2812 [inline]
 __se_sys_recvmmsg+0x24a/0x410 net/socket.c:2805
 __x64_sys_recvmmsg+0x62/0x80 net/socket.c:2805
 do_syscall_64+0x9f/0x140 arch/x86/entry/common.c:48
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x465f69
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f43659d6188 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465f69
RDX: 0000000000000008 RSI: 0000000020003e40 RDI: 0000000000000003
RBP: 00000000004bfa8f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000010060 R11: 0000000000000246 R12: 000000000056bf60
R13: 0000000000a9fb1f R14: 00007f43659d6300 R15: 0000000000022000

Local variable ----addr@____sys_recvmsg created at:
 ____sys_recvmsg+0x168/0xd50 net/socket.c:2550
 ____sys_recvmsg+0x168/0xd50 net/socket.c:2550

Bytes 2-3 of 12 are uninitialized
Memory access of size 12 starts at ffff88817c627b40
Data copied to user address 0000000020000140


Fixes: bdabad3e36 ("net: Add Qualcomm IPC router")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Courtney Cavin <courtney.cavin@sonymobile.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: Ia9a1f07114272dc78a471c3c271358b34ebb3dc3
Git-commit: 50535249f624d0072cd885bcdce4e4b6fb770160
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: PavanKumar S.R. <pavasr@codeaurora.org>
2021-09-23 13:34:45 +05:30
Jann Horn
25cf99c881 tty: Fix ->session locking
commit c8bcd9c5be24fb9e6132e97da5a35e55a83e36b9 upstream.

Currently, locking of ->session is very inconsistent; most places
protect it using the legacy tty mutex, but disassociate_ctty(),
__do_SAK(), tiocspgrp() and tiocgsid() don't.
Two of the writers hold the ctrl_lock (because they already need it for
->pgrp), but __proc_set_tty() doesn't do that yet.

On a PREEMPT=y system, an unprivileged user can theoretically abuse
this broken locking to read 4 bytes of freed memory via TIOCGSID if
tiocgsid() is preempted long enough at the right point. (Other things
might also go wrong, especially if root-only ioctls are involved; I'm
not sure about that.)

Change the locking on ->session such that:

 - tty_lock() is held by all writers: By making disassociate_ctty()
   hold it. This should be fine because the same lock can already be
   taken through the call to tty_vhangup_session().
   The tricky part is that we need to shorten the area covered by
   siglock to be able to take tty_lock() without ugly retry logic; as
   far as I can tell, this should be fine, since nothing in the
   signal_struct is touched in the `if (tty)` branch.
 - ctrl_lock is held by all writers: By changing __proc_set_tty() to
   hold the lock a little longer.
 - All readers that aren't holding tty_lock() hold ctrl_lock: By
   adding locking to tiocgsid() and __do_SAK(), and expanding the area
   covered by ctrl_lock in tiocspgrp().

Cc: stable@kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Ie8d8de63b1694803d8650b62993ca86a456831be
Git-commit: 361e822b7d8a9d06d88f7cea0fdb0fb6e41c4d45
Git-repo: https://android.googlesource.com/kernel/msm
Signed-off-by: PavanKumar S.R. <pavasr@codeaurora.org>
2021-09-23 12:36:28 +05:30
Jagadeesh Ponduru
be692ef32e msm: ipa3: increasing the uC interrupt timeout value
Increased the timeout value of ipa3_uc_send_cmd
from 10 to 20 in ipa3_uc_debug_stats_alloc function.

Change-Id: I5be5839c60b84226872a22e8a05bb712e395e62d
Signed-off-by: Jagadeesh Ponduru <jponduru@codeaurora.org>
2021-09-22 21:34:44 +05:30
qctecmdr
c96bcb72d0 Merge "soc: qcom: Set QOS only to silver cluster" 2021-09-22 07:33:29 -07:00
qctecmdr
9d29e4d35a Merge "msm: synx: fix synx_release_core race condition" 2021-09-22 04:27:54 -07:00
Kamal Agrawal
255a99c332 msm: kgsl: Fix out of bound write in adreno_profile_submit_time
Make sure there is enough room in the memory descriptor to store the
entire profiling buffer object.

Change-Id: I1e1c73097bb2bba9645b0a3c66fdbbc71d8ba8fa
Signed-off-by: Kamal Agrawal <kamaagra@codeaurora.org>
2021-09-21 07:11:31 -07:00
Vivek Golani
440ae62ce3 diag: Update log and event mask code ranges
Modify log and event mask code ranges to reflect
latest requirements.

Change-Id: I4bf5c2dad7622d9c677805b48e7dd560e0e90d1c
Signed-off-by: Vivek Golani <vgolani@codeaurora.org>
2021-09-21 11:07:35 +05:30
qctecmdr
5157d05415 Merge "soc: qcom: smem: Update size of legacy partition" 2021-09-20 22:26:07 -07:00
Bavyasritha Alahari
197ef58c68 soc: qcom: Set QOS only to silver cluster
CDSPRM module implements a RPMSG interface to communicate with CDSP
while providing a way for CDSP to vote for CPU QoS to benefit CDSP
applications performance.Glink IRQ mostly is taken by the
silver cluster.CDSPRM driver vote for sliver cluster prevents
collapsing gold cluster.This saves significant power.

Change-Id: I6cac71e7ab85d823dfc44b19dd85a0dde62455db
Acked-by: Sreekanth Gande <sgande@qti.qualcomm.com>
Signed-off-by: Bavyasritha Alahari <alahari@codeaurora.org>
2021-09-20 17:29:20 +05:30
Linux Build Service Account
6d8eafcd80 Merge 28ba9d136c on remote branch
Change-Id: Ifaed6711ede356b97f59b72d15eafe5fc8188d40
2021-09-19 21:47:37 -07:00
qctecmdr
a88c3ae441 Merge "dwc3-msm: Move override usb speed functionality outside edev check" 2021-09-17 05:52:38 -07:00
qctecmdr
01bf131abc Merge "usb: f_mtp: Don't handle OS descriptors from MTP driver" 2021-09-17 02:12:12 -07:00
Mayank Rana
2965c6b6d4 dwc3-msm: Move override usb speed functionality outside edev check
Currently usb speed override functionality doesn't work as expected
when usb role switch based notification is used. Hence move usb speed
override functionality out side edev check within dwc3_resume_work()
API. Also update maximum_speed as max hw supported speed out side
edev check.

Change-Id: I69b066721490277b77333d2caf820b6c87703501
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2021-09-17 12:30:15 +05:30
qctecmdr
e0c39261f1 Merge "cnss2: Update board data file name for certain RF chip ID" 2021-09-16 14:53:47 -07:00
qctecmdr
28ba9d136c Merge "block: pm: Fix possible unbalanced nr_pending" 2021-09-16 02:47:47 -07:00
Yue Ma
81409af52b cnss2: Update board data file name for certain RF chip ID
If higher 4 bits of chip ID (device major version) is 1, read board
data file name as bdwlang.e<board ID>. The assumption is board ID
will be always less than 0xFF. If board ID (0xFF) is invalid in OTP
then read it as bdwlang.elf for such case. Also only use lower 4 bits
of device major version as the version number to load firmware file
because of above new requirement.

Change-Id: I4dce528a9c389a660b19dabe4ee44e655a23570b
Signed-off-by: Yue Ma <yuem@codeaurora.org>
2021-09-16 14:19:54 +05:30
qctecmdr
bf40795532 Merge "regulator: qcom_pm8008-regulator: add support for PMIC PM8010" 2021-09-15 23:04:30 -07:00
Kavya Nunna
9995b02041 platform: qpnp-revid: Add REVID support for PM8010
Add PMIC subtype for PM8010.

Change-Id: I6e185be5db95687b06fa3b15e43c5f223622647b
Signed-off-by: Kavya Nunna <knunna@codeaurora.org>
2021-09-15 15:43:58 +05:30
Philip Cuadra
96060693a5
msm: bus_arb: Disable debug logging.
* This debug logging consumes 10% of all the CPU
   cycles in the drivers communicating with the DSP.

 * Disable the logging for the time being until we add
   a config.

Bug: 71867957
Change-Id: I97d418fee3d4576b077ed284ed5ae4447da5a789
2021-09-15 09:27:44 +02:00
Gagan Malvi
fc87a3047e
build: compile with Proton Clang.
Signed-off-by: Gagan Malvi <malvigagan@gmail.com>
2021-09-15 09:27:37 +02:00
John Dias
e72c9fc255
binder: Set binder_(alloc_)debug_mask=0 to suppress logging.
* Excessive logging -- not present on angler -- is
   affecting performance, contributing to missed audio
   deadlines and likely other latency-dependent tasks.

Bug: 30375418
[@0ctobot: Extend patch to cover binder_alloc_debug_mask]
Co-authored-by: Adam W. Willis <return.of.octobot@gmail.com>

Change-Id: I36c4ce8a0294e5e7847a3fd884691cb178cd95c2
2021-09-15 09:27:37 +02:00
Yaroslav Furman
abca78dc6d
rcu: Fix a performance regression.
Commit "rcu: Create RCU-specific workqueues with rescuers" switched RCU
to using local workqueses and removed power efficiency flag from them.

This caused a performance regression that can be observed in Geekbench 5
after enabling CONFIG_WQ_POWER_EFFICIENT_DEFAULT: score went down from
760/2500 to 620/2300 (single/multi core respectively).

Add WQ_POWER_EFFICIENT flag to avoid this regression.

Change-Id: I2c4f41faa55548f9e81a1c0cbe10703948062d89
2021-09-15 09:27:36 +02:00
Danny Lin
24fc95ac23
drm/msm/sde: Cache register values when performing clock control.
Remote register I/O amounts to a measurably significant portion of CPU
time due to how frequently this function is used. Cache the value of
each register on-demand and use this value in future invocations to
mitigate the expensive I/O.

Co-authored-by: Sultan Alsawaf <sultan@kerneltoast.com>
[@0ctobot: Adapted for msm-4.19]

Change-Id: I6846ee58c476a125076d0c3ad351f9e15eba180a
2021-09-15 09:27:36 +02:00
Hridya Valsaraju
a212bda4b4
arm64: dts: vendor: Delete Android firmware nodes.
* These have all moved into the ramdisk, and boot devices
   has gone to the kernel commandline.

Bug: 117933812
Change-Id: I0d06607c522c08f50484b9eff4dc78b21cc083f5
2021-09-15 09:27:36 +02:00
Yaroslav Furman
21c03f31c5
PM: sleep: Skip OOM killer toggles when kernel is compiled for Android.
* Android devices use LMK algorythms, so there's no
   reason to disable and enable the OOM killer when entering and exiting
   suspend.

 * This is a fixed version of https://github.com/YaroST12/VIOLENT_kernel/commit/86e59a93b2ef

Co-authored-by: Danny Lin <danny@kdrag0n.dev>
Change-Id: Icb2a57e51128a9ae8d578e697f041ff19871351b
2021-09-15 09:27:36 +02:00
Tyler Nijmeh
3f92eede81
drivers: thermal: Don't qualify thermal polling as high priority.
* Don't take priority over other workqueues.

Change-Id: Ib15dd5addd04ca6569485bd3c66dd01ddf72840e
2021-09-15 09:27:36 +02:00
Danny Lin
cbde7a6bea
arm64: dts: vendor: Disable expedited RCU grace periods.
* Similar to what I've done on other devices, revert
   to normal grace periods to reduce power usage.

 * Expedited RCU hammers CPUs with IPIs to reduce grace
   period durations and thus RCU latency, but that disrupts
   busy CPUs and causes unnecessary wakeups while providing
   little to no improvement in real-world performance.

Change-Id: I2b55e4aaa82bb670dfd6fb417b05fe9ae685e0a8
2021-09-15 09:27:36 +02:00
Adam W. Willis
6a95c8b1c6
arm64: dts: vendor: Disable debug monitoring.
Change-Id: I95048bdbcc41990ddfe279120ddeaed72713a7a5
2021-09-15 09:27:36 +02:00
Danny Lin
b3c827f520
arm64: dts: vendor: Disable broken IRQ detection.
* Our kernel only runs on known systems where broken
   IRQs would already have been discovered, so disable
   this to reduce overhead in the IRQ handling path.

Change-Id: Ia9e655dc9891f9cb94a6123ceaec43ba7c5fd5b1
2021-09-15 09:27:36 +02:00
David Collins
4338d3102b regulator: qcom_pm8008-regulator: add support for PMIC PM8010
Add support to control the LDOs found on PM8010 PMICs.  PM8010 is
a pin-compatible update of PM8008.

Change-Id: Ia15481c9610bdf1b8ce305381decbf28c9f65716
Signed-off-by: David Collins <collinsd@codeaurora.org>
2021-09-15 00:01:52 -07:00
David Collins
83b80e7392 regulator: qcom_pm8008: allow multiple PM8008 instances with unique names
Change the qcom_pm8008-regulator "regulator-name" device tree
property parsing procedure from an exact match to a substring
match.  This allows multiple PM8008 chips to be used on a given
board which have unique names specified for their respective
regulators.

Change-Id: I519107431148cdf1882d8e50056f2d2e20ce018f
Signed-off-by: David Collins <collinsd@codeaurora.org>
2021-09-15 00:01:34 -07:00
qctecmdr
3686a15a5a Merge "defconfig: kona: Add CONFIG_AQFWD for RB5 board" 2021-09-14 19:28:36 -07:00
Can Guo
36a7bd907c block: pm: Fix possible unbalanced nr_pending
When someone calls blk_get_request() and blk_put_request()
without invoking blk_execute_rq() in between, nr_pending
will be unbalanced. Fix this by adding a flag, namely the
RQF_PM_ADDED, to track the usage of nr_pending, so that
blk_pm_put_request() won't touch nr_pending if the flag is
not set. Extra care should be given to blk_pm_requeue_request(),
because blk-flush.c inserts flush requests into queue without
calling blk_pm_add_request(), if the flush requests get requeued
by LLD, blk_pm_requeue_request() should anyways decrease
nr_pending in this situation to keep it balanced.

Change-Id: I7baa2049ac532e4fd22a0ce358133ba88266a314
Signed-off-by: Ziqi Chen <ziqichen@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-09-15 09:44:27 +08:00
qctecmdr
ef299a6053 Merge "power: supply: qpnp-smb5: specify different ICL for QC2 9V/12V level" 2021-09-14 15:21:26 -07:00
qctecmdr
2b4738b189 Merge "rpmsg: glink: do not break from interrupt handler" 2021-09-14 08:08:51 -07:00
Pratham Pratap
5d93fbb51b usb: f_mtp: Don't handle OS descriptors from MTP driver
Currently MTP driver is handling OS descriptors which
causes CTS test failures(android.adb.cts.AdbHostTest) if
MTP is in the default composition.

Fix this by skipping the handling of OS descriptors in
MTP driver and let composite driver take care of it for
the whole configuration.

Change-Id: I77902108c3a550997dfd56b9b3127900c724f066
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
2021-09-14 13:31:15 +05:30
Fenglin Wu
0edd2a1066 power: supply: qpnp-smb5: specify different ICL for QC2 9V/12V level
There is an existing device-tree property "qcom,hvdcp2-max-icl-ua" to
specify the ICL when QC2 charger adapter working at high voltage to
avoid VBUS voltage collapse. Normally QC2 adapters have different
current rating at different voltage level, hence keep the existing
property to specify the ICL setting at 9V level and add a new
property "qcom,hvdcp2-12v-max-icl-ua" to specify the ICL setting at
12V level.

Change-Id: I0811932de997b56a1d8d95bd5cbf22a194ffe035
Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
2021-09-14 15:14:43 +08:00
qctecmdr
a0e406a6f7 Merge "phy: msm: usb: Check VBUS state before accessing registers in suspend" 2021-09-13 17:07:49 -07:00
qctecmdr
1e05ffb38a Merge "msm: adsprpc: Allocate buffer taking NULL byte into consideration" 2021-09-13 07:49:14 -07:00
Vijayavardhan Vennapusa
af15029bda phy: msm: usb: Check VBUS state before accessing registers in suspend
Currently driver is checking for VBUS state after accessing register
in msm_otg_suspend() routine. In case of CDP, there will be race between
msm_otg_suspend() and driving DP pulse. This could cause accessing
register in msm_otg_suspend() while clocks are off as part of sequence
to drive pulse on D+ line and later it is checking for VBUS state high
to abort suspend sequence. Hence fix it by checking for VBUS state
before accessing registers in msm_otg_suspend().

Change-Id: I95ad5339b21647e3971908d15f2eabe0c6311800
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2021-09-13 02:00:07 -07:00
Vijayavardhan Vennapusa
dde8494125 phy: msm: usb: Fail suspend if psy_type is USB or USB_CDP
Currently driver is checking only charger type from internal variable
in msm_otg_suspend(), which is valid for PHY based charger detection.
If PMIC charger does charger detection, that charger type will not be
updated and result in allowing low power mode sequence even VBUS is
active. Hence fix it by checking psy_type as well to avoid allowing
low power mode sequence while VBUS is active.

Change-Id: I8cb47912867b15ebdc30bc15b58ff99026a1e180
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2021-09-13 01:59:51 -07:00
Vijayavardhan Vennapusa
0d8df81b81 USB: phy: msm: Apply DP pulse for CDP during bootup from sm_work
Currently driver is calling API to apply pulse from vbus notifier, but
it might lead to race condition during bootup and result in unclocked
access. Hence avoid applying DP pulse during bootup from vbus notifier
callback. Also enable LDOs and clocks only if usb is in lpm, else apply
DP pulse without enabling LDOs and clocks again.

Change-Id: I987d93de5261147481f3856254941091dedba108
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2021-09-13 01:59:30 -07:00
qctecmdr
826d77fc56 Merge "soc: qcom: secure_buffer: Fix the parameter passing to dmac_flush_range" 2021-09-13 01:33:36 -07:00
Prabha
cd8a4c01a6 msm: adsprpc: Allocate buffer taking NULL byte into consideration
When attaching to audiopd on ADSP, allocate one
extra byte for the process name so that it is
null terminated when data is copied from file
pointer in the userspace.

Change-Id: I98ac64a4c16f44fa4fd0e09da1648b9d78d65a82
Signed-off-by: prabha <prabha@codeaurora.org>
2021-09-13 13:27:54 +05:30
Madhuri Medasani
842ebeb832 clk: qcom: debugcc: Remove the gcc_camss_camnoc clocks
Remove the gcc_camss_camnoc clocks from debugcc
which are not registered in GCC to avoid the crash
because of parent index in KHAJE.

Change-Id: Ia8db40e55c3f7d96abb47bb810eb4f13c20e65f2
Signed-off-by: Madhuri Medasani <mmedasan@codeaurora.org>
2021-09-12 23:36:00 -07:00
qctecmdr
05996fd8ab Merge "uapi: Add UAPI headers for slatecom_interface driver" 2021-09-10 22:18:00 -07:00