mint: update cm defconfig

* disable SWIQI (bravia engine)
* enable interactive and conservative governor
* enable ksm
* enable tracers
* disable sony usb extension

Change-Id: Ia66a36a746ce44cdbc34c234564a2df13c8766fa
cpufreq: ondemand: restore CAF 2.6.38 version

squashed commit of:

commit 88a65c7ae04632ffee11f9fc628d7ab017c06b83
Author: David Ng <dave@codeaurora.org>
Date:   Wed Aug 3 14:04:43 2011 -0700

    cpufreq: Fix input handler crash

    When input handler is running on a CPU not in ondemand
    governor, skip making CPU frequency changes.

    CRs-Fixed: 299451
    Change-Id: I9fe1ac3432d7b1613d1e3766e86160e4fe61d6ec
    Signed-off-by: David Ng <dave@codeaurora.org>

commit b600449501cf15928440f87eff86b1f32d14214e
Author: Brian Steuer <bsteuer@codeaurora.org>
Date:   Thu Jun 9 19:07:32 2011 -0700

    cpufreq: Check all online CPUs on input event

    Previously, only the first CPU in an SMP system was bumped to the
    maximum clock when receiving an input event. This worked fine on
    uniprocessor systems or scenarios were other CPUs tended to be
    powered down. In other situations, it is better to bump up the
    clocks of all CPUs that are online. This will not affect the
    situations mentioned above, but it will help others.

    Change-Id: Id51ebefe57ada56cefb8474cdbfebe1230432680
    Signed-off-by: Brian Steuer <bsteuer@codeaurora.org>

commit 96a9aeb02bf5b3fbbef47e44460750eb275e9f1b
Author: Brian Steuer <bsteuer@codeaurora.org>
Date:   Thu Jun 9 17:04:05 2011 -0700

    cpufreq: Use separate workqueue for input handler

    Change-Id: Iabac5c8ada9342c23f40a3fd3598805738bb8a9c
    Signed-off-by: Brian Steuer <bsteuer@codeaurora.org>

commit 1cca8861d8fda4e05f6b0c59c60003345c15454d
Author: Brian Steuer <bsteuer@codeaurora.org>
Date:   Fri Nov 5 01:59:23 2010 -0700

    cpufreq: Make sure input handler always runs on cpu0

    Make sure that only a single input handle is registered for the
    ondemand governor. Force the input handler to run on cpu0 so it
    will not be migrated due to cpu hotplug.

    Change-Id: Ic72c34355c629da01290cf1a5e81d534aaf83d86
    Signed-off-by: Brian Steuer <bsteuer@codeaurora.org>

commit 2a6181bc76c6ce46ca0fa8e547be42acd534cf0e
Author: Tero Kristo <tero.kristo@nokia.com>
Date:   Tue Aug 18 17:40:29 2009 -0700

    Cpufreq: Added input event hook to ramp up cpu frequency

    This will cause switch to maximum opp immediately when user
    interaction occurs, i.e. touchscreen input or keypad activity.

    Change-Id: I0cfe32479ef62a967f359c1bf57f97eefde7e8f7
    Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
    Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
    [bsteuer@quicinc.com: fixed cpu_dbs_info naming, added header]
    Signed-off-by: Brian Steuer <bsteuer@codeaurora.org>
cpufreq: Fix input handler crash

When input handler is running on a CPU not in ondemand
governor, skip making CPU frequency changes.

CRs-Fixed: 299451
Signed-off-by: David Ng <dave@codeaurora.org>
cpufreq : Fix crash input event handler on governor switch

When an input event and CPU1 hotplug occurs at the same
time, a race condition can happen between cpufreq and
cpu hotplug resulting in a kernel panic.
When a hotplug operation is underway on CPU1,
__cpufreq_remove_dev is called. __cpufreq_remove_dev gets
the lock, proceeds to free the policy info of the current
governor and calls the ondemand governor with a STOP event.
If an input event occurs around the same time, it waits
for __cpufreq_remove_dev to release the lock. Meanwhile,
the ondemand governor clears some of its settings, but
fails to clear its local current policy. As soon as the
input event handler acquires the lock, it now uses the
invalid ondemand current policy handle to make frequency
changes. This results in a kernel panic.

Skip making frequency changes if this condition happens.

CRs-fixed: 327622,319348
Signed-off-by: Anitha Anand <anithas@codeaurora.org>
(cherry picked from commit 3dd6509401d44d16231002fbe8674f4e5f29a1a2)

Change-Id: I37a3d97bc74c828669e71af52d8f4012f108e917
Signed-off-by: Swetha Basineni <sbasin@codeaurora.org>
cpufreq: Extend ondemand powersave_bias for negative range

Original ondemand powersave_bias parameter allows value
range from 0 (no powersave) to 1000 (100% reduction in
calculated CPU frequency).  This change extends powersave_bias
into the negative range (-1 to -1000) to allow a corresponding
boost to CPU frequency.  When set at either limit (-1000 or
1000), ondemand timer is cancelled as periodic load
sampling at sampling_rate is not necessary.

(cherry picked from commit 8192a2f59e9771781b7ef14208f802db630b1380)

Change-Id: I8e2d1456bd503e85d116b2a622603accd99e2349
Signed-off-by: David Ng <dave@codeaurora.org>
cpufreq: Add a boostpulse interface to ondemand

For applications that require a one-shot increase in frequency,
the boostpulse interface would help to scale to max for the time
specified in boostime. This helps applications that currently
increases scaling_min_freq and resets later after a fixed duration.
Instead of changing scaling_min_freq applications can directly write
to boostpulse and governer resets during regular timer after the time
expires.

