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>

Conflicts:
	arch/arm/kernel/auto_hotplug.c
auto_hotplug.c: these are variables that are only read from, so optimise it.

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

Conflicts:
	arch/arm/kernel/auto_hotplug.c
Revert "arm: Move to upstream udelay via timer implementation"

This reverts commit ad864a59cbfdb3a6b3efced1cc4c32be819b0961.
auto_hotplug.c: we're now scaling the cores based on the NVIDIA's avg_running code so now the driver will be less hard on the system because we got rid of the history cycle and multiplication before deciding when to online/offline cores.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: remove dynamic sampling time based on online cores and schedule the works in a 100ms sampling rate. Also cleanup how check for boostpulse flag to reduce reduntant function calls. Also reduced enable_all_threshold from 500 to 425 otherwise it would be really hard to have them all enabled at a certain point of time. Maybe it easier to stay on all cores if the load is above the threshold - there was a small bug here that almost prevented all the cores to stay up until the load gets down.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: ditch NVIDIA's load averaging usage on this driver - according to @thalamus its not cheaper than his original implementation.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: since we're sampling for longer periods and in 100ms rates this can be a little lower if one needs the performance.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Revert "auto_hotplug.c: this device boots up faster than any other so we can start the hotplug works sooner - sometimes the previous 20 seconds timer started exactly when I started to swipe the App Drawer after the device was booted and that would create a 1 time lag and that was annoying every time I rebooted. Should be ok now."

This reverts commit 5dea4777e62df79833e33de2cd7a3507635b714e.
auto_hotplug.c: since the sampling rate was adjusted a few patches ago I never got to update the timers in the delayed works to be according the new rate and the more sampling periods. Should be more snappy now when the device needs the extra processing power, without sacrificing battery. Also added contact info in the top of the file and more info regarding OMAP4460.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: reduce sampling periods from 20 to 15.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: on device resume we feed some fake numbers to the circle buffer to make it more responsive to load changes instead of waiting several sampling rates for a proper response. Thanks @motley for the idea.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: sample less.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
auto_hotplug.c: remove hotplugging on screen on for testing purposes.

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

Conflicts:
	arch/arm/kernel/auto_hotplug.c
auto_hotplug.c: now we're testing 2 cores always online instead of 4 cores.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
smp: patches from mainline 3.5 to hopefully help with hotplug
efficiency

Thomas Gleixner's generic-idle patches:

smp: Add task_struct argument to __cpu_up()
Preparatory patch to make the idle thread allocation for secondary
cpus generic.
http://git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=commit;h=8239c25f47d2b318156993b15f33900a86ea5e17

smp: Add generic smpboot facility
Start a new file, which will hold SMP and CPU hotplug related generic
infrastructure.
http://git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=commit;h=38498a67aa2cf8c80754b8d304bfacc10bc582b5

smp: Provide generic idle thread allocation
All SMP architectures have magic to fork the idle task and to store it
for reusage when cpu hotplug is enabled. Provide a generic
infrastructure for it.
Create/reinit the idle thread for the cpu which is brought up in the
generic code and hand the thread pointer to the architecture code via
__cpu_up().
Note, that fork_idle() is called via a workqueue, because this
guarantees that the idle thread does not get a reference to a user
space VM. This can happen when the boot process did not bring up all
possible cpus and a later cpu_up() is initiated via the sysfs
interface. In that case fork_idle() would be called in the context of
the user space task and take a reference on the user space VM.
http://git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=commit;h=29d5e0476e1c4a513859e7858845ad172f560389

arm: Use generic idle thread allocation
http://git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=commit;h=84ec6d5796e095e2f8698bd2b5d33849ed26d9e2

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

Conflicts:
	arch/arm/Kconfig

Conflicts:

	arch/arm/Kconfig