msm: mpdecision: Add in-kernel CPU hotplug management

mach-msm: Add msm_mpdecision Kconfig & Makefile hooks

Change-Id: I1bb994370cf5568c01b1e99d74475f5d1ec52fe4
Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: Add msm_mpdecision

This currently only does the following thing:
Screen on -> CPU1 online
Screen off -> CPU1 offline

More to come.

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: small cleanup

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: add load based decision making

This now works like the mpdecision binary from QCOM.
CPU hotplugging/unplugging based on system load.

A sysfs interface will be built in with a later commit.

Change-Id: I6b8307a8e9f7425d99a84eb25798e8498cb9ba5a
Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: restructure locks, add delay

The new delay allows the CPU to come up before any other action is taken.
This prevents fast plugging and also ensures the CPU hotplug process
is really done, before trying to unplug it again (or plug it).

The new locks are more efficient, and only used if necessary.

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: pause if CPU is unplugged outside of mpdecision

This fixes cpu wars if something else tries to control the cpus.
default delay: 10000ms

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: change early_suspend_level to blank_screen

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: don't start immediately

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: show cpumask after up/down

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: always set the suspend var

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: remove up/down delay, our default delay is large enough

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: remove debug output

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: add email to (c)

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: fix foreign hotplug/unplug detection

Signed-off-by: showp1984 <showp1984@gmail.com>

Conflicts:

	arch/arm/mach-msm/msm_mpdecision.c

mach-msm: mpdecision: show how long the cpu was online

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: rename msm_mpdec_suspend to msm_mpdec_cpudata

Since this is being used for more than suspend stuff the old name
just isn't accurate anymore.

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: add sysfs interface

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: increase startdelay for sense

Surprise! Sense needs a lot longer to boot up than aosp...

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: adjust thresholds for sense

Sense is just too hungry...

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: fix foreign cpu control detection

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: allow mpdecision to be disabled (sysfs)

This allows disabling/enabling of mpdecision over sysfs.

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: increase start delay for Sense

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: increase up threshold for Sense

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: sysfs: check if cpu is offline before hotplugging it

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: don't turn off cpu1 if freq > idle

This fixes cpu1 being turned off though it is still working
with a high frequency. The idle_freq can be modified through sysfs.

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: fixup: move idle block to mpdecision()

This belongs in mp_decision() because this influences the decision
mpdecision is about to make.

Signed-off-by: showp1984 <showp1984@gmail.com>

mach-msm: mpdecision: don't turn on cpu1 if cpu0 freq is below idle_freq
If the clock of cpu0 is below the set idle_freq don't enable cpu1 and
disregard the runqueue value.

Signed-off-by: showp1984 <showp1984@gmail.com>

msm: mpdecision: 8960 compat

Change-Id: I49541f2a644d61e567e9997a742f54154e703674

msm: mpdecision: Use the standard get_rate api

Change-Id: I738cfe2165899001a0fca37c1dd2a5746c6ba53b

Conflicts:

	arch/arm/mach-msm/msm_rq_stats.c
Add UKSM 0.1.2
UKSM: Upgrade to 0.1.2.2
IO Boost
	modified:   mm/page-writeback.c
Increased Audio Buffers
Disabled Fair Sleeper
Added jRCU
	modified:   arch/x86/include/asm/thread_info.h
	modified:   include/linux/hardirq.h
	new file:   include/linux/jrcu.h
	modified:   include/linux/kernel.h
	modified:   include/linux/preempt.h
	modified:   include/linux/rcupdate.h
	modified:   include/linux/sched.h
	modified:   init/Kconfig
	modified:   kernel/Makefile
	new file:   kernel/jrcu.c
	modified:   kernel/sched.c

Conflicts:
	Makefile
Updated to 3.0.75 & Ported Patches from old codebase
	modified:   Makefile
	modified:   arch/alpha/kernel/sys_nautilus.c
	modified:   arch/arm/mm/cache-feroceon-l2.c
	modified:   arch/powerpc/platforms/pseries/lpar.c
	modified:   arch/x86/Kconfig
	modified:   arch/x86/include/asm/kvm_host.h
	modified:   arch/x86/include/asm/paravirt.h
	modified:   arch/x86/include/asm/paravirt_types.h
	modified:   arch/x86/kernel/paravirt.c
	modified:   arch/x86/kvm/x86.c
	modified:   arch/x86/lguest/boot.c
	modified:   arch/x86/mm/fault.c
	modified:   arch/x86/mm/numa.c
	modified:   arch/x86/mm/numa_32.c
	modified:   arch/x86/mm/numa_internal.h
	modified:   arch/x86/xen/mmu.c
	modified:   block/blk-sysfs.c
	modified:   crypto/algif_hash.c
	modified:   crypto/algif_skcipher.c
	modified:   crypto/gcm.c
	modified:   drivers/ata/libata-core.c
	modified:   drivers/char/hpet.c
	modified:   drivers/gpu/vga/vga_switcheroo.c
	modified:   drivers/mtd/mtdchar.c
	modified:   drivers/net/can/sja1000/sja1000_of_platform.c
	modified:   drivers/net/r8169.c
	modified:   drivers/net/wireless/ath/ath9k/htc_drv_init.c
	modified:   drivers/net/wireless/mwifiex/init.c
	modified:   drivers/net/wireless/rt2x00/rt2x00pci.c
	modified:   drivers/target/target_core_alua.c
	modified:   drivers/thermal/thermal_sys.c
	modified:   drivers/video/console/fbcon.c
	modified:   drivers/video/fbmem.c
	modified:   fs/btrfs/tree-log.c
	modified:   fs/hfsplus/extents.c
	modified:   fs/reiserfs/xattr.c
	modified:   fs/sysfs/dir.c
	modified:   fs/ubifs/super.c
	modified:   include/linux/ata.h
	modified:   include/linux/kvm_host.h
	modified:   include/linux/kvm_types.h
	modified:   include/linux/libata.h
	modified:   include/linux/mm.h
	modified:   include/linux/preempt.h
	modified:   include/linux/spinlock_up.h
	modified:   kernel/events/core.c
	modified:   kernel/hrtimer.c
	modified:   kernel/sched.c
	modified:   kernel/sched_clock.c
	modified:   kernel/signal.c
	modified:   kernel/sys.c
	modified:   kernel/trace/ftrace.c
	modified:   mm/hugetlb.c
	modified:   mm/memory.c
	modified:   mm/mmap.c
	modified:   mm/nommu.c
	modified:   net/8021q/vlan.c
	modified:   sound/core/pcm_native.c
	modified:   sound/pci/hda/hda_codec.c
	modified:   sound/pci/hda/hda_eld.c
	modified:   sound/soc/codecs/wm8903.c
	modified:   sound/soc/sh/dma-sh7760.c
	modified:   sound/usb/mixer_quirks.c
	modified:   sound/usb/quirks.c
	modified:   virt/kvm/ioapic.c
	modified:   virt/kvm/kvm_main.c

 Untracked files:
   (use "git add <file>..." to include in what will be committed)