msm7x30: copy msm-specific headers.

Change-Id: If77b394cbc98688d085a9227f21b9c5c65eb5bca
Merge "msm7x30: copy msm-specific headers." into jellybean
PM / Sleep: Do not check wakeup too often in try_to_freeze_tasks()

Use the observation that it is more efficient to check the wakeup
variable once before the loop reporting tasks that were not
frozen in try_to_freeze_tasks() than to do that in every step of that
loop.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Conflicts:

	kernel/power/process.c

Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
(cherry picked from commit a15cc22b56b803b8f943c57d9535bdb9953ff3ec)

Change-Id: Ic41cd71a0ec49cd0c633c14aa3fce02025a4de3f
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
earlysuspend: block userspace until late resume completes

Currently the late_resume function runs in a workqueue that is
triggered when the /sys/power/state is changed when the screen
is turned on. The problem this causes is that userspace sets
/sys/power/state to turn the screen on and after
request_suspend_state() returns userspace expects that the
kernel is ready to receive backlight adjustments, however
the backlight driver may not have finished its late_resume()
function yet, because the late_resume workqueue is still running.
Therefore we can get brightness requests before the backlight
driver late_resume function has completed and during the
resume sequence which can cause for undesired backlight
brightness results.

The solution for this is to have the late_resume functions run
within the context of the user space process that triggered the
screen on event. So that the request_suspend_state('wakeup')
function doesn't return until all the late_resume functions
have been completed. And therefore, userspace doesn't send
backlight (and other) requests to the kernel drivers before
they are all resumed.

Signed-off-by: Joe Swantek <w98568@motorola.com>
VFP: compile VFP with NEON optimizations
cpufreq: interactive: reduce chance of zero time delta on load eval

Reschedule load sampling timer after timestamp of sample start taken,
hold spinlock across entire sequence to avoid preemption.  Avoid the
WARN for zero time delta in the load sampling timer function.

Change-Id: Idc10a756f09141decb6df92669521a1ebf0dbc10
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: Fix uninitialized spinlock

Change-Id: I9959669e0f643ccd2bd1072fae440d8c20f1c9cc
ARM: Fix up vfp exception location in thumb mode

The exception handler in entry-armv.S checks for thumb mode and
correctly determines the exception location and instruction,
but VFP_bounce uses the uncorrected location off the stack.
If the VFP exception occured in Thumb mode, fix up the
exception location on the stack to match the value that would
be returned in ARM mode.

Fixes segfaults in userspace applications running in Thumb mode
caused by a handled VFP exception returning to the middle of the
instruction that triggered the exception.

Change-Id: I02be4c5b546561d9a967a02c1e9eb1de876cff07
Original-author: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Colin Cross <ccross@android.com>
ARM: vfp: Move exception address fixup into vfphw.S

If the PC on the stack is updated in entry-armv.S,
do_undefinstr can get called after the fixup.  do_undefinstr
does its own fixup, and doing both causes the PC to point to
half way through an instruction.

Instead, do the fixup in do_vfp, where only the vfp code
can get called.

Change-Id: I6d966887adc8ed58d88bfe0cb3c0ba29213be488
Signed-off-by: Colin Cross <ccross@android.com>
RFC: 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>
CPUFREQ: msm7x30: create a vdd sysfs interface
This is loosely based on snq-'s groundbreaking work, so thank you snq-.

Change-Id: I3b753c976d6034c705150eb44e7f4651985a915b
Revert "cpufreq: interactive: Fix uninitialized spinlock"

This reverts commit 479e8ccabdf3d216aab8678865d37dfef7d7c616.
cpufreq: interactive: allow arbitrary speed / delay mappings

Accept a string of delays and speeds at which to apply the delay before
raising each step above hispeed. For example, "80000 1300000:200000
1500000:40000" means that the delay at or above 1GHz, until 1.3GHz is 80 msecs,
the delay until 1.5GHz is 200 msecs and the delay at or above 1.5GHz is 40
msecs when hispeed_freq is 1GHz.

[toddpoynor@google.com: add documentation]
Change-Id: Ifeebede8b1acbdd0a53e5c6916bccbf764dc854f
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
cpufreq: interactive: fix crash on error paths in get_tokenized_data

Use separate variable for error code, free proper pointer.

Change-Id: Ia83cccb195997789ac6afbf5b8761f7b278196d6
Reported-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: base above_hispeed_delay on target freq, not current

Time to wait should be based on the intended target speed, not the
actual speed (which may be held high by another CPU).

Change-Id: Ifc5bb55d06adddb9a02af90af05398a78f282272
Reported-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
cpufreq: interactive: Fix uninitialized spinlock

Change-Id: I9959669e0f643ccd2bd1072fae440d8c20f1c9cc
staging: android: lowmemorykiller: Add config option to support oom_adj values

The conversion to use oom_score_adj instead of the deprecated oom_adj
values breaks existing user-space code. Add a config option to convert
oom_adj values written to oom_score_adj values if they appear to be
valid oom_adj values.

Change-Id: I68308125059b802ee2991feefb07e9703bc48549
CRs-Fixed: 389463
Signed-off-by: Arve HjÃ¸nnevÃ¥g <arve@android.com>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
lowmemorykiller: fix missing /sys/module/lowmemorykiller/adj

Commit 'Add config option to support oom_adj values' adds the function
'__module_param_call' to add adj but the parameters are for kernel 3.4.
Change the parameters for kernel 3.0.
Merge remote-tracking branch 'upstream/jellybean' into jellybean