xz: Optimize Sfck Compression

(cherry picked from commit a1a06bdf318bb7b1f9043189e5593948d14074ab)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	scripts/gen_initramfs_list.sh
	scripts/xz_wrap.sh
cpuidle: Set residency to 0 if target Cstate not enter

When cpuidle governor choose a C-state to enter for idle CPU, but it notice that
there is tasks request to be executed. So the idle CPU will not really enter
the target C-state and go to run task.

In this situation, it will use the residency of previous really entered target
C-states. Obviously, it is not reasonable.

So, this patch fix it by set the target C-state residency to 0.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
(cherry picked from commit a67be449feb52cf4edc2d1a5dbe45bdf3fe00731)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
cpuidle: Get typical recent sleep interval

The function detect_repeating_patterns was not very useful for
workloads with alternating long and short pauses, for example
virtual machines handling network requests for each other (say
a web and database server).

Instead, try to find a recent sleep interval that is somewhere
between the median and the mode sleep time, by discarding outliers
to the up side and recalculating the average and standard deviation
until that is no longer required.

This should do something sane with a sleep interval series like:

	200 180 210 10000 30 1000 170 200

The current code would simply discard such a series, while the
new code will guess a typical sleep interval just shy of 200.

The original patch come from Rik van Riel <riel@redhat.com>.

Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
(cherry picked from commit 602178eba0d9486912e953d92bee63c58bcaccb6)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
cpuidle: Fix finding state with min power_usage

Since cpuidle_state.power_usage is a signed value, use INT_MAX (instead
of -1) to init the local copies so that functions that tries to find
cpuidle states with minimum power usage works correctly even if they use
non-negative values.

Signed-off-by: Sivaram Nair <sivaramn@nvidia.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
(cherry picked from commit 8230b7456d95f05b47c70549f0895a369c60e3d1)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
sched/cpuidle: reduce IPI store. Backport upstream 3.16 scheduler updates

Signed-off-by: Paul Reioux <reioux@gmail.com>
(cherry picked from commit 4736e7bc6a432a0c5282d1fd6a76e62dc6ca075d)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
make it 2000

Signed-off-by: thirdzcee <thirdzcee@gmail.com>
s2w/dt2w:clean up unused kt code and now fully export the fucntion to enable and disable s2w/dt2w using faux's sysfs,
in short trickstermod can now activate or deactivate dt2w/s2w properly

Signed-off-by: thirdzcee <thirdzcee@gmail.com>
msm: qpnp-power-on: Add API to reset and shutdown the system

Add an API to allow the system to reset or shutdown, depending on
the parameter passed. The qpnp-power-on driver supports any number
of PON devices, but only one device is permissible to reset the
device. Introduce a new Device Tree binding to indicate which
device should be responsible for this resetting the system.

Change-Id: I4086b50402a5c997fb0efada3e65116eec8f4e53
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
(cherry picked from commit 6e34b5121de2ff881cb432e23eec857c168c1314)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
msm: qpnp-power-on: Add API to detect warm reset

Add an API to allow consumers to know whether the PMIC went through
a warm or cold boot. This currently only checks the PON device that
allows resets.

Change-Id: Id145ec62bbdf0e4988476f2c2084f92c3f588209
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
(cherry picked from commit 6cc3271dd893a71b293f456f3755d38d4aa943ba)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	drivers/platform/msm/qpnp-power-on.c
msm: qpnp-pon: Add API to configure the PON trigger source

The API enables/disables power-on trigger capability of a PON source.
If a specific PON trigger is disabled it cannot act as a power-on
source to the PMIC.

CRs-Fixed: 489577
Change-Id: Ibec2063215eafc47701a3e255849e16f1d7b2cee
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
(cherry picked from commit d73f989ff223a07fa60981c7b05793e7dade2574)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	drivers/platform/msm/qpnp-power-on.c
s2w/dt2w:prevent touches during phone call

Signed-off-by: thirdzcee <thirdzcee@gmail.com>