ARM: tegra: power: Cancel hotplug work upon disable

Cancel hotplug work when auto hotplug gets disabled to prevent
e.g. cpu_up() getting called in LP cluster.

Bug 965777
ARM: tegra: power: Use runnable threads average for hotplug

Sample scheduler runnable threads average in auto-hotplug work
function and use it to determine the auto-hotplug target for number
of on-line cores. Use cpu up delay as sampling period, and enforce
down delay by checking last cpu configuration change time stamp.

Bug 958978

Note: this commit had two lines that were already merged in the Google
source, now the entire patch should be complete.
cpu-tegra2: Tuned the runnable threads threshold from 5/9/13 to 5/9/10
in order to improve performance
scheduler changes from Nvidia

scheduler: compute time-average nr_running per run-queue
Compute the time-average number of running tasks per run-queue for a
trailing window of a fixed time period. The detla add/sub to the
average value is weighted by the amount of time per nr_running value
relative to the total measurement period.

scheduler: Re-compute time-average nr_running on read
Re-compute time-average nr_running when it is read. This would
prevent reading stalled average value if there were no run-queue
changes for a long time. New average value is returned to the reader,
but not stored to avoid concurrent writes. Light-weight sequential
counter synchronization is used to assure data consistency for
re-computing average.
cpu-tegra: Let's set the stock frequency at boot-time since the
anykernel method disallows it from always being set in the ramdisk.
ARM: fix rcu stalls on SMP platforms

We can stall RCU processing on SMP platforms if a CPU sits in its idle
loop for a long time.  This happens because we don't call irq_enter()
and irq_exit() around generic_smp_call_function_interrupt() and
friends.  Add the necessary calls, and remove the one from within
ipi_timer(), so that they're all in a common place.

Note: this patch was already partially in place
ARM: SMP: wait for CPU to be marked active

When we bring a CPU online, we should wait for it to become active
before entering the idle thread, so we know that the scheduler and
thread migration is going to work.
Revert "ARM: SMP: wait for CPU to be marked active"

This reverts commit 30057f972d5c97fe3f4c24899c139a0b47ee5786.
Revert "ARM: fix rcu stalls on SMP platforms"

This reverts commit 0dc67836c228665f1384342e90cec1655263c1b1.
Revert "scheduler changes from Nvidia"

This reverts commit 81b9284f801bcc8ebd321fc1c92bedd6deeea51b.
Revert "cpu-tegra2: Tuned the runnable threads threshold from 5/9/13 to 5/9/10 in order to improve performance"

This reverts commit 3727a7b3e97dd0573ac93a76d1f025c37cf9765a.
Revert "ARM: tegra: power: Use runnable threads average for hotplug"

This reverts commit 2cdbd719c0c1eae5399e392ad8ae7f3c883b7331.
Revert "Changed highest frequency from 1.624 to 1.7GHz"

This reverts commit 7ff8985adb62c0fc355f87626372101aa70e227f.
v1.0.12 changes

Changed highest frequency back to 1.624GHz and core voltage back to
1200mV. 

Refresh rate now adjusted with GPU OC clock at compile time. Higher FPS
should be realized at 484 and 520 for most (thanks to clemsyn for
sharing his research and findings)

Adjustments to the tegra 3 algorirthim for bring cpus online and
offline, especially for the OC frequencies.

Fixed GPU clock compile time switch. Removed 500MHz choice.

Moved the frequency policy to 1.3GHz on startup to cpu 0 only.

Minor adjustment to the interactive governor to make it slightly more
responsive when demand increases.