clock-krait/cpufreq: custom voltage control v1 (Imoseyon)

(cherry picked from commit 1802748b3f6f64ab7c045a3bfc7cfe182e585ca4)

Change-Id: Id6604bb1639fdf3c474188c9efb5eee94273be63
OC and cmREmiX version

Change-Id: I75837d03815b26aee566aa9f73816c5ea0e1a4a2
Dont let limiter override user MAX freq

(cherry picked from commit 95c083c1fdaad3437a67ff7a5512cf1403f6d3dc)

(cherry picked from commit 84a77a54ee68bf1a6064cbc38f5bc91b670e435d)

Change-Id: I796189c9001a37b2b563fa76f70090549fcf05d4
Fast charge from my S4 and S5 code plus removal of alot of dmesg spam (ktoonsez)

(cherry picked from commit 128616d0a2c0c6542e58de57c8366e50dd9fd280)

Change-Id: I45f0b7c8f105e6dbe93c88eb8ff1d1ff79b08932
rmnet: Good-bye moronic idiotic read/write buffer dump

(cherry picked from commit a4aeaab73794ec172738315633f2cd54d1af4087)

(cherry picked from commit 64034b429b79a2cb2e8d36183c9bca9ef76ada78)

Change-Id: I15edad0ee0e55108c97e86ddd3eb87768d49f042
Add variant detection

(cherry picked from commit 25bac2231ca23bbe9348e2386e0c54be06380889)

(cherry picked from commit e33bbc0bd875d4d70e178b1949777458635f973e)

Change-Id: Iec0a882be32e47934de71ea370045b54261ee912
Add a butt load of tcp congestion control options

(cherry picked from commit 8d28d45a573e4e9a5b5eadba205944e49de2c8bc)

(cherry picked from commit 3aeaeae94b32062b2db314552670433b2b2c8168)

Change-Id: I0f4a789a2d25085a91d6db6b04cc4489bfc66e36
f2fs: Enable it

(cherry picked from commit 4a04d6b78bee0d7b8184e59dfc2b54532e152a80)

(cherry picked from commit a5542109958c17e5dee47b339f2a03fc7b2137b4)

Change-Id: I65ace36cfcbad581ca6bfb5ec3d2e466c86ce334
defconfig: Add missing TMO flags

(cherry picked from commit 8b8c6905f1ac069195bb10c0daa08dc2f1ffefc2)

(cherry picked from commit d04edfa81986a14d2314aecd68e599dbd6b26f2b)

Change-Id: I0cb586f54336310615ea9ee36e9f16c3cab75229
Enable last_kmsg and increase log buffer shift plus add pr_alert when last_kmsg is not initialized

(cherry picked from commit 308b5ec6582052e78bec0b0fea45a4dee20daf1d)

(cherry picked from commit aff2f3a6e00f4d4195fa0b0088b94ea4adba545b)

Change-Id: I97d58655505117a5e51cade1043d72ccd1b78874
devfreq: Re-enable simple_ondemand. Also fix simple_ondemand crashing

(cherry picked from commit 1100a7df63ae81eb4deb19f265ba5465e13e636f)

(cherry picked from commit fde539cbaddf9328bdb977f455e844e8ba09483b)

Change-Id: Ic380427b719c319dcdc9e4bd9e3a45d50972b38c
sched: Add bfq scheduler

(cherry picked from commit 674232cb60c87047192e40948270e5091e603675)

(cherry picked from commit 003d491fe63ff010716eaa526e08d3000faf81af)

Change-Id: I0cc97a3daccf8e2249c2be6f337c55f8ee0bdff4
mdss: implement panel color control

Adapted and modified work by CM-10.2, morfic and ktoonsez

Creates a syfs interface here:
/sys/class/lcd/panel/panel_colors

Will accept 0-4 for parameters:
0 - Cold (more blues)
1 - Cool
2 - Normal (stock colors)
3 - Warm
4 - Hot (more reds)

(cherry picked from commit e3548519c119be79073ac0de24a4fdaee7167f9b)

(cherry picked from commit 129ff66abd0b42df54343395d1ed92e0ff2e0e86)

Change-Id: Idaa3e26d6e30d310ed4d8fc7e0876b15bdd45c52
mdss: Modify panel_color code to apply color change without cycling screen

(cherry picked from commit 19dbe944d44367f5d42c1b41134b3659f52a53b8)

