msm: kgsl: Fix policy sysfs implementation

When switching to another governor, the pwrscale kobject will be deleted
and sysfs_create_group fails due to the uninitialized kobj. This patch
deletes the kobject before attaching the file group.

[   36.270044] [<c0134304>] (__kmalloc_track_caller+0x80/0x194) from [<c010a6d0>] (kstrdup+0x2c/0x54)
[   36.270166] [<c010a6d0>] (kstrdup+0x2c/0x54) from [<c019cc98>] (create_dir+0x24/0x204)
[   36.270257] [<c019cc98>] (create_dir+0x24/0x204) from [<c019d154>] (sysfs_create_subdir+0x24/0x2c)
[   36.270318] [<c019d154>] (sysfs_create_subdir+0x24/0x2c) from [<c019e878>] (sysfs_create_group+0x40/0x1d8)
[   36.270441] [<c019e878>] (sysfs_create_group+0x40/0x1d8) from [<c0389e40>] (kgsl_pwrscale_policy_add_files+0x44/0x68)
[   36.270563] [<c0389e40>] (kgsl_pwrscale_policy_add_files+0x44/0x68) from [<c038e714>] (conservative_init+0xc/0x18)
[   36.270654] [<c038e714>] (conservative_init+0xc/0x18) from [<c0389c6c>] (pwrscale_policy_store+0xcc/0x154)
[   36.270776] [<c0389c6c>] (pwrscale_policy_store+0xcc/0x154) from [<c0389a90>] (pwrscale_sysfs_store+0x20/0x2c)
[   36.270868] [<c0389a90>] (pwrscale_sysfs_store+0x20/0x2c) from [<c019b2a4>] (sysfs_write_file+0x168/0x198)
[   36.270990] [<c019b2a4>] (sysfs_write_file+0x168/0x198) from [<c01382c4>] (vfs_write+0x9c/0x170)
[   36.271112] [<c01382c4>] (vfs_write+0x9c/0x170) from [<c0138440>] (sys_write+0x38/0x70)
[   36.271173] [<c0138440>] (sys_write+0x38/0x70) from [<c000f000>] (ret_fast_syscall+0x0/0x30)
[   36.271265] Code: e7925001 e3550000 0a000033 e5942014 (e795a002)
[   36.271661] ---[ end trace ef0d8b9c8acc7bbb ]---
msm: kgsl: Import conservative governor from jb422 branch

Conflicts:
	drivers/gpu/msm/Makefile
	drivers/gpu/msm/kgsl_pwrscale.c
	drivers/gpu/msm/kgsl_pwrscale.h
msm: kgsl: Add touchboost to conservative governor

Greatly helps against infamous micro-stutters.
msm: kgsl: Report GPU frequency correctly in sysfs
cpufreq: Remove rwsem lock from CPUFREQ_GOV_STOP call (again)

We need to unlock the semaphore due to an enabled conservative governor and
those old input hook commits.

We should get rid of the unused input boost functions, for now this is good
enough.

<4>[ 1338.237854] ------------[ cut here ]------------
<4>[ 1338.238067] WARNING: at fs/sysfs/dir.c:508 sysfs_add_one+0x7c/0x9c()
<4>[ 1338.238189] sysfs: cannot create duplicate filename '/devices/system/cpu/c
pufreq/conservative'
<4>[ 1338.238403] [<c010c204>] (unwind_backtrace+0x0/0xe0) from [<c0167a18>] (wa
rn_slowpath_common+0x48/0x60)
<4>[ 1338.238616] [<c0167a18>] (warn_slowpath_common+0x48/0x60) from [<c0167a88>
] (warn_slowpath_fmt+0x2c/0x3c)
<4>[ 1338.238830] [<c0167a88>] (warn_slowpath_fmt+0x2c/0x3c) from [<c026dc38>] (
sysfs_add_one+0x7c/0x9c)
<4>[ 1338.238952] [<c026dc38>] (sysfs_add_one+0x7c/0x9c) from [<c026de34>] (crea
te_dir+0x58/0xb0)
<4>[ 1338.239166] [<c026de34>] (create_dir+0x58/0xb0) from [<c026e0e0>] (sysfs_c
reate_subdir+0x18/0x1c)
<4>[ 1338.241058] [<c026e0e0>] (sysfs_create_subdir+0x18/0x1c) from [<c026f530>]
 (internal_create_group+0x84/0x1e0)
