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>
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
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>
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)
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>
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>
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>
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>
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.
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>
This reverts commit 53a55fb72a89684035b6b5533943f8c1769f439d.
Which causes camera failed to launch.
Change-Id: I3ab3d41cbdb8d48945319adc17a06b9368646245
Signed-off-by: a7301c <a7301c@motorola.com>
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
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
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>
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>
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>
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>
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>
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>
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>
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>