793159 Commits

Author SHA1 Message Date
joshuous
025c17c483 sched/tune: Create dynamic_boost SchedTune parameter
Signed-off-by: joshuous <joshuous@gmail.com>
Signed-off-by: Zachariah Kennedy <zkennedy87@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-04-15 10:51:15 +05:30
joshuous
878127e827 sched/tune: Rename dynamic_boost_write() to dynamic_boost()
This is to reduce confusion when we create a new dynamic_boost_write()
function in future patches.

Signed-off-by: joshuous <joshuous@gmail.com>
Signed-off-by: Zachariah Kennedy <zkennedy87@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-04-15 10:51:15 +05:30
joshuous
e52ddc2ad9 sched/tune: Add initial support for Dynamic SchedTune Boost
Provide functions to activate and reset SchedTune boost:

int do_stune_boost(char *st_name, int boost);
int reset_stune_boost(char *st_name);

Signed-off-by: Zachariah Kennedy <zkennedy87@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
Change-Id: I672341db910e6a458157489a716472a0a33b253f
2021-04-15 10:51:14 +05:30
Yaroslav Furman
807c0a407e input/ts: nt36xxx: Remove IRQF_NO_SUSPEND flag
Kernel complains about this IRQ being misconfigured and causing wakeups.

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-14 15:24:14 +05:30
Danny Lin
b02cc9ad4a Revert "Perf: arm64: Add Snapshot of perf tracepoints"
This reverts commit 20ba2f2981ee150b0291bc7e2b280844d1043ea6.

We don't need this, and it breaks compilation when tracing is disabled
while perf is enabled.

Change-Id: I595b3505ce76f0e95be0b0ff5ebd55983fa5d693
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Yousef Algadri <yusufgadrie@gmail.com>
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
(cherry picked from commit 014fd89625896dc168d6c2c63fb6ac1b4517149c)
2021-04-14 15:24:12 +05:30
Adithya R
c70d68baba aw8624_haptic: Silence all debug logging
* this driver is spammy af and quite annoying so
   just shut the f*k up already

pr_info -> pr_debug
2021-04-13 16:36:34 +05:30
Yaroslav Furman
c852815499 irq: Silence 'irq no longer affine' messages
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-13 01:35:49 +05:30
Panchajanya1999
d934553ec4 ARM64/configs: surya: Define DRM and KGSL cpumasks
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
2021-04-13 01:13:43 +05:30
Panchajanya1999
0d38692cd1 msm: kgsl: Mark IRQ and worker thread as KGSL perf critical
These are in critical path for rendering frames to display and
it is a bad idea to affine both KGSL and DRM on a same CPU. So,
affine it to a dediacted mask.

Suggested-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-13 00:49:44 +05:30
Panchajanya1999
45e3b66534 drm/msm: Affine important kthreads to dedicated CPU cluster
Upstream b1adf3f8cd4e4dbf8d3e2d1d8712defc35acce54

Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-13 00:49:44 +05:30
Panchajanya1999
d366d90e11 drm: Affine IRQ to dedicated CPU cluster
Upstream 14e9fad16281e25cd15a2307fb7f750daff2ede2

Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
2021-04-13 00:49:44 +05:30
Panchajanya1999
73a9639e2c kernel: Add API to affine DRM and KGSL IRQs on certain CPUs
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
2021-04-13 00:49:44 +05:30
Panchajanya1999
aeac575783 cpumask: Add cpumasks for DRM and KGSL on big cluster
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-13 00:49:44 +05:30
Sultan Alsawaf
0c6d645772 rcu: Run nocb kthreads on little CPUs
RCU callbacks are not time-critical and constitute kernel housekeeping.
Offload the no-callback kthreads onto little CPUs to clear load off of
the more important, higher-performance CPUs.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2021-04-13 00:49:43 +05:30
Adithya R
94d060668b input/ts: nt36xxx: Mark IRQs as perf critical 2021-04-13 00:49:43 +05:30
Adithya R
df69852221 drivers: Adapt to new perf critical IRQs implementation 2021-04-13 00:49:40 +05:30
Sultan Alsawaf
a394461405 kernel: Extend the perf-critical API to little CPUs
It's helpful to be able to affine low-priority kthreads to the little
CPU, such as for deferred memory cleanup. Extend the perf-critical API
to make this possible.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
(cherry picked from commit 89e8a6b3faa40ce9edbaf8ea64fab25cb6fdb1bf)
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
2021-04-13 00:30:56 +05:30
Sultan Alsawaf
c03bfb6acd kernel: Add bi-cluster API to affine IRQs and kthreads to fast CPUs
On devices with a CPU that contains heterogeneous cores (e.g.,
big.LITTLE), it can be beneficial to place some performance-critical
IRQs and kthreads onto the fast CPU clusters in order to improve
performance.

