cpufreq: interactive: don't handle transition notification if not enabled

If multiple governors are in use then avoid processing frequency transition
notifications for CPUs on which the interactive governor is not enabled.

Change-Id: Ibd75255b921d887501a64774a8c4f62302f2d4e4
Reported-by: Francisco Franco <francisco.franco@cloudcar.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c make it a little bit more aggressive.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
gpu: ion: Use writecombine for uncached mappings

When we map ion buffers as uncached we want to map them as
uncached but still be able to use buffering of transactions
since turning off buffering has a severe performance impact.

Change-Id: I5a09ac34bd3ce3f001d10d9efd71d140f632564d
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Compile with androideabi.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: acpuclock-krait: NULL terminate L2 table for find_cur_l2_level()

find_cur_l2_level() assumes that the L2 table is NULL terminated
when it has never been terminated. Therefore, if the rate that is
read from the hardware during boot is not found in the table we
will run off the end of the table and read potential junk values.
NULL terminate all the L2 tables so that the loop in
find_cur_l2_level() is guaranteed to terminate.

Change-Id: Ia5d0213000b44def35e388fd3cadf0293344257b
Reported-by: Laura Abbot <lauraa@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: acpuclock-krait: Keep the secondary MUX input fixed

With use of the QSB clock source recently eliminated, only one
input of the secondary clock MUX is used on any target. Since
there is overhead involved reprogramming this MUX when changing
the CPU and L2 frequencies, change the code to just program the
MUX at boot.  Most noticeably, this removes a 1us delay from
every CPU and L2 frequency switch.

Change-Id: I5cd8c981f1be49be7dbba1310d84df439e8be83b
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: acpuclock-8064: Lower VDD_DIG voltage vote for L2 at 384MHz

New characterization data shows that vdd_dig voltage for L2@384MHz
can be lowered to 0.95v. Update the data in this patch.

Change-Id: Ibdb8568eca4d4ed602c5a5fee2f433a098dfbdcd
Signed-off-by: Tianyi Gou <tgou@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
mmc: fix async request mechanism for sequential read scenarios - original commit: https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commit;h=69bd0fb097801df0ceb382f72cbb412a115c86d3

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "mmc: fix async request mechanism for sequential read scenarios - original commit: https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commit;h=69bd0fb097801df0ceb382f72cbb412a115c86d3"

This reverts commit f0c97cf07ba5dfc5f7947b6f79dc44e6d0f86140.
auto_hotplug.c: only call CPU offlining if avg_running < disable_load/2, online_cpus > 1 and if BOOSTPULSE is up. Decreased the BOOSTPULSE unpause timing to 2 seconds from 5. Add BOOSTPULSE function call to the touch driver so that the device keeps 2 cores up when the user is interacting with the device.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Add ROW I/O Scheduler by Qualcomm.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: cpufreq: fix a race between hotplug and cpufreq

When msm_cpufreq_target() is called without holding the policy
semaphore, there is a rare chance that the cpu gets hotplugged in
the acpuclk_set_rate. The probability of this issue increases
when cross-calling is used or using interactive governor which
tries to set all cpu frequencies from a single thread.

Add a hotplug notifier and set the device_suspended flag holding
the suspend mutex, when cpu is going down. This mutex is always
held when frequency changes are done.

Change-Id: Ide3aa6927ad60d2512d63761c51bb15117461250
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: cpufreq: Remove cross-calling limitation

Remove cross-calling limitations imposed by cpufreq. Clock drivers
and SPM driver now allow changing of frequencies from any core. Using
cpus_allowed mask to check for core affinity works well with workqueues
but do not port so well when the core requesting frequency change is a
kthread with the flag PF_TASK_BOUND not set.

Change-Id: Iab664ce8657780814440a11dff77cc925df597f8
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: cpufreq: increase priority of thread that increases frequencies

When the cpufreq governors request for increase in frequency from kworker
threads, there is chance that the kworker thread is cpu starved due to
other high priority threads, leading to undesirable increase in frequency
ramp-up latency. Add the calling thread to SCHED_FIFO policy when
requesting for increase in frequency and restore back to original policy
after ramp-up is completed.

Change-Id: Ie4fa199b7f9087717cb94dfcc2eddea27cc0012b
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
msm: cpufreq: Implement suspend/resume for cpufreq driver

Cpufreq suspend variable get's updated in kernel pm notifier
callback which gets called in process context. This will create
window where cpufreq governor may try to change the frequency
before suspend variable is updated while resume.

Define suspend/resume for cpufreq driver to update suspend variable
in atomic context.

Don't update the policy->cur upon cpufreq driver failure.

CRs-fixed: 423791
Change-Id: Id78705f5c3b8bf801c6253e9362299280903769f
Signed-off-by: Anji Jonnala <anjir@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "msm: cpufreq: Implement suspend/resume for cpufreq driver"

This reverts commit 1b22a824dfdc5e03e414f7811d1448e34e6b8ca3.
Revert "msm: cpufreq: Remove cross-calling limitation"

This reverts commit 2bd0ced294898f20d9ae6b60cdf15fe633c5b3ef.
board: mako: tune thermal control to be a little bit more aggressive, this should help decreasing the device temperature on heavy loads.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "msm: cpufreq: increase priority of thread that increases frequencies"

This reverts commit 58018e64d246c7179f2727f81866b2277d67d535.
auto_hotplug.c: after boostpulse is done instead of waiting 5 seconds to offline the core, now it offlines after 2 seconds. Average 15 sample times instead of 12. A little change on when to disable a core when the boostpulse flag is not on because since we now average more times now when the avg_running is less than the disable_load and online_cpus > 1 we offline a core.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>