Change-Id: Ie5f490ff06b41364aa76dd468573433495da28a4
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: Add cpu utilization statistics to aid decisions made by userspace.

Understanding system load as seen by cpufreq can help userspace
algorithms make better decisions to improve system responsiveness.
One such example would be the MP decision algorithm which mines
various system info to make decisions on hotplugging in/out
the additional cores.

Signed-off-by: Anitha Anand <anithas@codeaurora.org>
(cherry picked from commit cbeef6aafc4964c4a6cfafd26b23eaccd40804b4)

Change-Id: I8a5fb95380af898076fe0e246fb21e3aa48b33b1
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
cpufreq: fix utilization statistics for sync cpus

If the cpus are using related_cpus policy, then the
current implementaion will overwrite the the calculated
load for every iteration in the for loop. Hence, mpdecision
will read incorrect value, if the cores are using related
cpus policy. With this change mpdecision will read the
sum of the loads of all cpu's, if related cpu policy is
used.

Change-Id: I242c8fe39fd75dc3e48750a5b78a5d218b536ddd
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
cpufreq: notify avg load for short sampling_rate

If the sampling rate is less than 50ms reporting
the actual load may lead to poor decision making
at user space. So, for sampling rates less than 50ms
report the average of load across two samples.

Change-Id: I0d1cf00801732bee8e4380158d7e892758226594
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: boost the sampling rate on touch event

For better Ux responsiveness ondemand sampling rate
needs to be 20ms. But, a 20ms sampling rate increases power
consumption. So, boost the sampling rate to 20ms on every
touch event for 2.5 ms and later reset to default rate.
Also, change sampling down factor proportional to the
sampling rate.

Change-Id: I111b1cf3b8ed133347149afc34d329d0384ecfcb
Signed-off-by: Narayanan Gopalakrishnan <nargop@codeaurora.org>
cpufreq: ondemand: Fix the boostpulse interface

  * Boostpulse was not working because no default frequency was set.
  * We don't need an input handler to push the freq to max, userspace
    does a better job with the Power HAL.
  * Tweak boost time to 500ms

Change-Id: Ice8c26b758747d265976263296a2da3380b864f7
msm: cpufreq: Fix store_powersave_bias to account for sync' CPUs.

Current code assumes that all online CPUs runs their own timers to
collect CPU samples for demand based switching (dbs). But in case of
synchronous CPUs, ondemand governor registers only one timer at init
time because both CPUs are accounted in the same timer call. Hence
trying to restart/cancel dbs timers for all online CPUs is not legal
for these CPUs. This change fixes above function to restart/cancel
timers only once for group of synchronous CPUs.

Change-Id: I23f1697783a65f125679a07a076620e8fa5e62d5
Signed-off-by: Krishna Vanka <kvanka@codeaurora.org>
cpufreq: Fix panic when setting sampling rate

Kernel panics when trying to set the sampling rate before the ondemand
governor CPUFREQ_GOV_START notification is received.

[<c078e500>] panic+0x15c
[<c0012354>] die+0x19c
[<c0018e60>] __do_kernel_fault+0x64
[<c0793660>] do_page_fault+0x3b8
[<c0008514>] do_DataAbort+0x134
[<c0791c58>] __dabt_svc+0x38
[<c02b5c68>] __list_add+0x38
[<c078f1b0>] __mutex_lock_slowpath+0x128
[<c078fc68>] mutex_lock+0x20
[<c05409c4>] store_sampling_rate+0x98
[<c02a6648>] kobj_attr_store+0x18
[<c0183124>] sysfs_write_file+0x108
[<c0131758>] vfs_write+0xac
[<c013188c>] sys_write+0x3c
[<c000e340>] ret_fast_syscall+0x0

Initialize the mutex as part of cpufreq_gov_dbs_init().

Change-Id: Ie9014407d724d7a0a81c076be47df5d08f513407
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
cpufreq: ondemand: Add duration for boosting

 * Keep default behavior of 500ms boost if "1" is given, otherwise use
   the value (microseconds) as the boost duration.

Change-Id: Id38adef1aece7b5609689e50d33cb11b74a352c5
drivers: cpufreq: Add max duration for boosting

 * Don't allow boosting for more than 5 seconds.

Change-Id: Ib602c398ab117ee06c9fa113b1dc9042f1255a8f
msm: cpufreq: Fix the race between dbs_refresh and hotplug.

The demand based switching responds to input events and schedules
work items on all online cpus to increase the frequency. This will
call the dbs_refresh_callback on respective cpu. If this work item
kicks in while cpu1 is progressing its way through cpufreq_add_dev,
there is a chance that work item grabs the cpu_policy_rwsem of cpu1
and relases that of cpu0, when add device is working through releas-
ing lock of cpu1 and reaquiring that of cpu0. This is locking out
cpu1 when it tries to come up online next time. The fix is hold the
hot plug lock while processing refresh work items.

CRs-Fixed: 362444
Change-Id: I57db7c7a9b58369bf059302896f3bf9eca2bc2bb
Signed-off-by: Krishna Vanka <kvanka@codeaurora.org>
cpufreq: Make the "scaling_governor" sysfs node pollable

A userspace module programs different qos-rules depending on the
governor running in the system. Make the governor node
pollable, so that the userspace module can be triggered when
the value of the governor changes.

change-Id: Ic89c77c7d16b0f8954d59a211612e9a8e98a2c28
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
drivers: cpufreq: Send a uevent when governor changes

 * Useful so userspace tools can reconfigure.

Change-Id: Ib423910b8b9ac791ebe81a75bf399f58272f64f2