This commit adds the following APIs:
-kthread_run_perf_critical() to create and start a perf-critical kthread
 and affine it to the given performance CPUs
-irq_set_perf_affinity() to mark an active IRQ as perf-critical and
 affine it to the given performance CPUs
-IRQF_PERF_AFFINE to schedule an IRQ and any
 threads it may have onto the given performance CPUs
-PF_PERF_CRITICAL to mark a process (mainly a kthread) as performance
 critical (this is used by kthread_run_perf_critical())

In order to accommodate this new API, the following changes are made:
-Performance-critical IRQs are distributed evenly among online CPUs
 available in the given performance CPU mask
-Performance-critical IRQs have their affinities reaffined upon exit
 from suspend (since the affinities are broken when non-boot CPUs are
 disabled)
-Performance-critical IRQs and their threads have their affinities reset
 upon entering suspend, so that upon immediate suspend exit (when only
 the boot CPU is online), interrupts can be processed and interrupt
 threads can be scheduled onto an online CPU (otherwise we'd hit a
 kernel BUG)
-__set_cpus_allowed_ptr() is modified to enforce a performance-critical
 kthread's affinity
-Perf-critical IRQs aren't allowed to have their affinity changed by
 userspace

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
(cherry picked from commit 6dd57c8cb3d82ec6965073ef2c8e49d516d17245)
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
2021-04-13 00:12:09 +05:30
Adithya R
2086c5cacd kernel: irq: Revert perf critical IRQs implementation
Revert "kernel: cpu: Affine perf critical IRQs while holding cpu_maps lock"

This reverts commit 5c355f494a0e53608371c17eee5fedacbe0d5980.

Revert "kernel: irq: Add more backup pathways for perf critical IRQs"

This reverts commit 316d14de681bdb517872eed6a921cc2879330440.

Revert "kernel: irq: Properly disallow userspace from changing IRQs affinity"

This reverts commit 567a308e22b38d8e8da5d8810ee2c5cf04939b45.

Revert "kernel: irq: manage: Use a different way of affining perf IRQs"

This reverts commit e691c596ac53741b0f49defb0fa29e46513eea92.

Revert "kernel: Add API to mark IRQs and kthreads as performance critical"

This reverts commit 8adad45664af9019035e3f25fb14425b3ff336de.
2021-04-13 00:10:51 +05:30
Yaroslav Furman
004d8739a3 ARM64/dts: sdmmagpie: Scale SSOC with BSOC
Reasoning: https://github.com/kdrag0n/proton_kernel_redbull/commit/ec92089f61231672

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-12 23:55:34 +05:30
Anil Kumar Kanakanti
221bed9343 msm: camera: cci: Fix logic to update cci clk freq
When multiple frequency slaves running on a same I2C bus,
then there is a chance of overriding I2C bus frequency
even if another I2C operation is running. This could lead
to CCI timeout at driver level. Updated synchronization logic,
to properly update I2C clock frequency, only when no other
I2C operation running.

CRs-Fixed: 2800250
Change-Id: Ia341d7cda118497bf1acea8ea59f7f03124f31c3
Signed-off-by: Anil Kumar Kanakanti <akanakan@codeaurora.org>
2021-04-12 16:18:24 +05:30
guocx4
ce330796e0 msm: camera: Fix out of memory issue
When initialize front sensor, allocating i2c_list failed sometimes
Then camera showed blank screen, so change kzalloc to kvzalloc to
ensure request memory success.

Change-Id: Ifcc5911c5a7eeb05641deed44edb4d96f4aa7e4b
Signed-off-by: guocx4 <guocx4@mt.com>
Reviewed-on: https://gerrit.mot.com/1300923
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jian Zhang <zhangjo@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
2021-04-12 16:18:24 +05:30
a7301c
a4fadbfa50 Revert "msm: camera: eeprom: Fix OOB read/write in EEPROM"
This reverts commit 53a55fb72a89684035b6b5533943f8c1769f439d.
Which causes camera failed to launch.

Change-Id: I3ab3d41cbdb8d48945319adc17a06b9368646245
Signed-off-by: a7301c <a7301c@motorola.com>
2021-04-12 16:18:24 +05:30
a7301c
5e5510069c Revert "msm: camera: eeprom: Fix OOB condition for memory map count"
This reverts commit b3fd77235fa23e048ca94bd1048876aa9b432030.
So that it can pick up:
8303c7e (CR) Revert "msm: camera: eeprom: Fix OOB read/write in EEPROM"

Change-Id: Ifa8cfe4fe6876420e2cdd2e702dcc2670cd66538
2021-04-12 16:18:24 +05:30
chenglong1
65a1584fb4 msm: camera: Fix EEPROM device handle leak.
When EEPROM read failed, the EEPROM device handle was created,
but not released. That will cause EEPROM device acquire be rejected
till phone reboot.