<4>[ 1338.241180] [<c026f530>] (internal_create_group+0x84/0x1e0) from [<c059ee5
4>] (cpufreq_governor_dbs+0x22c/0x3f8)
<4>[ 1338.241302] [<c059ee54>] (cpufreq_governor_dbs+0x22c/0x3f8) from [<c059a06
c>] (__cpufreq_governor+0x50/0x5c)
<4>[ 1338.241394] [<c059a06c>] (__cpufreq_governor+0x50/0x5c) from [<c059a198>]
(__cpufreq_set_policy+0x120/0x168)
<4>[ 1338.241516] [<c059a198>] (__cpufreq_set_policy+0x120/0x168) from [<c059a85
0>] (cpufreq_add_dev_interface+0x274/0x2c4)
<4>[ 1338.241577] [<c059a850>] (cpufreq_add_dev_interface+0x274/0x2c4) from [<c0
59ac84>] (cpufreq_add_dev+0x3e4/0x43c)
<4>[ 1338.241699] [<c059ac84>] (cpufreq_add_dev+0x3e4/0x43c) from [<c0907e70>] (
cpufreq_cpu_callback+0x88/0x9c)
<4>[ 1338.241821] [<c0907e70>] (cpufreq_cpu_callback+0x88/0x9c) from [<c0189b34>
] (notifier_call_chain+0x38/0x68)
<4>[ 1338.241943] [<c0189b34>] (notifier_call_chain+0x38/0x68) from [<c0169958>]
 (__cpu_notify+0x28/0x40)
<4>[ 1338.242065] [<c0169958>] (__cpu_notify+0x28/0x40) from [<c0905c30>] (_cpu_
up+0xc8/0x1a8)
<4>[ 1338.242156] [<c0905c30>] (_cpu_up+0xc8/0x1a8) from [<c0905d74>] (cpu_up+0x
64/0x84)
<4>[ 1338.242248] [<c0905d74>] (cpu_up+0x64/0x84) from [<c0903fac>] (decide_hotp
lug_func+0x1e8/0x2ec)
<4>[ 1338.242370] [<c0903fac>] (decide_hotplug_func+0x1e8/0x2ec) from [<c017f108
>] (process_one_work+0x204/0x410)
<4>[ 1338.242462] [<c017f108>] (process_one_work+0x204/0x410) from [<c017f4c8>]
(worker_thread+0x188/0x2a8)
<4>[ 1338.242584] [<c017f4c8>] (worker_thread+0x188/0x2a8) from [<c0184390>] (kt
hread+0x84/0x94)
<4>[ 1338.242675] [<c0184390>] (kthread+0x84/0x94) from [<c0106d8c>] (kernel_thr
ead_exit+0x0/0x8)
<4>[ 1338.242767] ---[ end trace e6d9e62662a91860 ]---
msm: kgsl: conservative: Update thresholds

The idea is to keep it from dropping to level 3 too early while
scolling.
Added Voltage interface for GPU - Thanks KT
-anarkia1976
msm: kgsl: conservative: Disable touch boost

With the new threshold levels, touch boost is not needed anymore.
conservative is now every bit as smooth as tz's ondemand.
remove mako boosted
intelli_plug: intelligent hotplug cpu driver with eco mode

Signed-off-by: faux123 <reioux@gmail.com>

Conflicts:
	arch/arm/mach-msm/Kconfig
	arch/arm/mach-msm/Makefile
intelli_plug: tweak for faster wakeup from suspend

bump version to 1.1

Signed-off-by: faux123 <reioux@gmail.com>
intelli_plug: increase cores on persistence

also replace hardcoded values with Macros for ease of updating later

Signed-off-by: faux123 <reioux@gmail.com>
intelli_plug: another performance tweak for better UI response

Signed-off-by: faux123 <reioux@gmail.com>
intelli_plug: make it gcc-4.6.x eabi compatible :p

Signed-off-by: faux123 <reioux@gmail.com>
intelli_plug: use rq_stats to help detect artificial or constant loads

benchmarks often create fake / artificial loads at a constant rate.  These
type of loads are not detected corectly by run average algorithms. Use
the run queue stats to help detect these cases and bring up the cores in
correspondence.

bump version to 1.2

Signed-off-by: faux123 <reioux@gmail.com>
intelli_plug: use mp_decision() algorithm for core 3 and 4

This replaces the simplistic check for run queue thresholds with a more
sophisticate algorithm with time awareness

bump version to 1.3

Signed-off-by: faux123 <reioux@gmail.com>
intelli_plug: tweak mp_decsion parameters and remove unused logic

Signed-off-by: faux123 <reioux@gmail.com>
intelli_plug: bump threshold slightly for better response

Signed-off-by: faux123 <reioux@gmail.com>
wip: intelli_plug: change logic for better benchmark performance

Signed-off-by: faux123 <reioux@gmail.com>
intelli_plug: use mp_decision to reduce online persistence count for cores

this should bring down the cores faster when run queue is low
also optimized code a bit using local vars

Signed-off-by: faux123 <reioux@gmail.com>