(cherry picked from commit a4804b6f770ba3c88ff1e64f50210ab5089d0102)

Change-Id: I9a6e2fdd5dfb8ad266b4016f330de7b5603b165b
sync: don't block the flusher thread waiting on IO

When sync does it's WB_SYNC_ALL writeback, it issues data Io and
then immediately waits for IO completion. This is done in the
context of the flusher thread, and hence completely ties up the
flusher thread for the backing device until all the dirty inodes
have been synced. On filesystems that are dirtying inodes constantly
and quickly, this means the flusher thread can be tied up for
minutes per sync call and hence badly affect system level write IO
performance as the page cache cannot be cleaned quickly.

We already have a wait loop for IO completion for sync(2), so cut
this out of the flusher thread and delegate it to wait_sb_inodes().
Hence we can do rapid IO submission, and then wait for it all to
complete.

Effect of sync on fsmark before the patch:

FSUse%        Count         Size    Files/sec     App Overhead
.....
     0       640000         4096      35154.6          1026984
     0       720000         4096      36740.3          1023844
     0       800000         4096      36184.6           916599
     0       880000         4096       1282.7          1054367
     0       960000         4096       3951.3           918773
     0      1040000         4096      40646.2           996448
     0      1120000         4096      43610.1           895647
     0      1200000         4096      40333.1           921048

And a single sync pass took:

  real    0m52.407s
  user    0m0.000s
  sys     0m0.090s

After the patch, there is no impact on fsmark results, and each
individual sync(2) operation run concurrently with the same fsmark
workload takes roughly 7s:

  real    0m6.930s
  user    0m0.000s
  sys     0m0.039s

IOWs, sync is 7-8x faster on a busy filesystem and does not have an
adverse impact on ongoing async data write operations.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit e9a6566fdaa3722e2960e2ee3ca33ba11b4b1886)

(cherry picked from commit 4ce6f5d303c8b3ca2377dba7e5c0d6e114748f57)

Change-Id: Ic784393028437c1efa23f064f2061069b72d7a76
decompressor: add LZ4 decompressor module

Add support for LZ4 decompression in the Linux Kernel.  LZ4 Decompression
APIs for kernel are based on LZ4 implementation by Yann Collet.

Benchmark Results(PATCH v3)
Compiler: Linaro ARM gcc 4.6.2

1. ARMv7, 1.5GHz based board
   Kernel: linux 3.4
   Uncompressed Kernel Size: 14MB
        Compressed Size  Decompression Speed
   LZO  6.7MB            20.1MB/s, 25.2MB/s(UA)
   LZ4  7.3MB            29.1MB/s, 45.6MB/s(UA)

2. ARMv7, 1.7GHz based board
   Kernel: linux 3.7
   Uncompressed Kernel Size: 14MB
        Compressed Size  Decompression Speed
   LZO  6.0MB            34.1MB/s, 52.2MB/s(UA)
   LZ4  6.5MB            86.7MB/s
- UA: Unaligned memory Access support
- Latest patch set for LZO applied

This patch set is for adding support for LZ4-compressed Kernel.  LZ4 is a
very fast lossless compression algorithm and it also features an extremely
fast decoder [1].

But we have five of decompressors already and one question which does
arise, however, is that of where do we stop adding new ones?  This issue
had been discussed and came to the conclusion [2].

Russell King said that we should have:

 - one decompressor which is the fastest
 - one decompressor for the highest compression ratio
 - one popular decompressor (eg conventional gzip)

If we have a replacement one for one of these, then it should do exactly
that: replace it.

The benchmark shows that an 8% increase in image size vs a 66% increase
in decompression speed compared to LZO(which has been known as the
fastest decompressor in the Kernel).  Therefore the "fast but may not be
small" compression title has clearly been taken by LZ4 [3].

[1] http://code.google.com/p/lz4/
[2] http://thread.gmane.org/gmane.linux.kbuild.devel/9157
[3] http://thread.gmane.org/gmane.linux.kbuild.devel/9347

LZ4 homepage: http://fastcompression.blogspot.com/p/lz4.html
LZ4 source repository: http://code.google.com/p/lz4/

Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Yann Collet <yann.collet.73@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit 053f57e857728f63c89045f694dec5a68bbbe027)

(cherry picked from commit 43103e0a877566b7330953947f10a6f541fdb308)

Change-Id: Iecd48c374552ea39c3d68a2304c4917201098725
lib: add support for LZ4-compressed kernel

