Add delay in smp2p_sleepstate suspend path to prevent wakeup loop with
non wakeup streaming from sensors. This delay should be the maximum
time for sensors samples in flight to be drained.
Change-Id: I79f944caa2ccdd65dc1649aef8d6359f44612479
Signed-off-by: Chris Lew <clew@codeaurora.org>
Signed-off-by: Ananth Raghavan Subramanian <sananth@codeaurora.org>
Signed-off-by: Kelly Rossmoyer <krossmo@google.com>
Bug: 123377615
Bug: 131260677
Sometimes remnet_ipa fails to suspend with the following trace:
NETDEV WATCHDOG: rmnet_ipa0 (): transmit queue 0 timed out
Signed-off-by: celtare21 <celtare21@gmail.com>
Not using alarm timer for dfc powersave check and eliminate the need
for a wakelock. This allows AP to go to suspend quicker.
Change-Id: I7153055d0231a65125ad88808db9e1d0032f24d9
Signed-off-by: Weiyi Chen <quic_weiyic@quicinc.com>
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
* Oneplus is using a dirty list and userspace nodes to override restart_level
for some subsystems. Why not just ignore all RESET_SOC and use a soft reset
instead? Nobody wanna to see their device goes randomly reboot sometimes.
* Note that commit 578bed2 is also needed to fix broken irq free when soft
reset the modem.
Signed-off-by: LibXZR <xzr467706992@163.com>
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>
Signed-off-by: Forenche <prahul2003@gmail.com>
Signed-off-by: Jebaitedneko <Jebaitedneko@gmail.com>
This is now the default for all connections in iOS 11+, and we have
RFC 3168 ECN fallback to detect and disable ECN for broken flows.
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
This adds a great deal of latency to block requests due to disabling
preemption temporarily during statistics collection.
Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>
• armv8.1-a: Includes armv8-a, +crc, +lse, +rdma by default.
• fp16: Enables FP16 extension. This also enables floating-point instructions.
• rcpc: Enables the RcPc extension. This is passed on to the assembler,
enabling inline asm statements to use instructions from the RcPc extension.
Lookup: https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/AArch64-Options.html
Test: A successful build with both Clang & GCC. Kernel booted just fine.
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Increased inlining can provide an improvement in performance, but also
increases the size of the final kernel image. This config peovides a bit
more control on how much is inlined to further optimise the kernel for
certain workloads.
Signed-off-by: Diab Neiroukh <lazerl0rd@thezest.dev>
* Ensure -O3 is always set no matter linker (doesn't impact release
builds).
* Enable fwhole-program-vtables with LTO for better inlining decisions
(0.00489045% binary size decrease).
* Set import-instr-limit to 40:
* Decreases output size by 10.0308%, and also where measurable
performance changes stop occurring. Chromium found 10 was a good
limit for performance/binary size, and AOSP found 5 was a good
compromise. However we're a kernel, and a bit different.
import-instr-limit tests (compared to no limit):
import-instr-limit=10: 15.1171% binary size decrease.
import-instr-limit=20: 15.1025% binary size decrease.
import-instr-limit=30: 10.0455% binary size decrease.
import-instr-limit=40: 10.0308% binary size decrease.
import-instr-limit=50: 5.01785% binary size decrease.
import-instr-limit=60: 5.01296%% binary size decrease.
Makefile: re address lto tweaks
Subsequent to 28d40c3798
After additional clean testing, it was found 20 is the reasonable limit
before any measurable performance loss occurs.
Makefile: re address lto tweaks
All previous testing was embarrassingly flawed.
Since further investigation, the upstream determined 5 is a good fit.
Polly is able to optimize various loops throughout the kernel for cache
locality. A mathematical representation of the program, based on
polyhedra, is analysed to find opportunistic optimisations in memory
access patterns which then leads to loop transformations.
I generally see static Kconfig entries being created to enable
these flags, which inevitably breaks builds and emits misleading
errors for those trying to compile the kernel with standard Clang
toolchains (AOSP, Snapdragon, etc.) which do not natively support
Polly.
Let's instead take advantage of Kconfig compile time checks and
determine compatibility dynamically, similarly to how RELR
relocations and other compiler specific features are handled on
4.19.
[0ctobot: Based on kdrag0n/proton_bluecross@0537f23]
Change-Id: I8c8e4e62f54dc4f84b043030b75d745039c786e8
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Co-authored-by: Diab Neiroukh <lazerl0rd@thezest.dev>
Makefile: Restore support for -polly-run-dce
This flag was initially omitted due to incompatibility with Clang
13 development builds, which has since been resolved.
Change-Id: I8f75c6498df1d3e2c7886da9d0c15446a971edc4
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
This selection being the default behavior for Clang LTO has been
reverted upstream over concerns that the use of -gc-sections
carries a greater potential risk of breakage.
That being said, as someone who has been using these features in
tandem for several years to no ill effect, this is a risk that I
am willing to take in order to trim the fat from LTO's thick
kernel images and potentially reduce boot times.
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
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>
Optimize modulo operation instruction generation by
using single MSUB instruction vs MUL followed by SUB
instruction scheme.
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
The arm64 module region is a 128 MB region that is kept close to
the core kernel, in order to ensure that relative branches are
always in range. So using the same region for programs that do
not have this restriction is wasteful, and preferably avoided.
Now that the core BPF JIT code permits the alloc/free routines to
be overridden, implement them by vmalloc()/vfree() calls from a
dedicated 128 MB region set aside for BPF programs. This ensures
that BPF programs are still in branching range of each other, which
is something the JIT currently depends upon (and is not guaranteed
when using module_alloc() on KASLR kernels like we do currently).
It also ensures that placement of BPF programs does not correlate
with the placement of the core kernel or modules, making it less
likely that leaking the former will reveal the latter.
This also solves an issue under KASAN, where shadow memory is
needlessly allocated for all BPF programs (which don't require KASAN
shadow pages since they are not KASAN instrumented)
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
[@0ctobot: Avoid using module memory in CFI alignment check subsequent
to cfd89c3 ("ANDROID: arm64: bpf: implement arch_bpf_jit_check_func")]
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
By default, BPF uses module_alloc() to allocate executable memory,
but this is not necessary on all arches and potentially undesirable
on some of them.
So break out the module_alloc() and module_memfree() calls into __weak
functions to allow them to be overridden in arch code.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
arm64 no longer uses the module_alloc and module_free functions to
allocate JIT memory for the BPF JIT, so we can safely build and use the
BPF JIT without module support.
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Support read opp value for dev_target.
Use previous_freq instead of get_cur_freq when opp
table parsed success.
Change-Id: I37bb74ef18a822b05ed3be411bc59ae4dadb7a0d
Signed-off-by: Biao Long <blong@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
These functions are used in local
Change-Id: Ia56d70e2ff69295a31b5ac411dcfdcdc854bda18
Signed-off-by: Kasin Li <donglil@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Update the logic that checks maximum allowed power level to
accommodate new frequency corners.
Change-Id: I85c9db7e39c75b14ee77464ca6fcdf5855653b25
Signed-off-by: Mohammed Mirza Mandayappurath Manzoor <mmandaya@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Move devfreq_devbw to late init call to defer the probing.
Change-Id: I5eecb8f4c3e177696f8c4ebd04b84daef6fc65c2
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
devfreq_qcom_qoslat platform driver does not
support the manual bind / unbind feature through sysfs,
Suppress the bind / unbind calls using driver attribute.
Change-Id: I13a61826435e16849aeb15ebdaa792c849ba45c2
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Add support for multiple clients in qoslat by maintaining a
list of devices and aggregating across them during updates.
Change-Id: I3e9970b324938eecdd85f3970ba3acc2c5880fdf
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Move qoslat to late init to ensure all resources it
needs have finished probing.
Change-Id: Ib4f2315aae186f64f531388b2b989c7db9970050
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
The qoslat devfreq device does not implement the
get_dev_status() devfreq profile API. This will
lead to a crash if a governor tries to invoke
devfreq_update_stats(). Implement the API to prevent
this from happening.
Change-Id: I668c3b55a1585d8eb561da03475e1567b194feef
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
lockdep is detecting possible circular locking dependency
due to state_lock mutex as shown below:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(devfreq_list_lock);
lock(state_lock#2);
lock(devfreq_list_lock);
lock(state_lock#2);
*** DEADLOCK ***
Below is partial call stacks (in reverse order) showing relevant
locking paths:
Call stack for CPU0:
devfreq_bw_hwmon_ev_handler+0x4c/0x5e0 [may acquire &state_lock]
devfreq_add_device+0x418/0x538 [may acquire &devfreq_list_lock]
devfreq_add_icc+0x41c/0x528
devfreq_icc_probe+0x20/0x30
Call stack for CPU1:
devfreq_add_governor+0x3c/0x260 [may acquire &devfreq_list_lock]
register_bw_hwmon+0x1e8/0x248 [may acquire &state_lock]
bimc_bwmon_driver_probe+0x310/0x408
Practically, this race is not possible, since devfreq_add_device first
tries to find the governor, and only if it is succeeds,
devfreq_bw_hwmon_ev_handler is called. And the governor would be found
only if devfreq_add_governor has added it priorly.
We have mechanism(initcall_level) in place to make sure that
governor is added before devfreq_add_device happens.
In attempt to quiet the lockdep warning, below fix is adopted:
Since state_lock mutex has different purpose, introduce a new
event_handle_lock mutex for devfreq_bw_hwmon_ev_handler
to avoid this warning.
Change-Id: I53c4514aa2357bf39e9405683f5e73ada0160ba5
Signed-off-by: Abhishek Shah <abhshah@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
When using the %*pbl printk format a special macro is needed to decode
the cpu mask and format it correctly.
Fixes: 74b58a6 ("PM / devfreq: memlat: Aggregate memlat mons under a controller")
Change-Id: Ic0dedbada86cf9cec02b1a5292aaf05f50c0c42f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Fix the following warning from modpost:
WARNING: modpost: missing MODULE_LICENSE() in drivers/devfreq/arm-memlat-mon.o
Fixes: a4e0d26 ("PM / devfreq: Introduce a memory-latency governor")
Change-Id: Ic0dedbad2d3462ee407e5f2d5bcb9ded6e6ac83f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Several devfreq governors print to kernel logs for each
device that registers. Update them to only print when
debugging is enabled.
Change-Id: Id7cf8c9ef70363cdfd4fc1fc72b109f28ab07288
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>