mako_hotplug: online cpu1 on screen on to remove the lag, also merge the cpu max freq cap from the video driver to this driver. A bunch of other small fixes as well.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
hrtimer: Prevent hrtimer_enqueue_reprogram race

hrtimer_enqueue_reprogram contains a race which could result in
timer.base switch during unlock/lock sequence.

hrtimer_enqueue_reprogram is releasing the lock protecting the timer
base for calling raise_softirq_irqsoff() due to a lock ordering issue
versus rq->lock.

If during that time another CPU calls __hrtimer_start_range_ns() on
the same hrtimer, the timer base might switch, before the current CPU
can lock base->lock again and therefor the unlock_timer_base() call
will unlock the wrong lock.

[ tglx: Added comment and massaged changelog ]

Change-Id: I327d862c28f24b77a62861764393c4bf660a7318
Signed-off-by: Leonid Shatz <leonid.shatz@ravellosystems.com>
Signed-off-by: Izik Eidus <izik.eidus@ravellosystems.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1359981217-389-1-git-send-email-izik.eidus@ravellosystems.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Git-commit: b22affe0aef429d657bc6505aacb1c569340ddd2
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: use alloc_workqueue instead of create_*_workqueue because the latter is deprecated. Also online all cores on screen on for 1 sampling_rate for smoother screen on transitions.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Merge https://www.codeaurora.org/gitweb/quic/la/?p=kernel/msm.git;a=commit;h=0a405a144cf8e4ded7af9a4d25cffbc1db294244

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
cpufreq: interactive: boost cpufreq to 1GHz on input, instead of 702MHz.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: export settings to userspace. Also increase threshold for onlining all four cores to reduce heat at bordeline usages.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
rq_stats: remove the sysfs entries, they are not needed now.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
ARM: Allow arm_memblock_steal() to remove memory from any RAM region

Allow arm_memblock_steal() to remove memory from any RAM region,
including highmem areas.  This allows memory to be stolen from the
very top of declared memory, including highmem areas, rather than
our precious lowmem.

Change-Id: Ib4dbc4e7bc34d402134d96db5ed8118eaffa0245
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Git-commit: 7ac68a4c1de6aac5b0bb231fe6d8505ebe5686d9
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
block: blk-merge: don't merge the pages with non-contiguous descriptors

blk_rq_map_sg() function merges the physically contiguous pages to use same
scatter-gather node without checking if their page descriptors are
contiguous or not.

Now when dma_map_sg() is called on the scatter gather list, it would
take the base page pointer from each node (one by one) and iterates
through all of the pages in same sg node by keep incrementing the base
page pointer with the assumption that physically contiguous pages will
have their page descriptor address contiguous which may not be true
if SPARSEMEM config is enabled. So here we may end referring to invalid
page descriptor.

Following table shows the example of physically contiguous pages but
their page descriptor addresses non-contiguous.
-------------------------------------------
| Page Descriptor    |   Physical Address |
------------------------------------------
| 0xc1e43fdc         |   0xdffff000       |
| 0xc2052000         |   0xe0000000       |
-------------------------------------------

With this patch, relevant blk-merge functions will also check if the
physically contiguous pages are having page descriptors address contiguous
or not? If not then, these pages are separated to be in different
scatter-gather nodes.

CRs-Fixed: 392141
Change-Id: I3601565e5569a69f06fb3af99061c4d4c23af241
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: add some flags to the WQ.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Update .gitignore.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Revert "cpufreq: restrict the max and min freq permissions from the source so that MPDecision don't mess with them when the cores go off/on (which resets the permissions I set in the ramdisk)."

This reverts commit f4ffcdbe027583d5584eb833ad4023011d57a361.
mako_hotplug: reformat most of the code to be accoring upstream Kernel pedantic conventions.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
thermal: fix extreme throttle step.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Disable module compiling.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
Make sure this is not compiled as we don't need it.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: change load thresholds.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: fix a bug that was not updating online_cpus accordingly that then uncovered another bugs which led me to add a simple 10 position array for averaging the last 10 loads of the previous 10 samples which allows the driver to stay on quad-core during periods of continous high load. Also removed the sec_threshold temp_diff check for medium load if there is only 1 cpu online thus increasing interactivity between menus and UI interactions. Then after that initial onlining if the load keeps being medium it takes not 2 seconds but 4 seconds interval between onlining the remaining cpus.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
mako_hotplug: sync the threshold with the driver.

Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
hrtimer: Consider preemption when migrating hrtimer cpu_bases

When switching to a new cpu_base in switch_hrtimer_base(), we
briefly enable preemption by unlocking the cpu_base lock in two
places. During this interval it's possible for the running thread
to be swapped to a different CPU.

Consider the following example:

CPU #0                                 CPU #1
----                                   ----
hrtimer_start()                        ...
 lock_hrtimer_base()
 switch_hrtimer_base()
  this_cpu = 0;
  target_cpu_base = 0;
  raw_spin_unlock(&cpu_base->lock)
<migrate to CPU 1>
...                                    this_cpu == 0
                                       cpu == this_cpu
                                       timer->base = CPU #0
                                       timer->base != LOCAL_CPU

Since the cached this_cpu is no longer accurate, we'll skip the
hrtimer_check_target() check. Once we eventually go to program
the hardware, we'll decide not to do so since it knows the real
CPU that we're running on is not the same as the chosen base. As
a consequence, we may end up missing the hrtimer's deadline.

Fix this by updating the local CPU number each time we retake a
cpu_base lock in switch_hrtimer_base().

Another possibility is to disable preemption across the whole of
switch_hrtimer_base.  This looks suboptimal since preemption
would be disabled while waiting for lock(s).

Change-Id: I3f76d528ab2288ef5f950f4d048e7f3fa6cf1228
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>