msm: mdss: During status check for mdp3, only prevent off

Other mdp3 operations should be allowed as normal.  All locking necessary
for sending commands for the status check while continuing to send new
frames is already handled.

Change-Id: I8ffc0ce19a61c0d5372bc1d4ddce20fc1ce4915c
Signed-off-by: Patrick Auchter <auchter@motorola.com>
Reviewed-on: http://gerrit.mot.com/627484
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Bang Nguyen <bangnguyen@motorola.com>
Reviewed-by: Fred Fettinger <fettinge@motorola.com>
Reviewed-by: Zachary Crosby <zac@motorola.com>
Reviewed-by: Stephen Rossbach <rossbach@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit 5ed0b309c6ec5a3f10a51696ce3973d0e3253931)
arm/dts: peregrine: Change the duration for accel

Compared with falcon, the vibration of peregrine is nearer to
the accel sensor. It brings more noise to the accel sensor
and make the phone rotate wrongly.
Increased the duration time will decrease the
noise interruption.

Change-Id: I9660771be34ac5d252072be562f941bbe62b0eb7
Signed-off-by: Xiaofei Ma <xiaofei@motorola.com>
Reviewed-on: http://gerrit.mot.com/629328
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Robert Wiegand <Robert.P.Wiegand@motorola.com>
Reviewed-by: Jagatkumar Shah <jagat@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit 9df10e70f7c255572f5bb8f52215bfa94cc9bef9)
misc: lis3dh_mot: Enable x/y/z interrupts for rotation

When user swich from -90 to 90 quickly, phone
can not detect the interrupt because Y direction
is disabled before. Need to enable it.

Change-Id: I28af1cac35a8f034e6946fe88689f91e04a06ea6
Signed-off-by: Xiaofei Ma <xiaofei@motorola.com>
Reviewed-on: http://gerrit.mot.com/629342
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Jagatkumar Shah <jagat@motorola.com>
Reviewed-by: Robert Wiegand <Robert.P.Wiegand@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit 62a4693e21cf62b34a6c60858cdd3e3e737a5dd1)
defconfig: 8610-debug: enlarge do_exit() timeout

When using external sdcard, 5 minutes timeout is not enough for coredumps
to complete when the system burden is high and the sdcard is busy.
So, we enlarge the time to 10 minutes.
The default time for user build is 15 minutes.

Change-Id: Id2646bc725542679e059dcee0c78fdbdce1d3370
Signed-off-by: Hong-Mei Li <a21834@motorola.com>
Reviewed-on: http://gerrit.mot.com/628057
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit c65e2f9afc78cd170e1dd831f82c5ab72cf1d4e6)
Create new carrier channel ID for Yoigo

   Adding the new carrier channel ID 'yoigo' for Yoigo Spain

Change-Id: I5786e25c35d48c33e2ab582e6b163c2de888c863
Signed-off-by: Eliseu Massing <dmht43@motorola.com>
Reviewed-on: http://gerrit.mot.com/631467
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Tarciano Facco Pegoraro <tarciano@motorola.com>
Reviewed-by: Russell Knize <rknize@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
SLTApproved: Robert Neely <wrn002@motorola.com>
(cherry picked from commit 8e15ffc5f031da4fe33379b0c44a34a7ef72addf)
power: qpnp-charger: Handle missed disconnects in heartbeat

The update heartbeat check in the qpnp-charger driver ignores cases where the
usb bus is suspended. Hence the workaround for missed USB-IN irq's does not
execute for cases where the bus is suspended and the USB-IN irq is not recieved.
Modify the workaround by checking the USB_VALID bit against the chip->usb_present
which is always updated in the USB-IN irq handler.

Change-Id: Iadd0953cfdce3b09b0cc0f6a201e2de2018048da
Signed-off-by: Ravi Vembu <a18394@motorola.com>
Reviewed-on: http://gerrit.mot.com/629124
SLTApproved: Slta Waiver <sltawvr@motorola.com>
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
Reviewed-by: Vidyadhar Gurram <rnh786@motorola.com>
Reviewed-by: Kumar Venkatesh <kumarv@motorola.com>
(cherry picked from commit 172d071b9443e76d5f690b455ef491175532f90e)
mmc: don't blindly retry on timed-out flushes

The commit "mmc: block: flush request requeue after timeout"
introduced logic that blindly requeues flush requests that have
timed-out without checking the card state or taking advantage of
any of the error recovery logic in the driver.  This leads to an
infinite loop if the card continues to time out because of how
flush requests are prioritized over other requests.

This commit disables the retry except in the case of Hynix cards.

Change-Id: Ie545de673cc6588fa193dc31f43f150db7490c90
Signed-off-by: Russ Knize <Russ.Knize@motorola.com>
Reviewed-on: http://gerrit.mot.com/638228
Tested-by: Jira Key <jirakey@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
SLTApproved: Connie Zhao <czhao1@motorola.com>
Reviewed-by: Sergio Silva Vilela <sergiov@motorola.com>
Submit-Approved: Jira Key <jirakey@motorola.com>
(cherry picked from commit 3f3abb77859f8e817a3faa716b816286ea0018ae)
gitignore: add user ignores

Signed-off-by: Paul Reioux <reioux@gmail.com>
scripts: remove localversion "+" from kernel version strings

Signed-off-by: faux123 <reioux@gmail.com>
Pronto WLAN: merge with kernel tree

Signed-off-by: Paul Reioux <reioux@gmail.com>
lib/memcopy: use glibc version

