kgsl combined changes

msm: kgsl: Align ION buffer mappings from userspace to 4k
When userspace allocates an ION buffer and maps it to GPU virtual space,
adjust the buffer size to be 4k aligned before mapping it to GPU virtual
space. GPU virtual space map routine expects the buffer to be 4k
aligned.

Change-Id: Ibdb95597c24e2b5d0c3390d2c8550abb6b4b730b
Acked-by: Rama Vaddula <rvaddula@qualcomm.com>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>

msm: kgsl: Avoid turning on GPU clock if already off
In adreno_idle(), check if the GPU clock is already
turned off. If so, the GPU is already idle,
so don't turn on the clocks again.

Change-Id: I27ae939253ee71830466e3117bed0230d7ff67d5
Signed-off-by: Ananta Kishore K <akollipa@codeaurora.org>
cpufreq: use adequate nightmare governor (Thx Alucard24)
block: Update BFQ scheduler to BFQ-v7r6 for 3.4.0

. IMPROVEMENT: Introduced a new mechanism that helps get the job done
more quickly for services and applications that create or reactivate
many parallel I/O-bound processes. Examples are systemd at boot, or
commands such as git grep.
. CODE IMPROVEMENTS: Small code cleanups and improvements.

Signed-off-by: Paolo Valente <paolo.valente@unimore.it>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
kgsl: Do not return invalid power stats when the device is off

adreno_power_stats() was returning unitialized data when the device
state was not active. Leave early from the function if the device
is not active and return 0s instead.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Revert "lzo: properly check for overruns"

This reverts commit 2a42c97bb8e1869011219784eeee4335144b800b.
lzo: check for length overrun in variable length encoding.

This fix ensures that we never meet an integer overflow while adding
255 while parsing a variable length encoding. It works differently from
commit 206a81c ("lzo: properly check for overruns") because instead of
ensuring that we don't overrun the input, which is tricky to guarantee
due to many assumptions in the code, it simply checks that the cumulated
number of 255 read cannot overflow by bounding this number.

The MAX_255_COUNT is the maximum number of times we can add 255 to a
base
count without overflowing an integer. The multiply will overflow when
multiplying 255 by more than MAXINT/255. The sum will overflow earlier
depending on the base count. Since the base count is taken from a u8
and a few bits, it is safe to assume that it will always be lower than
or equal to 2*255, thus we can always prevent any overflow by accepting
two less 255 steps.

This patch also reduces the CPU overhead and actually increases
performance
by 1.1% compared to the initial code, while the previous fix costs 3.1%
(measured on x86_64).

The fix needs to be backported to all currently supported stable
kernels.

Reported-by: Willem Pinckaers <willem@lekkertech.net>
Cc: "Don A. Bailey" <donb@securitymouse.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
ramfs: busybox update (thx dorimanx) +  little stweaks changes
cpufreq / stats: fix race between stats allocation and first usage

This patch forces complete struct cpufreq_stats allocation for all cpus
before
registering CPUFREQ_TRANSITION_NOTIFIER notifier, otherwise in some
conditions
cpufreq_stat_notifier_trans() can be called in the middle of stats
allocation,
in this case cpufreq_stats_table already exists, but stat->freq_table is
NULL.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
1.1.9 rc1