Change-Id: Ife5ea9b4866f33aee137a60328530a3b4c7cb08b
Signed-off-by: chenglong1 <chenglong1@mt.com>
Reviewed-on: https://gerrit.mot.com/1313487
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Long Cheng <chengl1@motorola.com>
Reviewed-by: Zilong Zhang <zhangzl7@mt.com>
Reviewed-by: Dawei Wang <wangdw10@motorola.com>
Reviewed-by: Chuanxin Guo <guocx4@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
2021-04-12 16:18:24 +05:30
Volodymyr Zhdanov
9b12bf2eb0 msm: camera: Import operation mode changes from mojito-r-oss
* needed for A11 camera blobs

Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-12 16:18:24 +05:30
tbalden
b73554622f drm/msm/sde: kcal: Force reprocessing upon config change
Even when supposedly the rendering is not dirty, force reprocess
of filters.

[YaAlex3: Adapt to alesaiko's kcal implementation]
Signed-off-by: Alexander <YaAlex@yaalex.tk>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-12 16:18:24 +05:30
Alesaiko
2c568acabf drm/msm/sde: Introduce KCAL color control
Use PCC and HSIC interfaces to manually calibrate the colors of the
DSI panel via sysfs.  This is a simple driver which uses predefined
API to do this. As it is a purely platform driver, sysfs is located
at /sys/devices/platform/kcal_ctrl.0

Supported PCC and HSIC features:
- RGB control,
- Color distortion control,
- Saturation intensity control,
- Contrast intensity control,
- Color brightness control,
- Grayscale mode,
- Astronomy mode;

We already have atomic ops to alter DSI colors, but users prefer
this interface over that.

Signed-off-by: Alesaiko <solcmdr@gmail.com>
Signed-off-by: Mrinal Ghosh <mg712702@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-12 16:18:24 +05:30
Alesaiko
6b65f06e13 drm/msm/sde: Split HSIC application
Move HSIC application code out of hsicv17 setup function.

Signed-off-by: Alesaiko <solcmdr@gmail.com>
Signed-off-by: Mrinal Ghosh <mg712702@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-12 16:18:24 +05:30
Adithya R
b88321d501 ARM64/configs: surya: Enable back SCHED_CORE_CTL
* this might provide some minor power savings

Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-11 14:34:52 +05:30
Adithya R
cc2e483dc6 Makefile: Disable redundant merge-constants optimization
clang-13: warning: optimization flag '-fmerge-constants' is not supported [-Wignored-optimization-argument]
2021-04-10 19:15:12 +05:30
Adithya R
81d8e80909 Makefile: Disable unknown-warning-option warning
* spams when building inline with benzoclang 13
2021-04-10 19:15:11 +05:30
wangdong12
86093a8ff7 mmc: queue: Move to a SCHED_FIFO thread
MIUI-718202

Running mmcqd as a prio 120 thread forces it to compete with standard
user processes for IO performance, especially when the system is under
severe CPU load. Move it to a SCHED_FIFO thread to reduce the impact of
load on IO performance.

Change-Id: Ia06c12d20dd482cadbd333d17d7f6d21cc61eded
Signed-off-by: wangdong12 <wangdong12@xiaomi.com>
Signed-off-by: Tim Murray <timmurray@google.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-10 19:15:11 +05:30
Yonghua Yan
1673c8f23e power: smb5: Report effective ICL value for current max
Attach Turbo charger to a phone, its screen shows the messages:
"Charging", followed by "Slowly Charging" and then finally
"TurboPower connected". Display messages are confusing.

This is because the USB ICL takes a period time to get settled
down from low icl to the target icl.
So here just return the target ICL to avoid this situation.

Change-Id: I1a3e4641c31fde6b59cc017e01b26a6ea12c6d15
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1364059
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1502908
Signed-off-by: xyyx <xyyx@mail.ru>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-10 19:15:11 +05:30
Adithya R
e878ec3722 Revert "power: smb5-lib: Report the CURRENT_MAX as 1A in CC-mode"
This reverts commit b94fd840804caddb3791ab48de2b9a0e21d7f12d.
2021-04-10 19:15:11 +05:30
Sultan Alsawaf
cd7b26e99a scsi: ufs: Add simple IRQ-affined PM QoS operations
Qualcomm's PM QoS solution suffers from a number of issues: applying
PM QoS to all CPUs, convoluted spaghetti code that wastes CPU cycles,
and keeping PM QoS applied for 10 ms after all requests finish
processing.

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>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-10 19:15:11 +05:30
Sultan Alsawaf
d71136fe90 scsi: ufs: Scrap Qualcomm's PM QoS implementation
This implementation is completely over the top and wastes lots of CPU
cycles. It's too convoluted to fix, so just scrap it to make way for a
simpler solution. This purges every PM QoS reference in the UFS drivers.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-04-10 19:15:10 +05:30
Sultan Alsawaf
c0eaff615f mm: Micro-optimize PID map reads for arm64 while retaining output format
Android and various applications in Android need to read PID map data in
order to work. Some processes can contain over 10,000 mappings, which
results in lots of time wasted on simply generating strings. This wasted
time adds up, especially in the case of Unity-based games, which utilize
the Boehm garbage collector. A game's main process typically has well
over 10,000 mappings due to the loaded textures, and the Boehm GC reads
PID maps several times a second. This results in over 100,000 map
entries being printed out per second, so micro-optimization here is
important. Before this commit, show_vma_header_prefix() would typically
take around 1000 ns to run on a Snapdragon 855; now it only takes about
50 ns to run, which is a 20x improvement.

The primary micro-optimizations here assume that there are no more than
40 bits in the virtual address space, hence the CONFIG_ARM64_VA_BITS
check. Arm64 uses a virtual address size of 39 bits, so this perfectly
covers it.

This also removes padding used to beautify PID map output to further
speed up reads and reduce the amount of bytes printed, and optimizes the
dentry path retrieval for file-backed mappings. Note, however, that the
trailing space at the end of the line for non-file-backed mappings
cannot be omitted, as it breaks some PID map parsers.

This still retains insignificant leading zeros from printed hex values
to maintain the current output format.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2021-04-09 19:32:56 +05:30
Adithya R
10a895011e Revert "mm: Micro-optimize PID map reads for arm64"
This reverts commit 9d2d6e9568b96acf0d858801707c64a2bcb058c7.
2021-04-09 19:31:16 +05:30
Adithya R
26b4769092 ARM64/configs: surya: Actually enable RELR relocations
* tool support must be declared first before this can be enabled
2021-04-02 13:49:45 +05:30
Adithya R
dfe7398521 build.sh: Add support for clean builds
* also remove regen defconfig support as we no longer use
   full defconfigs
2021-04-02 13:45:47 +05:30
Adithya R
af9a1aac41 Revert "data-kernel: rps setting"
This reverts commit f2d8a201653c2404f312c76f85a35234cd8f350e.
2021-04-02 13:42:39 +05:30
Adithya R
e3643db57b Merge tag 'LA.UM.9.1.r1-09200-SMxxx0.0' of https://source.codeaurora.org/quic/la/platform/vendor/opensource/audio-kernel into LA.UM.9.x
"LA.UM.9.1.r1-09200-SMxxx0.0"
2021-04-02 13:41:48 +05:30
Adithya R
3cc93283b9 Merge tag 'LA.UM.9.1.r1-09200-SMxxx0.0' of https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/data-kernel into LA.UM.9.x
"LA.UM.9.1.r1-09200-SMxxx0.0"
2021-04-02 13:40:36 +05:30
Adithya R
10d3581e38 Merge tag 'LA.UM.9.1.r1-09200-SMxxx0.0' of https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/fw-api into LA.UM.9.x
"LA.UM.9.1.r1-09200-SMxxx0.0"
2021-04-02 13:39:51 +05:30
Adithya R
c37f0be202 Merge tag 'LA.UM.9.1.r1-09200-SMxxx0.0' of https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn into LA.UM.9.x
"LA.UM.9.1.r1-09200-SMxxx0.0"
2021-04-02 13:39:28 +05:30
Adithya R
449c8960c0 Merge tag 'LA.UM.9.1.r1-09200-SMxxx0.0' of https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0 into LA.UM.9.x
"LA.UM.9.1.r1-09200-SMxxx0.0"
2021-04-02 13:38:39 +05:30
Adithya R
aa046bcb50 Merge tag 'LA.UM.9.1.r1-09200-SMxxx0.0' of https://source.codeaurora.org/quic/la/kernel/msm-4.14 into LA.UM.9.x
"LA.UM.9.1.r1-09200-SMxxx0.0"
2021-04-02 13:37:50 +05:30
Forenche
b972ff80bf input/ts: nt36xxx: Disable debugging
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-30 17:11:20 +05:30
Park Ju Hyung
51720dd92f drm/msm: Do not notify events during system shutdown
It's been observed that a panic could occur due to a race with
a MSM_DRM_BLANK_POWERDOWN handler and a driver removal function
upon shutdown while the screen is on.

Since this shouldn't happen, send DRM events only when the system is running.

This doesn't seem to be easy to detect as the events are sent after the
userspace drm process terminates, which is before init binary notifies
the kernel about the shutdown.

Workaround this by detecting shutdown upon sysrq kill-all-tasks(i),
sent from the init binary.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: UtsavisGreat <utsavbalar1231@gmail.com>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2021-03-30 16:57:34 +05:30