probably from a bad merge
Revert "msm: Add msm_hotplug driver"

This reverts commit 03305e4d775b667bff5973c1be856cfe01409586.
msm: hotplug: Add MSM Hotplug driver

msm: hotplug: Add basic hotplug driver file template
msm: hotplug: Get CPU load statistics
msm: hotplug: Print messages only with debug flag set
msm: hotplug: Stop the hotplug workqueue during suspend
msm: hotplug: Limit CPU freq to 702MHz dring suspend
msm: hotplug: Add spin lock to load stats function
msm: hotplug: Add simple hotplug logic
msm: hotplug: Add touchboost to hotplug function
msm: hotplug: Increase hotplug update rate
msm: hotplug: Add minimum uptime after hotplug
msm: hotplug: Handle cpu on- and offlining
msm: hotplug: Set down lock atomically
msm: hotplug: Add sysfs
msm: hotplug: Set target number of cpus based on current load
msm: hotplug: Offline/online cpus upon early suspend/late resume
msm: hotplug: Make history size adjustable from userspace
msm: hotplug: Fix typo to satisfy compiler
msm: hotplug: Add options for number of min/max/boost cpus
msm: hotplug: Add MSM Hotplug driver
msm: hotplug: Max 1036MHz during screen off
msm: hotplug: Remove spinlock in load stats
It's too expensive and not nessecary.
msm: hotplug: Stop hotplug work a tad later
msm: hotplug: Protect suspend operations by mutex
Revert "msm: hotplug: Protect suspend operations by mutex"
This reverts commit 7a879c677475f302ef8b1581d363b0fe676f9a11.
msm: hotplug: Schedule suspend/resume work
Dennis is right, this is the proper way to suspend and resume.
hammerhead: touch: Remove touch boost
Revert "cpufreq: conservative: Boost all online cpus"
This reverts commit 3d2675da0500e4e9cd94de66f657790ca5e26467.
Revert "hammerhead: touch: Simple method of boosting cpu frequency on touch"
This reverts commit 2f25573cc2924e62d222f4fbd7a976121858dce2.
msm: hotplug: Increase down lock duration and sanitize
msm: hotplug: Use high-priority workqueue
msm: hotplug: Add input boost handler
Add an input handler to hotplug additional cpus. Down lock will
take care of keeping the cpu boosted.
msm: hotplug: Add minimum interval for input boost
msm: hotplug: Remove deprecated msm_cpufreq_set_freq_limits

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Cleanup hotplugging routines

Remove paroid atomic operations that were causing issues.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
cpufreq: Optimize cpufreq_frequency_table_verify()

cpufreq_frequency_table_verify() is rewritten here to make it more logical
and efficient.
 - merge multiple lines for variable declarations together.
 - quit early if any frequency between min/max is found.
 - don't call cpufreq_verify_within_limits() in case any valid freq is
   found as it is of no use.
 - rename the count variable as found and change its type to boolean.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
cpufreq: add new routine cpufreq_verify_within_cpu_limits()

Most of the users of cpufreq_verify_within_limits() calls it for
limiting with min/max from policy->cpuinfo. We can make that code
simple by introducing another routine which will do this for them
automatically.

This patch adds another routine cpufreq_verify_within_cpu_limits()
and updates others to use it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Optimize hotplugging routines

- Power down the slowest cpu
- Move checks from callback to calling function
- Clean it up a bit

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: fix a symbol derp

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Remove most suspend operations

Thanks to changes in the sound subsystem, cpu usage while listening to
audio streams in now greatly reduced (if supported by the audio HAL).

Before, the cpu was under severe load about half of the time. Now we're
idling along at minimum frequency. There is no need for most suspend
operations any more. We are now just shortly onlining all cpus to speed
up display resume operations.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm_hotplug: remove lcd_notify events

Should make hotplugging less agressive at screen on/off
events.

Thanks to myfluxi and neobudy89.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Fixup sysfs interface

* Use proper return values
* Fix store_down_lock_duration()
* Add some more checks
* Cleanup some mess

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Update threshold values and down lock duration

* Power up additional cpus earlier
* Power down cpus later
* Keep cpus online at least 5 seconds

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm8974: Adapt memutils optimizations from msm8960pro

Preload farther to take advantage of the memory bus, and assume
64-byte cache lines.  Unroll some pairs of ldm/stm as well, for
unexplainable reasons.

Future enhancements should include,

- #define for how far to preload, possibly defined separately for
  memcpy, copy_*_user
- Tuning for misaligned buffers
- Tuning for memmove
- Tuning for small buffers
- Understanding mechanism behind ldm/stm unroll causing some gains
  in copy_to_user

BASELINE (msm8960pro):
======================================================================
memcpy 1000MB at 5MB       : took 808850 usec, bandwidth 1236.236 MB/s
copy_to_user 1000MB at 5MB : took 810071 usec, bandwidth 1234.234 MB/s
copy_from_user 1000MB at 5M: took 942926 usec, bandwidth 1060.060 MB/s
memmove 1000GB at 5MB      : took 848588 usec, bandwidth 1178.178 MB/s
copy_to_user 1000GB at 4kB : took 847916 usec, bandwidth 1179.179 MB/s
copy_from_user 1000GB at 4k: took 935113 usec, bandwidth 1069.069 MB/s
copy_page 1000GB at 4kB    : took 779459 usec, bandwidth 1282.282 MB/s

THIS PATCH:
======================================================================
memcpy 1000MB at 5MB       : took 346223 usec, bandwidth 2888.888 MB/s
copy_to_user 1000MB at 5MB : took 348084 usec, bandwidth 2872.872 MB/s
copy_from_user 1000MB at 5M: took 348176 usec, bandwidth 2872.872 MB/s
memmove 1000GB at 5MB      : took 348267 usec, bandwidth 2871.871 MB/s
copy_to_user 1000GB at 4kB : took 377018 usec, bandwidth 2652.652 MB/s
copy_from_user 1000GB at 4k: took 371829 usec, bandwidth 2689.689 MB/s
copy_page 1000GB at 4kB    : took 383763 usec, bandwidth 2605.605 MB/s

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Dan Trifan <jimsth@gmail.com>

Conflicts:
	arch/arm/mach-msm/Kconfig
	arch/arm/mach-msm/Makefile
msm: hotplug: Revert to original thresholds

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Consider load instead of frequency for slowest cpu

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Protect load stats routine and cleanup

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Fix licensing issue

I have no idea about licensing and I could care less
but this should be correct.

Signed-off-by: Dan Trifan <jimsth@gmail.com>
msm: hotplug: Cleanup probe function

After performing nicely for over a half year this
actually starts looking almost decent...

Signed-off-by: Dan Trifan <jimsth@gmail.com>
Revert "msm_hotplug: remove lcd_notify events"

This reverts commit c0e6ba1850e6b109cab50726431d2290b3772876.

Signed-off-by: Dan Trifan <jimsth@gmail.com>

Conflicts:
	arch/arm/configs/cyanogenmod_vs980_defconfig
msm: hotplug: Add enable/disable toggle

This is mainly for debugging purposes, i.e. using mpdecision.

Signed-off-by: Dan Trifan <jimsth@gmail.com>