defconfig: changes for qcom mpdecision

Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
build.sh: changes for mpdecision

Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
msm: rq_stats: fix build

Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
msm: msm_rq_stats: remove is_smp() API

is_smp() API is unavailable on few target codes.
Until this API is defined use CONFIG_SMP to know
whether target supports SPM are not.

CRs-fixed: 579034
Change-Id: I5bd5c208b18aae27d7f36e77e9d5b38639c2c00e
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
msm:rq_stats: Register for Cpufreq policy notification

Currently the load of the system is calculated using the max
frequency that is read during startup(It does not get updated
when the policy changes). As a result, the average load of the
system is incorrectly calculated and the system might not bring
the cpus online to manage the additional load. This
reduces the performance of the system.

To fix this issue, register rq_stats to receive cpufreq policy
notifications. Update the policy's max frequency when a
notification is received and use that value to calculate the load.

Change-Id: Icc78e28c736c170e198f723fd96c13dfb2dafe8a
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
msm: rq_stats: Use cpufreq API to get the current frequency

Since the acpuclock APIs are deprecated, use the cpufreq to
get the current frequency of CPUs to calculate the cpu
normalized load value.

Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
msm: rq_stats: Fix wrong usage of cpufreq_quick_get()

cpufreq_quick_get() returns frequency in KHz, which is exactly what
cur_freq expect. Remove the wrong multiplication.

Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
msm: rq_stats: Calculate load based on current freq limit

Prior to this patch, load has been calculated based on an initial
value of policy.cpuinfo.max_freq. This value may change for several
reasons: userspace settings, thermal throttling (hello hammerhead!)
or extended frequency tables where the absolute maximum level is
often not used during regular operations. This results in unreliable
calculations. Consider current policy.max to fix this behaviour.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
msm: msm_rq_stats: Tone down mpdecision

Add a new Kconfig to enable more conservative computations sent
to mpdecision:

 * Do not make IO busy
 * Do a time window weighted load computation instead of just a sum
 * Do an sliding window averaged time computation for number runnable

The purpose of these changes is to make mpdecision less likely to
keep extra cores online.  It currently has a tendancy to run more
cores running than needed and this can even cause some lag issues.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
msm: rq_stats: small change to current cpu policy

Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
Revert "blu_active: use cal_freq, remove target_loads"

This reverts commit ec3778e3f2689f55ce56a51b1273862ffba0882d.
sched: Compute avg_nr_running for RQ Stats

Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
defconfig: update

Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
sched_avg: add run queue averaging

Add code to calculate the run queue depth of a cpu and iowait
depth of the cpu.

The scheduler calls in to sched_update_nr_prod whenever there
is a runqueue change. This function maintains the runqueue average
and the iowait of that cpu in that time interval.

Whoever wants to know the runqueue average is expected to call
sched_get_nr_running_avg periodically to get the accumulated
runqueue and iowait averages for all the cpus.

Change-Id: Id8cb2ecf0ed479f090a83ccb72dd59c53fa73e0c
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
(cherry picked from commit 0299fcaaad80e2c0ac9aa583c95107f6edc27750)
Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>

Conflicts:
	kernel/sched/Makefile
	kernel/sched/sched.h
cpufreq: Add "bacon" governor

* This is nothing but polished interactive governor
  branded as "bacon" since it was adapted from bacon
  device.
* It is minimally tuned in the code. Full configuration
  is required in ramdisk for it to work properly.
* Added on mass demand.

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>

Conflicts:
	drivers/cpufreq/Kconfig
	drivers/cpufreq/Makefile
	include/linux/cpufreq.h
defconfig: update

Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
Revert "blu_active: add down load threashold to keep cal_freq better on low loads"

This reverts commit 86ab6c75d09e34aad96dc21f2255c7145d2b6e83.
bacon: remove rt.h

Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
defconfig: enable msm_limiter

Signed-off-by: Stefanescu Cristian <howerkraft@gmail.com>
Revert "ASoC: msm: Add support to enable audio post processing in DSP"

This reverts commit c247256a0afcbd28c0b5babd84b2ff7da25b5419.