793122 Commits

Author SHA1 Message Date
Suren Baghdasaryan
e26834ec0a msm: kgsl: Stop slab shrinker when no more pages can be reclaimed
do_shrink_slab() scans each shrinker in batches of at most
batch_size (128) pages at a time until total_scan pages are
scanned or until shrinker returns SHRINK_STOP. Under heavy
memory pressure total_scan can be large (in thousands) and
kgsl_pool_shrink_scan_objects() ends up returning 0 after
all pages that were reclaimable are reclaimed. This results in
multiple calls to kgsl_pool_shrink_scan_objects() that do not
reclaim any memory. To prevent this kgsl_pool_shrink_scan_objects()
is modified to return SHRINK_STOP as soon as no more memory can
be reclaimed.

Bug: 69931996
Test: tested using alloc-stress with additional traces

Change-Id: Ia48fc2c0d888c54ec9642c0b0962a70ca3cb4c5e
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
2021-03-27 22:11:37 +05:30
Gao Xiang
6881a1cd16 lib/lz4: Explicitly support in-place decompression
LZ4 final literal copy could be overlapped when doing
in-place decompression, so it's unsafe to just use memcpy()
on an optimized memcpy approach but memmove() instead.

Upstream LZ4 has updated this years ago [1] (and the impact
is non-sensible [2] plus only a few bytes remain), this commit
just synchronizes LZ4 upstream code to the kernel side as well.

