Commit graph

334 commits

Author SHA1 Message Date
Ksawlii
2674d4402d Revert "kernel: ems/ego: Allow CPU frequency changes to be amended before they're set"
This reverts commit 5d1ef2f0ad.
2024-11-18 07:48:15 +01:00
Ksawlii
be8bc49145 Revert "cpuidle: Reject idle entry if need_resched() is true"
This reverts commit 09f69d7d5f.
2024-11-18 07:48:03 +01:00
Ksawlii
33064395e7 defconfigs: Nuked CONFIG_CFI_CLANG* 2024-11-17 23:43:38 +01:00
John Vincent
77940d8531 drivers: soc: cal-if: Prevent optimization of structs on fvmap_copy_from_sram
Newer versions of Clang tend to apply heavier optimizations than GCC, especially if -mcpu is set. Because we are applying optimizations to the LITTLE core (see b92e1e70898f515646142736df8d72c43e97e251) kernel panics during boot, citing inability to access memory regions on fvmap_init.

<6>[    0.664609]  [0:      swapper/0:    1] fvmap_init:fvmap initialize 0000000000000000
<0>[    0.664625]  [0:      swapper/0:    1] Unable to handle kernel paging request at virtual address ffffff800b2f2402
<2>[    0.664640]  [0:      swapper/0:    1] sec_debug_set_extra_info_fault = KERN / 0xffffff800b2f2402
<6>[    0.664657]  [0:      swapper/0:    1] search_item_by_key: (FTYPE) extra_info is not ready
<2>[    0.664666]  [0:      swapper/0:    1] set_item_val: fail to find FTYPE
<6>[    0.664680]  [0:      swapper/0:    1] search_item_by_key: (FAULT) extra_info is not ready
<2>[    0.664688]  [0:      swapper/0:    1] set_item_val: fail to find FAULT
<6>[    0.664702]  [0:      swapper/0:    1] search_item_by_key: (PC) extra_info is not ready
<2>[    0.664710]  [0:      swapper/0:    1] set_item_val: fail to find PC
<6>[    0.664724]  [0:      swapper/0:    1] search_item_by_key: (LR) extra_info is not ready
<2>[    0.664732]  [0:      swapper/0:    1] set_item_val: fail to find LR
<1>[    0.664746]  [0:      swapper/0:    1] Mem abort info:
<1>[    0.664760]  [0:      swapper/0:    1]   Exception class = DABT (current EL), IL = 32 bits
<1>[    0.664774]  [0:      swapper/0:    1]   SET = 0, FnV = 0
<1>[    0.664787]  [0:      swapper/0:    1]   EA = 0, S1PTW = 0
<1>[    0.664799]  [0:      swapper/0:    1] Data abort info:
<1>[    0.664814]  [0:      swapper/0:    1]   ISV = 0, ISS = 0x00000021
<1>[    0.664828]  [0:      swapper/0:    1]   CM = 0, WnR = 0
<1>[    0.664842]  [0:      swapper/0:    1] swapper pgtable: 4k pages, 39-bit VAs, pgd = ffffff800a739000
<1>[    0.664856]  [0:      swapper/0:    1] [ffffff800b2f2402] *pgd=000000097cdfe003, *pud=000000097cdfe003, *pmd=00000009742a9003, *pte=00e800000204b707
<0>[    0.664884]  [0:      swapper/0:    1] Internal error: Oops: 96000021 [#1] PREEMPT SMP
<4>[    0.664899]  [0:      swapper/0:    1] Modules linked in:
<0>[    0.664916]  [0:      swapper/0:    1] Process swapper/0 (pid: 1, stack limit = 0xffffff80081a8000)
<0>[    0.664936]  [0:      swapper/0:    1] debug-snapshot: core register saved(CPU:0)
<0>[    0.664950]  [0:      swapper/0:    1] L2ECTLR_EL1: 0000000000000007
<0>[    0.664959]  [0:      swapper/0:    1] L2ECTLR_EL1 valid_bit(30) is NOT set (0x0)
<0>[    0.664978]  [0:      swapper/0:    1] CPUMERRSR: 0000000008000001, L2MERRSR: 0000000010200c00
<0>[    0.664992]  [0:      swapper/0:    1] CPUMERRSR valid_bit(31) is NOT set (0x0)
<0>[    0.665006]  [0:      swapper/0:    1] L2MERRSR valid_bit(31) is NOT set (0x0)
<0>[    0.665020]  [0:      swapper/0:    1] debug-snapshot: context saved(CPU:0)
<6>[    0.665088]  [0:      swapper/0:    1] debug-snapshot: item - log_kevents is disabled
<6>[    0.665112]  [0:      swapper/0:    1] TIF_FOREIGN_FPSTATE: 0, FP/SIMD depth 0, cpu: 0
<4>[    0.665130]  [0:      swapper/0:    1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.14.113 - Fresh Core-user #1
<4>[    0.665144]  [0:      swapper/0:    1] Hardware name: Samsung A50 LTN OPEN rev04 board based on Exynos9610 (DT)
<4>[    0.665160]  [0:      swapper/0:    1] task: ffffffc8f4ce8000 task.stack: ffffff80081a8000
<4>[    0.665180]  [0:      swapper/0:    1] PC is at fvmap_init+0xac/0x2c8
<4>[    0.665195]  [0:      swapper/0:    1] LR is at fvmap_init+0x70/0x2c8
<4>[    0.665211]  [0:      swapper/0:    1] pc : [<ffffff80085e12b8>] lr : [<ffffff80085e127c>] pstate: 20400145
<4>[    0.665225]  [0:      swapper/0:    1] sp : ffffff80081abb80
<4>[    0.665238]  [0:      swapper/0:    1] x29: ffffff80081abbb0 x28: 0000000000000000
<4>[    0.665256]  [0:      swapper/0:    1] x27: ffffff8009efc000 x26: 0000000000000000
<4>[    0.665273]  [0:      swapper/0:    1] x25: ffffff800b2e5970 x24: ffffff8008fa7222
<4>[    0.665291]  [0:      swapper/0:    1] x23: ffffff800b2e5a60 x22: ffffff8009efb000
<4>[    0.665307]  [0:      swapper/0:    1] x21: ffffffc8f3480000 x20: ffffff800b2e0000
<4>[    0.665324]  [0:      swapper/0:    1] x19: ffffff800b2f2400 x18: 0000000000000000
<4>[    0.665341]  [0:      swapper/0:    1] x17: ffffff8009bff23c x16: 0000000000000000
<4>[    0.665358]  [0:      swapper/0:    1] x15: 00000000000000c6 x14: 0000000000000054
<4>[    0.665375]  [0:      swapper/0:    1] x13: 000000000000d7b8 x12: 0000000000000000
<4>[    0.665392]  [0:      swapper/0:    1] x11: 0000000000000000 x10: ffffffc8f3480000
<4>[    0.665409]  [0:      swapper/0:    1] x9 : ffffff800b2f2400 x8 : 0000000000000000
<4>[    0.665426]  [0:      swapper/0:    1] x7 : 5b20205d39303634 x6 : ffffffc0117d09b7
<4>[    0.665443]  [0:      swapper/0:    1] x5 : 0000000000000001 x4 : 000000000000000c
<4>[    0.665459]  [0:      swapper/0:    1] x3 : 0000000000000a30 x2 : ffffffffffffffce
<4>[    0.665476]  [0:      swapper/0:    1] x1 : 000000000b040000 x0 : 000000000000000a

Since we need these optimizations for performance reasons, the only way to resolve this is to solve the issue. Samsung already did something similar to cal-if before.

We only needed to make fvmap_header/header volatile and has been tested to work.

Signed-off-by: John Vincent <git@tensevntysevn.cf>
Change-Id: Ic419135d4a80cbe15f0fa71dc59cc6efa73d6141
2024-11-17 23:41:29 +01:00
Ksawlii
bb07e10628 build.sh: Disabled temporary build without debug 2024-11-17 22:32:40 +01:00
Ksawlii
99598306da kernel_build: build.sh: Fixed kernel version on zips/tars 2024-11-17 22:12:20 +01:00
Ksawlii
2db26df4fb Added a build option without Debug 2024-11-17 22:11:18 +01:00
Ksawlii
d137f21a39 kernel_build: build.sh: Reminder to check if its building 2024-11-17 21:18:04 +01:00
Ksawlii
13a597a9a0 kernel_build: build.sh: Just a small change 2024-11-17 21:16:12 +01:00
Ksawlii
206e4aeaa2 build_kernel.sh: Deleted old useless script 2024-11-17 21:13:41 +01:00
Ksawlii
405c97aa9e kernel_build: build.sh: Removed auto OUTDIR deleting 2024-11-17 20:58:04 +01:00
Ksawlii
15406fe9e9 Revert "gpu: exynos: Underclock to 2093MHz memory frequency"
This reverts commit bc2b96f62c.
2024-11-17 20:56:28 +01:00
Ksawlii
30a0d96e20 drivers: rtl8821au: Changed from #elseif to #elif 2024-11-17 20:46:26 +01:00
Ksawlii
ec34cb298e Revert "block: Do not allow boosters to adjusting scheduler"
This reverts commit c05672273a.
2024-11-17 20:45:13 +01:00
Ksawlii
aa97f7f06c kernel: workqueue.c: Fix -Werror,-Wimplicit-function-declaration 2024-11-17 19:41:51 +01:00
Ksawlii
b4441420c9 Revert "scsi: ufs: Implement IRQ-affined PM QoS for reduced latency"
This reverts commit 095d158f6b.
2024-11-17 19:39:42 +01:00
Ksawlii
4beaea2c30 Revert "xfrm: fix a data-race in xfrm_gen_index()"
This reverts commit 9ee49ca16c.
2024-11-17 19:38:56 +01:00
Ksawlii
b0d48c6581 Revert "xfrm: interface: use DEV_STATS_INC()"
This reverts commit 7c13002e9b.
2024-11-17 19:38:50 +01:00
Ksawlii
3d69c25605 Revert "xfrm6: fix inet6_dev refcount underflow problem"
This reverts commit 00fddf40c2.
2024-11-17 19:38:30 +01:00
Sultan Alsawaf
0a960ba529 kernel: Introduce SBalance IRQ balancer
This is a simple IRQ balancer that polls every X number of milliseconds and
moves IRQs from the most interrupt-heavy CPU to the least interrupt-heavy
CPUs until the heaviest CPU is no longer the heaviest. IRQs are only moved
from one source CPU to any number of destination CPUs per balance run.
Balancing is skipped if the gap between the most interrupt-heavy CPU and
the least interrupt-heavy CPU is below the configured threshold of
interrupts.

The heaviest IRQs are targeted for migration in order to reduce the number
of IRQs to migrate. If moving an IRQ would reduce overall balance, then it
won't be migrated.

The most interrupt-heavy CPU is calculated by scaling the number of new
interrupts on that CPU to the CPU's current capacity. This way, interrupt
heaviness takes into account factors such as thermal pressure and time
spent processing interrupts rather than just the sheer number of them. This
also makes SBalance aware of CPU asymmetry, where different CPUs can have
different performance capacities and be proportionally balanced.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:55:12 +01:00
Divyanshu-Modi
6d78e5b6ae irq: Don't allow IRQ affinities to be set from userspace
msm_irqbalance balances IRQs across CPUs, which collides with SBalance.

Signed-off-by: Divyanshu-Modi <divyan.m05@gmail.com>
2024-11-17 17:45:42 +01:00
Sultan Alsawaf
d174ab61d6 i2c: exynos5: Silence noisy error and info logs
I2C errors are quite common with these controllers and are non-fatal since
the transactions are retried. Silence the noisy logs so that dmesg isn't
destroyed by I2C log spam.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:45:37 +01:00
Sultan Alsawaf
60e07cae48 i2c: exynos5: Set IRQF_NOBALANCING
IRQ balancing is already performed naturally by moving the i2c IRQ to the
CPU that kicks off an i2c transaction. Therefore, opt out from IRQ
balancing operations by setting IRQF_NOBALANCING.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:45:35 +01:00
Sultan Alsawaf
60bb8b3c0a drm: Stub out debug prints
Within the display server process, __drm_dbg consumes significant CPU time:
    2.40%  [kernel]       [k] __drm_dbg

Instead of compiling in all DRM debug print statements, stub them out to
reduce runtime overhead and size.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:45:26 +01:00
Viresh Kumar
0b239017a9 arch_topology: Rename freq_scale as arch_freq_scale
Rename freq_scale to a less generic name, as it will get exported soon
for modules. Since x86 already names its own implementation of this as
arch_freq_scale, lets stick to that.

Suggested-by: Will Deacon <will@kernel.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
2024-11-17 17:45:22 +01:00
Sultan Alsawaf
669f8aa664 sched/completion: Expose wait_for_common*() to drivers
Allow drivers to wait with a custom task state specified by exposing the
raw wait_for_common*() functions. This allows code to wait for completions
that are invariant with respect to CPU performance *without* contributing
to load avg, without requiring the wait to be interruptible.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:45:08 +01:00
Sultan Alsawaf
15898055b7 arm64: lse: Always use LSE atomic instructions
Since we are compiling for a single chipset that is known to support LSE,
the system_uses_lse_atomics() static branch can be eliminated entirely.

Therefore, make system_uses_lse_atomics() always true to always use LSE
atomics, and update ARM64_LSE_ATOMIC_INSN() users to get rid of the extra
nops used for alternatives patching at runtime.

This reduces generated code size by removing LL/SC atomics, which improves
instruction cache footprint.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:45:05 +01:00
Sultan Alsawaf
6007c2066e soc/samsung/cpif: Silence PCI doorbell interrupt log spam
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Nahuel Gómez <nahuelgomez329@gmail.com>
2024-11-17 17:45:02 +01:00
Sultan Alsawaf
ee1e7f7173 soc/samsung/cpif: Don't affine IRQs when SBalance is enabled
Let SBalance handle IRQ affinities when it's enabled for better efficiency
and performance.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Nahuel Gómez <nahuelgomez329@gmail.com>
2024-11-17 17:44:58 +01:00
Sultan Alsawaf
74fef07067 qcacld-3.0: Disable auto IRQ affinity feature
This is at odds with sbalance, which balances this IRQ automatically.
Disable the IRQ affinity feature and leave this up to sbalance.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:44:53 +01:00
Sultan Alsawaf
095d158f6b scsi: ufs: Implement IRQ-affined PM QoS for reduced latency
This implements a simple IRQ-affined PM QoS mechanism for each UFS adapter
which uses atomics to elide locking, and enqueues a worker to apply PM QoS
to the target CPU as soon as a command request is issued.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:44:48 +01:00
Sultan Alsawaf
7780f16398 dma: pl330: Make IRQ handler non-threaded on RT
-EIO errors with SPI transfers over DMA are observed on RT sometimes.
Looking at the pl330 IRQ handler, it appears that it just masks interrupts
and dispatches tasklets to do further processing.

Since the hard IRQ handler just masks interrupts and dispatches work, make
it non-threaded on RT and introduce a threaded handler to offload some
burden from hard IRQ context.

This appears to resolve the sporadic -EIO errors observed on RT.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:44:35 +01:00
Sultan Alsawaf
8e8c1728e7 iommu/samsung: Disable fault reporting by default
Lots of subsystems, such as the TPU, occasionally spam hundreds of
thousands of IOMMU faults which are not only resource heavy due to the IRQ
overhead, but also destroy dmesg/ramoops with tons of spam. These errors
appear to be nonfatal and don't seem actionable for anyone outside of
Samsung or Google, so turn them off by default.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2024-11-17 17:44:13 +01:00
Sultan Alsawaf
5d8a1bc838 exynos_pm_qos: Remove exynos_pm_qos_update_request_timeout()
The possibility of a timeout being used with a PM QoS request incurs
overhead for *all* PM QoS requests due to the necessary calls to
cancel_delayed_work_sync().

Furthermore, using a timeout for a PM QoS request can lead to disastrous
results on power consumption. It's always possible to find a fixed scope in
which a PM QoS request should be applied, so timeouts aren't ever strictly
needed; they're usually just a lazy way of using PM QoS.

Remove the timeout API to eliminate the added overhead for non-timeout PM
QoS requests, and so that timeouts cannot be misused.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Nahuel Gómez <nahuelgomez329@gmail.com>
2024-11-17 17:44:09 +01:00
ThunderStorms21th
008b431fd1 mfc: Reduce QoS boosting from Samsung hacks
By default, everything is set to 240fps for optimal playback performance
However, the situation is not always true, as it applies to cases when
the video bitrate isn't necessarily high, causing high power consumption

Reduce and limit the boosting needed. For decoder, only apply for UHD
video resolution

Signed-off-by: Diep Quynh <remilia.1505@gmail.com>
[TenSeventy7: Negative unsigned integer fixes already present on 9610]
Signed-off-by: John Vincent <git@tensevntysevn.cf>

Signed-off-by: ThunderStorms21th <pinakastorm@gmail.com>
2024-11-17 17:43:58 +01:00
LibXZR
8ab3a6194e binder_alloc: Disable debug logging by default
* This is never useful to us

Signed-off-by: LibXZR <xzr467706992@163.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Signed-off-by: forenche <prahul2003@gmail.com>
2024-11-17 17:43:54 +01:00
ThunderStorms21th
81a8e0f970 blk-throttle: Target 1ms latencies for throttling
Flash memory is extremely latency efficient, so we can make the maximum
target latency 1ms. Anything exceeding 1ms of latency will cause
blk-throttle to trigger.

Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>
Signed-off-by: John Vincent <git@tensevntysevn.cf>

Signed-off-by: ThunderStorms21th <pinakastorm@gmail.com>
2024-11-17 17:43:50 +01:00
ThunderStorms21th
46df2bf46c thermal: Increase thermal trip points to 16
Some DT devices, mainly smartphones, do need more trip points
to allow more fine grained thermal mitigations, hence allowing
a better user experience (and overall performance), for example,
by lowering the CPU clocks just a little for each temperature
step.

taken from : f40204b196

Signed-off-by: Henrique Pereira <hlcpereira@pixelexperience.org>

Signed-off-by: ThunderStorms21th <pinakastorm@gmail.com>
2024-11-17 17:43:45 +01:00
ThunderStorms21th
e0c461eb4f usb: correct function name
Other drivers like the mtp driver use a proper 'function.name' to make the configfs work. So lets correct mass storages name which will allow drivedroid to work.

from : 132f7d90fd

Signed-off-by: ThunderStorms21th <pinakastorm@gmail.com>
2024-11-17 17:43:41 +01:00
LuK1337
0de37a8853 ext4: Add no_sehash_xattr mount option
* Useful for devices where /persist may have unexpected SELinux
  contexts but xattr of root directory is valid, leading to
  restorecon early exitting without traversing the partition.

Change-Id: I5089ff90f76aa9f3db7da26f73548cf62fe67bd0
(cherry picked from commit 8c6c40aa2ce13b83bcc137424e99be5e39d5245d)
2024-11-17 17:43:35 +01:00
engstk
f8f036ffe5 Optimized Integer SQRT. for upto 3x faster operation 2024-11-17 17:43:31 +01:00
Danny Lin
e0f839a996 f2fs: Add support for reporting a fake kernel version to fsck
fsck.f2fs forces a filesystem fix on boot if it detects that the current
kernel version differs from the one saved in the superblock, which results in
fsck blocking boot for a long time (~35 seconds). This commit provides a
way to report a constant fake kernel version to fsck to avoid triggering
the version check, which is useful if you boot new kernel builds
frequently.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2024-11-17 17:43:26 +01:00
Tim Zimmermann
c0f37aaa23 drivers: net: wireless: broadcom: enable p2p mac randomization support
Change-Id: Ie7103ad2da7c080a4dff7c9d040b7c7fe6d08509
2024-11-17 17:43:19 +01:00
Jesse Chan
b422cd8b8a drivers: battery_v2: sec_battery: export {CURRENT/VOLTAGE}_MAX to sysfs
Inform the system if we are charging normal, fast or rapidly. It will be
displayed in the locksreen.

Change-Id: Id0de196e02bd5393cb4fb90835f18caa1d2fe20d
2024-11-17 17:43:14 +01:00
Diep Quynh
e9ed6faf2c acpm: Disable logging by default
Signed-off-by: Diep Quynh <remilia.1505@gmail.com>
2024-11-17 17:43:06 +01:00
idkwhoiam322
f434223a87 printk: Don't allow userspace to write to /dev/kmsg
There is extensive spam in dmesg because of userspace.
This kills all "init", "healthd", "logd" messages in kernel logs and makes them
more readable.

Extracted from 59f163ac76.

Signed-off-by: idkwhoiam322 <idkwhoiam322@raphielgang.org>
Signed-off-by: prorooter007 <shreyashwasnik112@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2024-11-17 17:43:00 +01:00
Park Ju Hyung
311d21b734 blk: disable IO_STAT completely
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
(cherry picked from commit 4d3c7baa4acb5fa3b238dde267826254788e86e5)
(cherry picked from commit 6e658026fe20dc1d651c5f4a56afd363a3195f42)
(cherry picked from commit 2ce27817f2fa8e4bbd3420b2f6c050d404703efc)
(cherry picked from commit 85c200268a4bd8b9ad639991bdaf233ba14f6ade)
(cherry picked from commit 35ab17dbef37e36630d542dce420dc3ac6467d74)
(cherry picked from commit 77662095632a51547ca5f921ec453802788d58ee)
(cherry picked from commit 46e2b47e9560de0877079c8a5db0f5ae742133c4)
(cherry picked from commit d12b3702c6e03ac84d399d41e2859b24e8630dea)
(cherry picked from commit 79be04236891dcd6e5e87a25626a64d6d0d0a42f)
(cherry picked from commit c85b5a7d9c215ca4dc35e894149523b33409fd40)
2024-11-17 17:42:57 +01:00
haridhayal11
58d55d8296 block: disable I/O stats accounting by default
While Android userspace (e.g. storaged) does use iostats via
/proc/diskstats, init will explicitly enable iostats for the devices on
which it is primarily used - sda and sdf. Avoid the 0.5-1% overhead for
block devices that do not need it.

Co-Authored-By: kdrag0n <dragon@khronodragon.com>
2024-11-17 17:42:54 +01:00
Danny Lin
84b47ecf71 tcp: Enable ECN negotiation by default
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>
2024-11-17 17:42:51 +01:00
Zhangyao,Ye
67763ebe89 Disable vmscan warning print
When free memory drops to a  threshold, system high frequency print
call stack message, too much print log affect system normal run.

Change-Id: I9b1cb84537486e2979cb93ac9a248bec85453d9c
Signed-off-by: wya <wya@codeaurora.org>
2024-11-17 17:42:47 +01:00