ION : Fix memory leak issue for TILER 2D buffers

The ION was not freeing all allocated physical pages.

Change-Id: I079a8ef68afce42e425739fcc5873d4bdd9393b8
Signed-off-by: Lakshman Gowda <lakshman79@ti.com>
(cherry picked from commit bc52ad012af778f73de30d9a63db2624aaf328f2)

Conflicts:

	drivers/gpu/ion/omap/omap_tiler_heap.c
[ARM] omap: try not to allocate memory page by page

Instead, try to allocate memory for all physical pages together.  Idea from
Lakshman Gowda <lakshman79@ti.com>.  Speeds up allocations from the
tiler carveout by ~50ms.

This patch also combines three kzallocs into one.

Signed-off-by: Iliyan Malchev <malchev@google.com>
(cherry picked from commit cdbe1235a8c6539cb83a9e50d52d33ef8a390cf2)
PM / Hibernate: Correct additional pages number calculation

The struct bm_block is allocated by chain_alloc(),
so it'd better counting it in LINKED_PAGE_DATA_SIZE.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
(cherry picked from commit 160cb5a97daef0cb894685d84c9d4700bb7cccb4)
panic: don't print redundant backtraces on oops

When an oops causes a panic and panic prints another backtrace it's pretty
common to have the original oops data be scrolled away on a 80x50 screen.

The second backtrace is quite redundant and not needed anyways.

So don't print the panic backtrace when oops_in_progress is true.

[akpm@linux-foundation.org: add comment]
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 6e6f0a1f0fa6bba1493c296eb30d1e176e1f8530)
PM / Hibernate: Drop the check of swap space size for compressed image

For compressed image, the space required is not known until
we finish compressing and writing all pages.
This patch drops the check, and if swap space is not enough
finally, system can still restore to normal after writing
swap fails for compressed images.

Signed-off-by: Barry Song <Baohua.Song@csr.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
(cherry picked from commit ee34a37049114303011e154478c63b977bcff24c)
Upgrade android binder to 3.4 version
Import low memory killer from android 3.4
Enable ANDROID_LOW_MEMORY_KILLER_AUTODETECT_OOM_ADJ_VALUES
Upgrade android drivers to 3.4 version
Really add those 3.4 missing files
Sync with 3.4 Defconfig
Remove Derp
sched: Prevent wakeup to enter critical section needlessly

Check the waitqueue task list to be non empty before entering the critical
section. This prevents locking the spin lock needlessly in case the queue
was empty, and therefor also prevent scheduling overhead on a PREEMPT_RT
system.

Signed-off-by: Ivo Sieben <meltedpianoman@gmail.com>
backported from Linux 3.5+ by faux123
timers: Avoid finding cpu for migration of running timers in __mod_timer()

Currently we don't support migration of currently running timers. Current code
flow in __mod_timer() is:
- Find a cpu where we should migrate the timer
- Check if timer is currently running
- If yes, don't migrate.

In this process, the first step is a unnecessary activiy, if the timer is
currently running. This patch tries to avoid it in such cases.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
backported from Linux 3.5+ by faux123
cpufreq: interactive: run at fraction of hispeed_freq when load is low

When load is below go_hispeed_load, apply the percentage of CPU load to
a max frequency of hispeed_freq instead of the max speed.  This avoids
jumping too quickly to hispeed_freq when it is a relatively low
percentage of max speed.  This also allows go_hispeed_load to be set to
a high percentage relative to hispeed_freq (as a percentage of max speed,
again useful when hispeed_freq is a low fraction of max speed), to cap
larger loads at hispeed_freq.  For example, a load of 60% will typically
move to 60% of hispeed_freq, not 60% of max speed.  This causes the
governor to apply two different speed caps, depending on whether load is
below or above go_hispeed_load.

Also fix the type of hispeed_freq, which was u64, to match other
speed data types (and avoid overhead and allow division).

Change-Id: Ie2d0668be161c074aaad77db2037505431457b3a
Signed-off-by: Todd Poynor <toddpoynor@google.com>
OMAP4: cpuidle: don't touch mpu and core state until CPU1 is off

OMAP4: cpuidle: don't touch mpu and core state until CPU1 is off

MPU/Core logic and PD states shouldn't be changed until CPU1 is
completely off

Change-Id: Ia90126776e7bd7108c7b885c622df36323982cb0
Signed-off-by: Lianwei Wang <lian-wei.wang@motorola.com>
Signed-off-by: suilunlam <a0868997@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
ARM: OMAP4: cpuidle: Configure MPU C4 state to OSWR

ARM: OMAP4: cpuidle: Configure MPU C4 state to OSWR

Due to MPU_EMIF_NO_DYNDEP_IDLE_iXXX, MPU->EMIF dynamic dependency
is disabled when going to LP mode. This allows us to enable deeper
power state for MPU as MPU can transition to lower power state
independent of core power domain. We have observed 1.5mA saving in
OS Idle Screen on use case.

Change-Id: If4ec4426626dabf810b1f21ed33cdabafa386d5f
Signed-off-by: Madhusudan Chittim <c-madhu@ti.com>
cpuidle44xx: match exit_latency and target_residency closer to measured

Signed-off-by: Paul Reioux <reioux@gmail.com>