msm: kgsl: Add cache flush for A20x

Adding extra cache flush command to make sure that CP block
gets event from RB all the time to avoid race conditions because of
clock switches. this is to improve stability on 8x25 target.

Change-Id: Ic7b56223eb0849e3ea955af3e08132431fc5318a
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
lib: genalloc: Change chunk allocation to vmalloc

Change the chunk allocation from kmalloc to vmalloc for
allocations greater than a page. This allows large
chunks to be allocated from physically non-contiguous
memory and increases the chance of the allocation
succeeding.

(cherry picked from commit 0614b96dc8e4c8a0dd0db41aec5a79daa3bdf091)

Conflicts:

	lib/genalloc.c

(cherry picked from commit 64cf7183f37df623bec8f46348b11c5781d3b0cc)

Change-Id: Ied97c888b967c4433519cb47e972f7a0f2281d71
CRs-fixed: 387655
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Revert "power: pm8921-charger: Add power supply property"

This reverts commit 753ddad790b8c2c5536c71ffb9794ed8130712a8.

Change-Id: Ib34598c3c932d264a622f5bff411f722c7354767
Signed-off-by: Srivalli Oguri <oguri@codeaurora.org>
Add Lazy Governor. Cherry-picked from
commit 01a7af318e1e511336e91b0aabbebcec2ada506f
Add CPUfreq 'wheatley' governor. Cherry-picked from commit b306df78e5ff5953c58cf1f3df9994aece8dbf4e.
Add BFQv5

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactiver governor: Add a time view concept

CPUFreq governors are always a tradeoff between power vs performance.
For low power UCs we want to have a less reponsive cpufreq governor that
does not respond or react to each load pick.
However when scrolling on the screen or during webbrowsing we need a more
responsive governor that interact or esponse to each load variation.

To detect which kind of application we have, we'll rely on the history of
the load. if the the average over the load history is high that means we
need to be more responsive so we change the governor paramters in that
direction.
if the average over the load history is low thatmeans we are in low power
UCs so we change the governor parameter to be less responsive

Change-Id: Ifd55ac4cfbc1bd9eded4ae603b158054c6169e8c
Signed-off-by: Nicole Chalhoub <n-chalhoub@ti.com>
Signed-off-by: Taras Kondratiuk <taras@ti.com>
(cherry picked from commit c9d2e290d40f629306ba4cd020be1d71ed5e1d23)

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive governor: Fix not uniform buf filling & memory corruption

Each CPU has it's own load history buffer, but all they use shared
<history_load_index> variable, this lead to not uniform filling
of the cpu's circular buffers. Only about half of buffer is updated
during each buffer rewriting cycle that obligate governor to use
outdated data during freq tuning.

Moreover access to <history_load_index> variable is not atomic, that
create race conditions. Simultaneous increment could cause situation
where such check:

        if (++history_load_index == sampling_periods)
                history_load_index = 0;

not safe and buffer overflow will not be prevented. That will lead
to memory corruption.

To avoid such problems this patch move buffer-index variable to
<cpufreq_interactive_cpuinfo> structure, which is separate for each CPU.
Also, buffer overflow checking will be paranoidly changed.

Change-Id: I333a4462be17816372a7a57529811d87930058c0
Signed-off-by: Leonid Iziumtsev <x0153368@ti.com>
(cherry picked from commit befb3fe3e38d88bc1872d99748c246c26406315d)

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: take idle notifications only when active - https://github.com/android/kernel_common/commit/22a51ab6e21de740c1b555f9a03626d28aaebdf3

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: keep freezer happy when not current governor - https://github.com/android/kernel_common/commit/5ff8407798f1d8c44f3165bc535676a2a897666b

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: handle speed up and down in the realtime task - https://github.com/android/kernel_common/commit/f8aa05d96a0d18416d2627c493f7dc9bc5324901

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: remove input_boost handling - https://github.com/android/kernel_common/commit/4e27eb56e819745a1b184f278d7f3dd3887a456c

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: fix compiling errors from the latest commits

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: separate Interactive governor into two, one with static settings and another one with dynamic settings (it adjusts itself according to load). The new governor is called Dynamic Interactive.

Conflicts:
	drivers/cpufreq/Kconfig
cpufreq: interactive: change frequency up/down kernel thread priority. Now it has more priority than any user thread which should boost interactivity.

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

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Added V(r) and SIO schedulers
sync.c: add a module_param to fsync() calls. fsync is still disabled by default but users will have the choice of having a faster build or a safer build (for data integrity). Props for simms for busting my ass off with this one :)
Add: config CPU_FREQ_GOV_HOTPLUG
Forgot to enable fsync by default, so here it is.

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