msm: kgsl: Avoid null address to pass in kgsl_mmu_map

author	Wei Zou <wzou@codeaurora.org>
msm: kgsl: reset more registers during gmem save/restore

The gmem save and restore code needs additional registers to
be known states to avoid visual artifacts.

author	Wei Zou <wzou@codeaurora.org>
msm: kgsl: Remove check to allow client specified allocation size.

Remove check to allow clients to specify the size of memory required.
This check was incorrectly failing on allocation of large buffers.

CRs-fixed: 287489
Signed-off-by: Richard Ruigrok <rruigrok@codeaurora.org>
modified by faux123
msm: kgsl: fix mmu fault arising from multicontext scenario

under certain context destruction & creation scenarios, the
mmu was not being reprogrammed appropriately with the new
context's pagetable. This resulted in the core executing
commands with pagetable not matching the context. Code resets
the state of the mmu struct to default pagetable upon context
destruction.

Change-Id: I687f32741bdcac561b0ae083040fe7829d00a10b
CRs-fixed: 287344
Signed-off-by: Raj Kushwaha <rajk@codeaurora.org>
msm: kgsl: Don't make assumptions about VMA regions

We cannot assume that a VMA region created as a result of an mmap
belongs exclusively to us.  Allow the user to pass the size of
the vmalloc region through the 'gpuaddr' member of the ioctl
struct and do strict checking on the returned vma to make sure
it is valid.

Wei Zou <wzou@codeaurora.org>
Modded by faux123
Rework ACPU table & CPU Voltages
lower wifi voltages
Lower virtual key backlight voltage
Increase grp3d max freq
Tune CPU Governors
my bad
gitignore update
mmc: core: Prevent too long response times for suspend

While trying to suspend the mmc host there could still be
ongoing requests that we need to wait for. At the same time
a device driver must respond to a suspend request rather quickly.

Instead of potentially wait "forever" by claiming the host we now
"try" to claim the host instead. If it fails, -EBUSY is returned.

Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Reviewed-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>

CRs-Fixed: 325090

[sthumma@codeaurora.org: Squash commit 49df7807]
[sthumma@codeaurora.org: Skip the implementation for SDIO cards]
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
(cherry picked from commit ec6202f)

Change-Id: Ib9cc2a24733e02d952adfad257b162e6ea299476
Signed-off-by: Swetha Basineni <sbasin@codeaurora.org>
Battery: Charger updates from Ruby
Remove redundant code following battery update
Reset cpufreq permissions
thermal: tsens: Add suspend/resume for TSENS

TSENS does not operate reliably during VDD_CX minimization.
Incorrect temperature readings are reported on some instances
when Apps processor comes out of suspend. This leads the
TSENS interrupt being triggered in critical temperature zone.

Thermal sys takes drastic action of shutting down the phone
which is not desired. Hence remove updating the thermal sys
on temperature changes as its not required.

CRs-Fixed: 309855
Change-Id: Id6186b2a6032150273bc0d74d91c72db5a077ac7
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
printk: Don't allow cpu to get console lock during hotplugging

The flush of the console takes unnecessary time during the cpu
hotplug up operation.  It can delay the rcu synchronize_sched
operation, which in turn delays the hotplug operation. The flush
delays rcu synchronize_sched during scheduling domain creation
by up to 100 ms by interrupting the move to a quiescent state.
This change delays the flush of the console to later in the
notification chain of cpu_online. At the point in the cpu_up
operation where the flush now occurs, other tasks can already
be scheduled on the cpu that just came up.

Signed-off-by: Maya Spivak <mspivak@codeaurora.org>
(cherry picked from commit c7108258d7e44b56842f8215e31d7310f86febaa)

Change-Id: I2986071a5b05760e05d86da2f33ea2a9fe882469
Signed-off-by: Swetha Basineni <sbasin@codeaurora.org>
kernel:sched: LOAD_FREQ (4*HZ+61) avoids loadavg Moire

LOAD_FREQ is (5*HZ+1) to avoid high load average when idle:
http://kerneltrap.org/mailarchive/linux-kernel/2007/10/3/328568

I suggest (4*HZ+61) for a better distribution.

With some seconds based load (like SSL heartbeats)
and LOAD_FREQ at (5*HZ+1) I see Moire patterns like inverse sawtooth,
since 2 or 3 probes hit the jobs (load increases quickly),
followed by several probes missing it.

A 4.61 sec interval gives optimal distribution over when within a
second a probe is taken, as .61 is close to golden ratio phi 1.618...
(test in http://ripke.com/goldenratio.c).

12*4.61 = 55.32 secs is still close to a minute,
and 13*4.61=59.93 is even closer than the current 12*5.01=60.12
(with exponents EXP_x adjusted to a ratio of 13 instead of 12).
rcu-tree: Check for extended quiescent state at start of gp

During a cpu_hotplug event, it is much more likely for a cpu to be in
extended quiescent state. For example, on cpu_up, tasks are not yet
schedulable on the cpu that is coming up, so that cpu will not context
switch.  Additionally, cpu_down occurs on our dual-core system when
there is not a heavy load on the cpus, which means the cpus are less
likely to context switch. Checking for extended quiescent state at the
beginning of the grace period decreases the hotplug latency because the
rcu process does not necessarily have to wait tens of milliseconds to
force a quiescent state.

Signed-off-by: Maya Spivak <mspivak@codeaurora.org>
(cherry picked from commit 18f8787b8c476fe5e55f0415361faf5d437b76be)

Change-Id: I73063c4065395782cc2750db3086666f3474f9a4
Signed-off-by: Swetha Basineni <sbasin@codeaurora.org>