the kernel's memcpy and memmove is very inefficient. But the glibc version is
quite fast, in some cases it is 10 times faster than the kernel version. So I
introduce some memory copy macros and functions of the glibc to improve the
kernel version's performance.

The strategy of the memory functions is:
1. Copy bytes until the destination pointer is aligned.
2. Copy words in unrolled loops.  If the source and destination are not
   aligned in the same way, use word memory operations, but shift and merge
   two read words before writing.
3. Copy the few remaining bytes.

Signed-off-by: Miao Xie <miaox*******>
Signed-off-by: faux123 <reioux@gmail.com>
lib/string: use glibc version

the performance of memcpy and memmove of the general version is very
inefficient, this patch improved them.

Signed-off-by: Miao Xie <miaox*******>
Signed-off-by: faux123 <reioux@gmail.com>
Optimized ARM RWSEM algorithm

RWSEM implementation for ARM using atomic functions.
Heavily based on arch/sh/include/asm/rwsem.h

Signed-off-by: Ashwin Chaugule <ashwinc@codeaurora.org>
arm/crypto: Add optimized AES and SHA1 routines

Add assembler versions of AES and SHA1 for ARM platforms.  This has provided
up to a 50% improvement in IPsec/TCP throughout for tunnels using AES128/SHA1.

Platform   CPU SPeed    Endian   Before (bps)   After (bps)   Improvement

IXP425      533 MHz      big     11217042        15566294        ~38%
KS8695      166 MHz     little    3828549         5795373        ~51%

Signed-off-by: David McCullough <ucdevel@gmail.com>
Signed-off-by: faux123 <reioux@gmail.com>
scheduler: compute time-average nr_running per run-queue

Compute the time-average number of running tasks per run-queue for a
trailing window of a fixed time period. The detla add/sub to the
average value is weighted by the amount of time per nr_running value
relative to the total measurement period.

Change-Id: I076e24ff4ed65bed3b8dd8d2b279a503318071ff
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
(cherry picked from commit 3a12d7499cee352e8a46eaf700259ba3c733f0e3)
Reviewed-on: http://git-master/r/111635
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Tested-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

forward ported to Linux 3.4 for use on S-800

Signed-off-by: Paul Reioux <reioux@gmail.com>
proc: enhance time-average nr_running stats

Add time-average nr_running to loadavg printout

Bug 958978

Change-Id: I5c6904efb52a86f4964eb66c1576fc91f60f5b1d
Signed-off-by: Alex Frid <afrid@nvidia.com>
(cherry picked from commit 86f3642cc44a69d1e4798719bd9182cd6923f526)
Reviewed-on: http://git-master/r/111636
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Tested-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
scheduler: Re-compute time-average nr_running on read

Re-compute time-average nr_running when it is read. This would
prevent reading stalled average value if there were no run-queue
changes for a long time. New average value is returned to the reader,
but not stored to avoid concurrent writes. Light-weight sequential
counter synchronization is used to assure data consistency for
re-computing average.

Change-Id: I8e4ea1b28ea00b3ddaf6ef7cdcd27866f87d360b
Signed-off-by: Alex Frid <afrid@nvidia.com>
(cherry picked from commit 527a759d9b40bf57958eb002edd2bb82014dab99)
Reviewed-on: http://git-master/r/111637
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Tested-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

forward ported to Linux 3.4 for use on Mako

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

Conflicts:

	kernel/sched/sched.h
cpufreq/cpufreq_intellidemand: intellidemand cpufreq governor (version 4.0)

Intellidemand is inspired by ondemand governor. Its main features are:

 - auto cpu hotplugging based on runnable thread average calculations
 - detection of browsing mode (long screen on activities with moderate run
   queue depth =< 45 )
 - limit max frequencies when in browsing mode to conserve battery for long
   duration tasks

Browsing State Determination:
 1- Browsing state is enabled as power-on default. Browsing state is disabled
    when run queue depth is > 45 (very high instantaneous spikes)

Browsing State Limit Max Freq Logic (sliding window algorithm):
 1- While Screen is ON > 3 min, and average load of the CPU is < 35%, then
    CPU Max frequencies will remain power-on default
 2- While Screen is On, if average CPU load > 35%, both CPUs max frequencies
    will be limited to a lower user configurable max value
 3- While Screen is On, After both CPUs' Max is limited to lowered max, when
    the average CPU load has dropped down to less than < 25%, then both CPUs
    Max freq will be restored to back to power-on default

Runnable Thread Auto-hotplug (fast hotplug / slow unplug algorithm):
 1- When average number of running thread is < threshold, 2nd cpu will be
    unplugged.
 2- When > threshold, 2nd cpu will be hotplugged.
 3- The logic applies a fast hotplug and slow unplug algorithm so 2nd core
    will stay enabled longer to help deal with performance spikes

changes from Ver 2.0 -> Ver 3.0:
  - remove GPU Busy dependency for browsing state detection (this will make
    the governor more portable to other platforms without specific GPU
    architecture knowledge)

dependencies:
  -- Qualcomm's run queue average logic (SOC independent logic)
  -- TI's runnable thread average logic (SOC independent logic)

forward ported to Linux 3.4 for use on S-800

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

Conflicts:
	arch/arm/mach-msm/cpufreq.c
intellidemand: Add boost pulse capability

Boost pulse increases UI performance by increasing CPU freq and
reduce sampling time.

forward ported for Linux 3.4 for use on Mako
Signed-off-by: faux123 <reioux@gmail.com>
intellidemand: add bug fixes

 - Fix crash input event handler on governor switch
 - Fix panic when setting sampling rate

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