It can be observed as EROFS in-place decompression failure
on specific files when X86_FEATURE_ERMS is unsupported,
memcpy() optimization of commit 59daa706fbec ("x86, mem:
Optimize memcpy by avoiding memory false dependece") will
be enabled then.

Currently most modern x86-CPUs support ERMS, these CPUs just
use "rep movsb" approach so no problem at all. However, it can
still be verified with forcely disabling ERMS feature...

arch/x86/lib/memcpy_64.S:
        ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \
-                     "jmp memcpy_erms", X86_FEATURE_ERMS
+                     "jmp memcpy_orig", X86_FEATURE_ERMS

We didn't observe any strange on arm64/arm/x86 platform before
since most memcpy() would behave in an increasing address order
("copy upwards" [3]) and it's the correct order of in-place
decompression but it really needs an update to memmove() for sure
considering it's an undefined behavior according to the standard
and some unique optimization already exists in the kernel.

[1] 33cb8518ac
[2] https://github.com/lz4/lz4/pull/717#issuecomment-497818921
[3] https://sourceware.org/bugzilla/show_bug.cgi?id=12518

Link: https://lkml.kernel.org/r/20201122030749.2698994-1-hsiangkao@redhat.com
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Reviewed-by: Nick Terrell <terrelln@fb.com>
Cc: Yann Collet <yann.collet.73@gmail.com>
Cc: Miao Xie <miaoxie@huawei.com>
Cc: Chao Yu <yuchao0@huawei.com>
Cc: Li Guifu <bluce.liguifu@huawei.com>
Cc: Guo Xuenan <guoxuenan@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-03-27 22:11:36 +05:30
Jeff Liu
406cbc0149 binfmt_elf: Use get_random_int() to fix entropy depleting
Changes:
--------
v4->v3:
- s/random_stack_user()/get_atrandom_bytes()/
- Move this function to ahead of its use to avoid the predeclaration.

v3->v2:
- Tweak code comments of random_stack_user().
- Remove redundant bits mask and shift upon the random variable.

v2->v1:
- Fix random copy to check up buffer length that are not 4-byte multiples.

v3 can be found at:
http://www.spinics.net/lists/linux-fsdevel/msg59597.html
v2 can be found at:
http://www.spinics.net/lists/linux-fsdevel/msg59418.html
v1 can be found at:
http://www.spinics.net/lists/linux-fsdevel/msg59128.html

Thanks,
-Jeff

Entropy is quickly depleted under normal operations like ls(1), cat(1),
etc...  between 2.6.30 to current mainline, for instance:

$ cat /proc/sys/kernel/random/entropy_avail
3428
$ cat /proc/sys/kernel/random/entropy_avail
2911
$cat /proc/sys/kernel/random/entropy_avail
2620

We observed this problem has been occurring since 2.6.30 with
fs/binfmt_elf.c: create_elf_tables()->get_random_bytes(), introduced by
f06295b44c296c8f ("ELF: implement AT_RANDOM for glibc PRNG seeding").

/*
 * Generate 16 random bytes for userspace PRNG seeding.
 */
get_random_bytes(k_rand_bytes, sizeof(k_rand_bytes));

The patch introduces a wrapper around get_random_int() which has lower
overhead than calling get_random_bytes() directly.

With this patch applied:
$ cat /proc/sys/kernel/random/entropy_avail
2731
$ cat /proc/sys/kernel/random/entropy_avail
2802
$ cat /proc/sys/kernel/random/entropy_avail
2878

Analyzed by John Sobecki.

Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Dilger <aedilger@gmail.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Arnd Bergmann <arnn@arndb.de>
Cc: John Sobecki <john.sobecki@oracle.com>
Cc: James Morris <james.l.morris@oracle.com>
Cc: Jakub Jelinek <jakub@redhat.com>
Cc: Ted Ts'o <tytso@mit.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
2021-03-27 22:11:36 +05:30
Adam W. Willis
69a4259154 HACK: lib: Compile out nmi_backtrace for ARM64
This silences the following compilation warning, presumably emitted
by llvm-ar in conjunction with Clang (Thin)LTO:

lib/nmi_backtrace.o: no symbols

This is a watchdog support library which is no-op on this
architecture, hence the empty object file, so let's avoid building
it entirely until a more aesthetically pleasing solution presents
itself.

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Co-authored-by: Panchajanya1999 <panchajanya@azure-dev.live>
2021-03-27 22:11:36 +05:30
Adam W. Willis
0fc672cde5 arm64: vdso: Compile vDSO at O3 with Clang
Subsequent to c251c5f ("Makefile: Use O3 for Clang")

Ensure vDSO uses the same optimization level as the rest of the
kernel, which is O3, when compiling with Clang.

Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-27 22:11:35 +05:30
Tyler Nijmeh
9317cb775c cnss: Do not mandate TESTMODE for netlink driver
Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>
2021-03-27 22:11:35 +05:30
Fieah Lim
2f073fd059 cpuidle: enter_state: Don't needlessly calculate diff time
Currently, ktime_us_delta() is invoked unconditionally to compute the
idle residency of the CPU, but it only makes sense to do that if a
valid idle state has been entered, so move the ktime_us_delta()
invocation after the entered_state >= 0 check.

While at it, merge two comment blocks in there into one and drop
a space between type casting of diff.

This patch has no functional changes.

Signed-off-by: Fieah Lim <kw@fieahl.im>
[ rjw: Changelog cleanup, comment format fix ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
2021-03-27 22:11:35 +05:30
Francisco Franco
faec3b5f82 cpu-boost: Avoid boosting over user set max freq
It was negating the user set max cpu freq and boosting over it if for example input_boost_freq > max_freq, so fix it

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
2021-03-27 22:11:34 +05:30
Francisco Franco
71f9a16a32 cpu-boost: Optimize policy update loop on input boost
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
2021-03-27 22:11:34 +05:30
mawrick26
faae45f133 cpufreq: Don't WARN_ON on non-existent cpu
Signed-off-by: mawrick26 <mawrick26@gmail.com>
2021-03-27 22:11:33 +05:30
Pavankumar Kondeti
40724f7837 sched: walt: Improve the scheduler
This change is for general scheduler improvements.

Change-Id: I4623a59eca688209110c347d388df2a2839a6287
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2021-03-27 22:11:14 +05:30
Peter Zijlstra
af19a6a3bb sched/smp: Optimize send_call_function_single_ipi()
Just like the ttwu_queue_remote() IPI, make use of _TIF_POLLING_NRFLAG
to avoid sending IPIs to idle CPUs.

[ mingo: Fix UP build bug. ]

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200526161907.953304789@infradead.org
Signed-off-by: Vishalcj17 <vishalcj@aospa.co>
Change-Id: Ife9ead8594aec91756d40381cc0fff1d187ebded
2021-03-27 22:11:03 +05:30
tytydraco
128ae49439 ARM64/dts: sdmmagpie-gpu: Allow Adreno 618 to nap
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-27 22:10:16 +05:30
kdrag0n
27da831013 ARM64/dts: sdmmagpie: Suppress verbose output during boot
This should make the kernel initialization faster as it suppresses any
potential serial console output.

Change-Id: Iafcb84908f0911f14b0c560c2122d9be65bf216f
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-23 19:42:32 +05:30
Adithya R
d73c94b8ff Revert "ARM64/dts: sdmmagpie: Run nocb kthreads on little cores"
This reverts commit b9337338014def1f152e91f6ea301824979f4c31.
2021-03-23 19:32:45 +05:30
Adithya R
bde196d8b9 Revert "msm/adreno: Don't mark KGSL scratch buffer as privileged"
* we have R firmware, so this is no longer needed

This reverts commit 873a22fa115c33a9df7e735f995c086a82b9b808.
2021-03-23 19:31:39 +05:30
Sandeep Singh
27f1859b20 icnss: Avoid wlan driver unload if driver is not probed
Avoid wlan host driver unload if wlan host driver is not
probed.

Change-Id: I60b5486654b42e0b4431c8fc96d956aa749c44b3
Signed-off-by: Sandeep Singh <sandsing@codeaurora.org>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:13 +05:30
Ashok Vuyyuru
e6a23a664c msm: ipa3: Fix increase the NAPI budget to maximum
Because of less NAPI budget it's need to reschedule multiple
times in high tput scenario.To avoid multiple reschedule
configuring maximum NAPI budget value.

Change-Id: Id8745b54c3909d01df69376a823396ea4c94eebb
Signed-off-by: Ashok Vuyyuru <avuyyuru@codeaurora.org>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:13 +05:30
Pranav Patel
6a4b57fbc0 msm: kgsl: Clear fault to avoid race between timeout and hard fault
Observed race between timeout fault (long IB detection) and
MISC hang (hard fault). MISC hang can be set while in recovery from
timeout fault. If fault flag is set in start path CP init fails.
Clear gpu fault to avoid such race.

Change-Id: Id99dcefd0ef3438bc95c6c3c84e2eadce214cf77
Signed-off-by: Pranav Patel <pranavp@codeaurora.org>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:13 +05:30
Jianmin Zhu
34fb5454fd arm64: Avoid watchdog during dump wlan firmware after panic
When kernel panic, irqs will be disabled, dma_free_attrs is
called frequently when dump wlan firmware, too much printk by
WARN_ON(irqs_disabled()) make watchdog bite

Change-Id: I9bf18d73c1468c8829bce77898849b3eef07271f
Signed-off-by: Jianmin Zhu <jianminz@codeaurora.org>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:13 +05:30
Maciej S. Szmigiero
03876ea327 cfq: Clear queue pointers after unpinning them in cfq_pd_offline
BFQ is already doing a similar thing in its .pd_offline_fn() method
implementation.

While it seems that after commit 4c6994806f70
("blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()")
was reverted leaving these pointers intact no longer causes crashes
clearing them is still a sensible thing to do to make the code more robust.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:03 +05:30
Omar Sandoval
e042161bb9 block: cfq/bfq: Use ktime_get_ns() instead of sched_clock()
cfq and bfq have some internal fields that use sched_clock() which can
trivially use ktime_get_ns() instead. Their timestamp fields in struct
request can also use ktime_get_ns(), which resolves the 8 year old
comment added by commit 28f4197e5d47 ("block: disable preemption before
using sched_clock()").

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:03 +05:30
Neal Cardwell
82a5c65673 ipv4: tcp: Allow TLP in ECN CWR
This patch enables tail loss probe in cwnd reduction (CWR) state
to detect potential losses. Prior to this patch, since the sender
uses PRR to determine the cwnd in CWR state, the combination of
CWR+PRR plus tcp_tso_should_defer() could cause unnecessary stalls
upon losses: PRR makes cwnd so gentle that tcp_tso_should_defer()
defers sending wait for more ACKs. The ACKs may not come due to
packet losses.

Disallowing TLP when there is unused cwnd had the primary effect
of disallowing TLP when there is TSO deferral, Nagle deferral,
or we hit the rwin limit. Because basically every application
write() or incoming ACK will cause us to run tcp_write_xmit()
to see if we can send more, and then if we sent something we call
tcp_schedule_loss_probe() to see if we should schedule a TLP. At
that point, there are a few common reasons why some cwnd budget
could still be unused:

(a) rwin limit
(b) nagle check
(c) TSO deferral
(d) TSQ

For (d), after the next packet tx completion the TSQ mechanism
will allow us to send more packets, so we don't really need a
TLP (in practice it shouldn't matter whether we schedule one
or not). But for (a), (b), (c) the sender won't send any more
packets until it gets another ACK. But if the whole flight was
lost, or all the ACKs were lost, then we won't get any more ACKs,
and ideally we should schedule and send a TLP to get more feedback.
In particular for a long time we have wanted some kind of timer for
TSO deferral, and at least this would give us some kind of timer

Reported-by: Steve Ibanez <sibanez@stanford.edu>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Reviewed-by: Nandita Dukkipati <nanditad@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:03 +05:30
Park Ju Hyung
1090db2d15 f2fs: Don't wait with each discards under gc_urgent
f2fs already addresses gc_urgent under discard, but still uses the
default wait_ms.

To gain as many free segments as fast as possible,
use 1 for wait_ms under gc_urgent for discards.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:02 +05:30
Park Ju Hyung
5d25eb51f3 f2fs: Use a more reasonable discard policy for high utilization
Waking up discard thread on 50ms interval is way too aggressive,
even when the user has only 20% of space left.

60000ms vs 50ms is too much of a stark difference.

Use 10 seconds instead.
The use of Rapid GC also makes this switch more reasonable.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:02 +05:30
Park Ju Hyung
056c9c7c82 f2fs: Explicitly flush device upon foreground GC
GC itself will produce some dirty segments.
This will allow more GCs to be made upon rapid GC or urgent GC.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:02 +05:30
Yaroslav Furman
4e52bc9581 include: blkdev: Optimize for flash storage
* Switch to SSD mode, disable IO stats and entropy gathering

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-23 12:43:07 +05:30
Danny Lin
139aec4027 msm: msm_bus: Kill transaction logging functionality
The transaction logging (and especially strcmp call) is unnecessary for
us and adds measurably significant overhead. Kill it entirely.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:41:14 +05:30
Sultan Alsawaf
ed2cd13694 cpu: Silence log spam when a CPU is brought up
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:40:45 +05:30
Alex Naidis
060b38fcb9 alarmtimer: Add ndelay for tight loop
The loop in alarm_cancel() is similar to the ones in the
timer drivers as it disables IRQs as well.

So we need to add an ndelay() call after the cpu_relax() call
to avoid potential scheduling delays due to IRQ stalling.

Signed-off-by: Alex Naidis <alex.naidis@linux.com>
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
2021-03-23 12:10:42 +05:30
Alex Naidis
a17d7f61d4 msm: ipa_v3: Mitigate usleep_range calls
Calling usleep_range with identical min and max values,
results in a delta of 0us.

This causes the issue that the scheduler gets no chance to re-use an already
scheduled interrupt for this wait which results in a negative performance
impact by adding uninterruptible sleep.

Fix the issue by allowing the delay to take 20% longer than requested.
This should be good enough for these cases.

Signed-off-by: Alex Naidis <alex.naidis@paranoidandroid.co>
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
2021-03-23 12:10:34 +05:30
Linux Build Service Account
180b0b1170 Merge f2d8a201653c2404f312c76f85a35234cd8f350e on remote branch
Change-Id: I40656da2f5ff7cce633867c5a122a6da0ec04c26
2021-03-22 16:47:51 -07:00
Linux Build Service Account
a9fa0222a2 Merge 142cf65f60f1d7a5b851dd9a7a8f53f2744863e6 on remote branch
Change-Id: I27689b145a1402aa2f3fd09d8cbc39d07810a60c
2021-03-22 16:47:33 -07:00
Linux Build Service Account
89dae8fa1e Merge 934ff6b45db46925f79563dc920861e2ced8e8d2 on remote branch
Change-Id: I867117666a1be9b9ed58aa81b8d219b5da706da0
2021-03-22 16:46:21 -07:00
Linux Build Service Account
bc0db02dc4 Merge d67e179d9998d6acb045d6006077bb7c3456a459 on remote branch
Change-Id: I27d0dd0cdede67be1d2643ad5597475e4ca33c48
2021-03-22 16:46:17 -07:00
Linux Build Service Account
2d476b35b7 Merge 3bae0eca5b4c2f2ff6d82e7a9d1e89d20ea231b7 on remote branch
Change-Id: Ibf161c7c5a7d8cd24c76758e4c2b326d5ba4a78e
2021-03-22 16:46:12 -07:00
Linux Build Service Account
b1723fef95 Merge c0c85da2f7e5ce16ebfa772ccaa4077cdb6a6655 on remote branch
Change-Id: I2107ea92dcfd835720938194a22f7e63d1b2334b
2021-03-22 16:43:23 -07:00
Adithya R
06077f5de0 ARM64/dts: qcom: Do not build useless qcom dtb's 2021-03-22 12:32:05 +05:30
Adithya R
817f8afd14 ARM64/configs: surya: Enable USB force fast charge 2021-03-22 12:30:29 +05:30
engstk
de2e3b475d drivers: misc/power: Implement USB2 fast charge mode
echo 0 /sys/kernel/fast_charge/force_fast_charge (disable)
echo 1 /sys/kernel/fast_charge/force_fast_charge (enable)

Enables force charging up to 900mA in usb2 mode

Signed-off-by: engstk <eng.stk@sapo.pt>
2021-03-22 12:29:43 +05:30
Danny Lin
0724e3493f power: supply: Classify Battery Monitor Systems as batteries
CAF's new fuel gauge drivers report POWER_SUPPLY_TYPE_BMS (Battery
Monitor System) instead of POWER_SUPPLY_TYPE_BATTERY (battery), and
rightfully so because it describes their purpose more accurately.

Update the power_supply_is_system_supplied function to recognize BMS
power supplies as batteries to prevent it from attempting to query the
POWER_SUPPLY_PROP_ONLINE property on our fuel gauge drivers.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
2021-03-22 12:22:09 +05:30
Park Ju Hyung
88c17412a3 msm_geni_serial: Make ioctl always exclusive
Potential concurrent accesses to vote_clock_on/off() functions
may leave runtime PM in an unwanted state.

Change-Id: Ie317e8b191f5ab4083071ea55210006fb06f8079
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: celtare21 <celtare21@gmail.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-22 12:22:09 +05:30
Park Ju Hyung
d860350c2c msm_geni_serial: Reduce ISR wakelock timeout to 100ms
Average userspace response time from ISR is less than 10ms.

Whooping 2 seconds is way too long. Reduce it to 100ms.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Change-Id: I78e1f434f6e5585497972ee82b2a29c5cfd87408
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-22 12:21:55 +05:30
Jie Song
0615f4f440 diag: Add timer to make sure wakelock no stuck
Bug: 142000171
cherry-pick from I81666dcc18c584dbcbd9f588f187ae87a377bcb0
Signed-off-by: Jie Song <jies@google.com>

Change-Id: I7bb84dec4d352ef731b2457dc15590a29ed57a90
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: UtsavisGreat <utsavbalar1231@gmail.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-22 12:21:55 +05:30
mady51
0b706d7c9d gpu: msm: Disable adreno driver logging
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-22 12:21:54 +05:30
Yaroslav Furman
6a04177ddb power/supply: cp_qc30: Silence logging
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-22 12:21:54 +05:30
Yaroslav Furman
3d7768f013 drivers: power: Add timeouts to wakelocks
These can get stuck sometimes and prevert system from sleeping.

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: alk3pInjection <webmaster@raspii.tech>
(cherry picked from commit cd8489c06a3de8c70c6236f91290dd72f46023f4)
2021-03-22 12:21:54 +05:30
Yaroslav Furman
63994f045f 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>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: alk3pInjection <webmaster@raspii.tech>
2021-03-22 12:21:54 +05:30
Sultan Alsawaf
a4e19b682c soc: qcom: watchdog_v2: Fix memory leaks when memory_dump_v2 isn't built
When the memory_dump_v2.c driver isn't built (CONFIG_QCOM_MEMORY_DUMP_V2=n),
an inline version of msm_dump_data_register is used that does nothing. This
means that all memory allocated with the intention of going
to msm_dump_data_register gets leaked.

Fix this by skipping the relevant memory allocation entirely when
CONFIG_QCOM_MEMORY_DUMP_V2 is disabled.

This fixes the following memory leaks:
unreferenced object 0xffffffc7b4b13e00 (size 512):
  comm "swapper/0", pid 1, jiffies 4294877435 (age 103.263s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 4b 43 50 55 5f 43 54 58  ........KCPU_CTX
    30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  0...............
  backtrace:
    [<ffffff93cd3fc814>] __kmalloc+0x1a4/0x2f8
    [<ffffff93cd6ded0c>] msm_watchdog_probe+0x6d4/0xb08
    [<ffffff93cd9208c0>] platform_drv_probe+0x58/0xb8
    [<ffffff93cd91ebcc>] driver_probe_device+0x234/0x400
    [<ffffff93cd91ef68>] __device_attach_driver+0x88/0x140
    [<ffffff93cd91cdb8>] bus_for_each_drv+0x78/0xc8
    [<ffffff93cd91e7cc>] __device_attach+0xd4/0x150
    [<ffffff93cd91f058>] device_initial_probe+0x10/0x18
    [<ffffff93cd91d0a0>] bus_probe_device+0x90/0x98
    [<ffffff93cd91b93c>] device_add+0x3ec/0x5e8
    [<ffffff93cdd56868>] of_device_add+0x58/0x68
    [<ffffff93cdd57438>] of_platform_device_create_pdata+0xa0/0xf8
    [<ffffff93cdd5770c>] of_platform_bus_create+0x27c/0x440
    [<ffffff93cdd5776c>] of_platform_bus_create+0x2dc/0x440
    [<ffffff93cdd57aa4>] of_platform_populate+0x74/0x118
    [<ffffff93cf24b2cc>] of_platform_default_populate_init+0x68/0x7c

unreferenced object 0xffffffc7b4be0000 (size 16384):
  comm "swapper/0", pid 1, jiffies 4294877435 (age 103.263s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffff93cd3d2958>] kmalloc_order+0x58/0x68
    [<ffffff93cd3d2990>] kmalloc_order_trace+0x28/0x100
    [<ffffff93cd3fc8f8>] __kmalloc+0x288/0x2f8
    [<ffffff93cd6ded34>] msm_watchdog_probe+0x6fc/0xb08
    [<ffffff93cd9208c0>] platform_drv_probe+0x58/0xb8
    [<ffffff93cd91ebcc>] driver_probe_device+0x234/0x400
    [<ffffff93cd91ef68>] __device_attach_driver+0x88/0x140
    [<ffffff93cd91cdb8>] bus_for_each_drv+0x78/0xc8
    [<ffffff93cd91e7cc>] __device_attach+0xd4/0x150
    [<ffffff93cd91f058>] device_initial_probe+0x10/0x18
    [<ffffff93cd91d0a0>] bus_probe_device+0x90/0x98
    [<ffffff93cd91b93c>] device_add+0x3ec/0x5e8
    [<ffffff93cdd56868>] of_device_add+0x58/0x68
    [<ffffff93cdd57438>] of_platform_device_create_pdata+0xa0/0xf8
    [<ffffff93cdd5770c>] of_platform_bus_create+0x27c/0x440
    [<ffffff93cdd5776c>] of_platform_bus_create+0x2dc/0x440

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2021-03-22 12:21:54 +05:30
Sultan Alsawaf
982e47424e drm/msm/sde: Stub out debug log macros and compile them out
These debug logs are everywhere and not only bloat the driver, but add
latency everywhere they're used because they're not compiled out. Since
they serve no purpose for us as we're not debugging SDE, compile them
out.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-22 12:21:54 +05:30