ROM Thermal Control Config: tune max temp.
Set DEF_SAMPLING_DOWN_FACTOR for all CPU govs to 4 to boost perf.
Tune Kernel Flags after checking with GccOptimizationTests

https://wiki.ubuntu.com/GccOptimizationTests

seems to provide 4~7% boost in cpu performance.
Handle 'sk' being NULL in UID-based routing.

Bug: 15413527 Change-Id: If33bebb7b52c0ebfa8dac2452607bce0c2b0faa0
Signed-off-by: Sreeram Ramachandran <sreeram@google.com>
INTELLIDEMAND: major clenup after code review! cpu sync is moved!

*cleaned cpu sync it's moved to cpu-boost code long tme ago.
*cleaned white space and fix logic.
*restored dbs call check.
*cleaned all that connects to input event! gov no longer control that!
all input events are in cpu-boot code.

https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/c3c4ede8bca2b6f9fcb8cc8b182478ec9f8c1c45#diff-2fb2ff31b83f32cfa38e7c82f8c8ae78R1300
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel/commit/b2a74a08cd73be75c5cdddea1086b15bb8fb1f49
CPUFREQ ONDEMAND: Add task thread update from IntelliDemand.

*added lost checks
*cleaned code style.
REVERT CPUFREQ ONDEMAND: Add task thread update from IntelliDemand.

After tests, i see high perf reduce on cpu bench.

So clean this code from both Ondemand and IntelliDemand
CPUFREQ: update ONDEMAND + INTELLIDEMAND with new LOAD calc boost.

/*
 * If the CPU had gone completely idle, and a task just woke up
 * on this CPU now, it would be unfair to calculate 'load' the
 * usual way for this elapsed time-window, because it will show
 * near-zero load, irrespective of how CPU intensive the new
 * task is. This is undesirable for latency-sensitive bursty
 * workloads.
 *
 * To avoid this, we reuse the 'load' from the previous
 * time-window and give this task a chance to start with a
 * reasonably high CPU frequency.
 *
 * Detecting this situation is easy: the governor's deferrable
 * timer would not have fired during CPU-idle periods. Hence
 * an unusually large 'wall_time' indicates this scenario.
 */
lpm_levels: Do not allow power collapse when multi cores online

When any core power collapse is not selected, no need to allow
idle power collapse on cpu0 when multi cores online. It may leads to
stability issues.

Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ASoC: compress: fix the target not going to TCXO shutdown

The error code propagated from the flush cmd in the trigger stop
is causing the error in the state of the soc compress framework.
This hinders in closing the BE connected to the FE.
If the AFE is not closed it prevents the target to go into TCXO
shutdown.
Fixed by removing the error handling of the flush command in the
trigger stop, since failure in flush doesn't signify the
failure in the stop command.

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cpufreq: intellidemand: Cleanup unused sync waitqueue

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
patch-3.4.97-98 using patch -p1 <
CPUFREQ: Clean Ondemand get tit close to LG stock, revert tuning in others.

*Clean the SMART UP its was not allowing max freq and was laggy.
*Revert DEF_SAMPLING_DOWN_FACTOR = 4 as it's make max freq always on core 0.
drivers: bluetooth: Improve use of macros

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

Also set TX_TIMER_INTERVAL to 10 to save move battery.
Merge branch 'LG-STOCK-KK' of
https://github.com/dorimanx/Dorimanx-LG-G2-D802-Kernel into upstream

Conflicts:
	Makefile
	READY-KERNEL/system/etc/thermal-engine-8974.conf
	net/bluetooth/hci_conn.c
THERMAL CONTROL: fix shutdown on bench test.
Disable ARCH_POWER and SLEEPERS

*Power save on suspend was better with ARCH_POWER OFF.
Set all versions of sync_freq to middle range freq to gain high perf.

and not allow to set less than 960000Mhz
as at this point gov start to LAG hard!

LG default hotplug also set sync_freq types to 960000 by default,
and if user select default hotplug he loose performance allot.
Kernel 5.9
Disable gentle_fair_sleepers & arch_power in  kernel/sched/fair.c