Add support for extracting LZ4-compressed kernel images, as well as
LZ4-compressed ramdisk images in the kernel boot process.

Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Yann Collet <yann.collet.73@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit 495d5d7332601f0bdd6deb9c11f6ba9ca7a5beaf)

(cherry picked from commit 1aa64fb0b02518567097327b149281ba6f617729)

Change-Id: I4bcb3519183c11a11fef8ca49fd5cfb0f130bec6
lib: add lz4 compressor module

This patchset is for supporting LZ4 compression and the crypto API using
it.

As shown below, the size of data is a little bit bigger but compressing
speed is faster under the enabled unaligned memory access.  We can use
lz4 de/compression through crypto API as well.  Also, It will be useful
for another potential user of lz4 compression.

lz4 Compression Benchmark:
Compiler: ARM gcc 4.6.4
ARMv7, 1 GHz based board
   Kernel: linux 3.4
   Uncompressed data Size: 101 MB
         Compressed Size  compression Speed
   LZO   72.1MB		  32.1MB/s, 33.0MB/s(UA)
   LZ4   75.1MB		  30.4MB/s, 35.9MB/s(UA)
   LZ4HC 59.8MB		   2.4MB/s,  2.5MB/s(UA)
- UA: Unaligned memory Access support
- Latest patch set for LZO applied

This patch:

Add support for LZ4 compression in the Linux Kernel.  LZ4 Compression APIs
for kernel are based on LZ4 implementation by Yann Collet and were changed
for kernel coding style.

LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
LZ4 source repository : http://code.google.com/p/lz4/
svn revision : r90

Two APIs are added:

lz4_compress() support basic lz4 compression whereas lz4hc_compress()
support high compression or CPU performance get lower but compression
ratio get higher.  Also, we require the pre-allocated working memory with
the defined size and destination buffer must be allocated with the size of
lz4_compressbound.

[akpm@linux-foundation.org: make lz4_compresshcctx() static]
Signed-off-by: Chanho Min <chanho.min@lge.com>
Cc: "Darrick J. Wong" <djwong@us.ibm.com>
Cc: Bob Pearson <rpearson@systemfabricworks.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Herbert Xu <herbert@gondor.hengli.com.au>
Cc: Yann Collet <yann.collet.73@gmail.com>
Cc: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

(cherry picked from commit e1c411c05ca7568203ff71a214723d2e47cf4d7b)

(cherry picked from commit 243cf2164d5befc0fadd8501d8ff747bcd70da08)

Change-Id: I3ff4c3e900d9f7d52e2a70637895cd2a37bd79fa
power: Add option to log time spent in suspend

Below is a patch from android kernel that maintains a histogram of
suspend times. Please review and provide feedback.

Statistices on the time spent in suspend are kept in
/sys/kernel/debug/sleep_time.

Cc: Android Kernel Team <kernel-team@android.com>
Cc: Colin Cross <ccross@android.com>
Cc: Todd Poynor <toddpoynor@google.com>
Cc: San Mehat <san@google.com>
Cc: Benoit Goby <benoit@android.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
[zoran.markovic@linaro.org: Re-formatted suspend time table to better
fit expected values. Moved accounting of suspend time into timekeeping
core. Removed CONFIG_SUSPEND_TIME flag and made the feature conditional
on CONFIG_DEBUG_FS. Changed the file name to sleep_time to better fit
terminology in timekeeping core. Changed seq_printf to seq_puts. Tweaked
commit message]
Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>

(cherry picked from commit 92bbae3b98cc17cf7a2811d2198f7b8aee82e48f)

(cherry picked from commit d3f8d7c56ab399f9b7e8a4c03d00e43d2ddafa6b)

Change-Id: I8e2eb4dd0eb0d0eba0c668a91e91242d70a3f196
sched/debug: Add load-tracking statistics to task

At present we print per-entity load-tracking statistics for
cfs_rq of cgroups/runqueues. Given that per task statistics
is maintained, it can be used to know the contribution made
by the task to its parenting cfs_rq level.

This patch adds per-task load-tracking statistics to /proc/<PID>/sched.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130625080336.GA20175@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

(cherry picked from commit db65c676df1d1639ec448dacc864ddc35427ef22)

(cherry picked from commit c97e81e42eaf558e4c10ffeff234b212a522e4b4)

Change-Id: I80907df20972b0f9db009262e3d645ba2800efb0