patch-3.4.102-103 using patch -p1 <
lowmemorykiller: Sanitize OOM for screen on/off

* Avoid using memcpy if screen on/off values are same.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Fix Wmaybe-uninitialized values in my code, and add -mtune=cortex-a15
Disable CONFIG_CLS_U32_PERF why we need this counter???

Linux kernel 2.6.18 on i386.

CONFIG_CLS_U32_PERF:

Say Y here to make u32 gather additional statistics useful for
fine tuning u32 classifiers.

Dorimanx:
long forgotten default crap.
SOUND POLICY: allow higher smaple rates.
Makefile fix typo in flags. thanks @bart452
fix merge derp
Tune Interactive CPU GOV.
crypto: lzo - try kmalloc() before vmalloc()

zswap allocates one LZO context per online cpu.

Using vmalloc() for small (16KB) memory areas has drawback of slowing
down /proc/vmallocinfo and /proc/meminfo reads, TLB pressure and poor
NUMA locality, as default NUMA policy at boot time is to interleave
pages :

edumazet:~# grep lzo /proc/vmallocinfo | head -4
0xffffc90006062000-0xffffc90006067000   20480 lzo_init+0x1b/0x30 pages=4 vmalloc N0=2 N1=2
0xffffc90006067000-0xffffc9000606c000   20480 lzo_init+0x1b/0x30 pages=4 vmalloc N0=2 N1=2
0xffffc9000606c000-0xffffc90006071000   20480 lzo_init+0x1b/0x30 pages=4 vmalloc N0=2 N1=2
0xffffc90006071000-0xffffc90006076000   20480 lzo_init+0x1b/0x30 pages=4 vmalloc N0=2 N1=2

This patch tries a regular kmalloc() and fallback to vmalloc in case
memory is too fragmented.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
cfg80211: mlme: Silently ignore duplicate management registrations

Instead of erroring out, just ignore the call

Change-Id: I5ff67100ea2d7f53bd30b6844c462bca71c24d15
Config cleanups. removed unused DECOMPRESS and enabled LGE_HANDLE_PANIC

LGE_HANDLE_PANIC will help to understand logs some more.
KERNEL HOTPLUGS: added control for Suspend or Always active! read more.

Some of my users report that they cant wake the device in random cases.
All started when i have fixed the suspend mode as it's was not working
for long time.
But in the same time a lot of people reported all good and stable!
including me when using the hotplugs in suspend mode. no SODS!

So by default it's should be active, OK! let it be active.
I have added STweaks control for it. with info and warnings.
Also using hotplug in active mode,
will allow faster screen wake when call is coming in.
Need to check battery but i dont think it's really major saver...

* Additionally i have remove the cpu boost when suspend is canceled
it's seems that in some condition we get NULL error on _cpu_up
so use the boost only after real suspend time...
Kernel 7.0
Linaro 2014.08 GCC 4.9.2 self compiled for LG quad core.
ALUCARD HOTPLUG: fix typo in function. thanks @alucard
 net: wireless: bcmdhd: Fix Batch scan get bug

Legacy Batch scan code would issue mutex unlock w/o a lock

bug: 17021370

Signed-off-by: Ashwin <ashwin.bhat@broadcom.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>

https://github.com/neobuddy89/hammerhead_kernel_caf/commit/e26e9d653532621f009d3ef1a0e5b7f07da59713

Dorimanx:
finnaly this shit is fixed! :)
 cpufreq: cpuboost: Make cpu boost driver aware of LCD events

* We previously removed "placebo" wake boost from intelli
  hotplug driver and stated we may add same to MSM Limiter
  driver.
* However, we already have good boost driver in place.
  So we use same to apply CPU boost whenever screen is
  turned on!
* Tested and worked well.
https://github.com/neobuddy89/hammerhead_kernel_caf/commit/69378c9d6f86fecd4c6bc9bdacd9b8dc58a0f1d6

* This is needed to unify boost functions in cpu boost
  and hotplug drivers.
https://github.com/neobuddy89/hammerhead_kernel_caf/commit/ac3c3098b5b1eebda50445226481c07c355e652f

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

Dorimanx.
Merged latest ver from neo!
 cpufreq: cpu-boost: Unify input and hotplug boost

* This doesn't make sense to have mirror functions
  operating different boost frequencies.
* If input_boost_freq > hotplug_boost_freq, hotplug
  boost will be rendered useless in most case since
  parallel input boost will be doing it work.
* So instead having separate boost functions,
  keep only single boost function "do_input_boost"
  and let hotplug callback access this boost.
* Disable hotplug boost by default and provide
  attribute for same.

* Increased migration_load_threshold to prevent
  not-so-needed and recurring migrations.

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

https://github.com/neobuddy89/hammerhead_kernel_caf/commit/0e8176ecaaceec30e38f676d1849a7e8cc7664d4
https://github.com/neobuddy89/hammerhead_kernel_caf/commit/6c498d78c2d1eae0b5d0b1eeda21fd894787f9ab
intelli_plug: Fixes for suspend/resume work rare issues

* It is observed that suspend_defer_time is not
  working as required. It should suspend as soon as defer
  time is completed. Therefore, make use of separate freezable
  workqueue to do this smoothly.
* Organize sequence for initiating and cancelling work.

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

Dorimanx:
Code style mods and cleanups.
msm: hotplug: Use wakeup_boost hint and other fixes

* In current scenario, we boost (turn all cores online)
  whenever LCD turns on. This is really not required when
  we have good hotplug mechanism in place. The mechanism
  should detect load and put appropriate cpus online.
* Boosting CPUs each time will increase battery consumption
  (maybe not so much but we should prevent this)
* So boost CPUs and apply downlock only in two cases viz.
  hotplug was suspended and user requested wakeup_boost
  via cpu-boost driver from userspace.
* Also, it is observed that suspend_defer_time is not
  working as required. It should suspend as soon as defer
  time is completed. Therefore, make use of separate freezable
  workqueue to do this smoothly.
* Organize sequence for initiating and cancelling work.

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