Commit Graph

597 Commits

Author SHA1 Message Date
Kevin F. Haggerty 238a0fb5ad Merge tag 'v3.4.113' into lineage-16.0
This is the 3.4.113 stable release

Change-Id: I80791430656359c5447a675cbff4431362d18df0
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2019-08-05 14:20:47 +02:00
Francescodario Cuzzocrea 85baa390bf misc: Import SM-G900H kernel source code
* Samsung Package Version: G800HXXU1CRJ1
    * CAF Tag: LA.BF.1.1.3-00110-8x26.0
2019-08-02 15:14:10 +02:00
Linux Build Service Account 2255977e8a Merge "cpufreq: ondemand: Resolve deadlock when waking up dbs sync thread" 2015-04-17 12:47:59 -07:00
Swetha Chikkaboraiah 80ba84cad2 cpufreq: ondemand: Resolve deadlock when waking up dbs sync thread
Waking up sync thread recursively for same CPU causes deadlock.
Fix this by avoiding recursive wakeup call to same thread.

CRs-Fixed: 823472
Change-Id: Idc51f53da9fafc17d609132c8d72d85f76c8160f
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2015-04-16 16:51:45 +05:30
Swetha Chikkaboraiah 2c03967525 cpufreq: cpu-boost: Resolve deadlock when waking up sync thread
Waking up sync thread recursively for same CPU causes deadlock.
Fix this by avoiding recursive wakeup call to same thread.

CRs-Fixed: 814956
Change-Id: Iaa789bc8a441e56524e0851274765a07937d83fb
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2015-04-08 14:23:44 +05:30
Swetha Chikkaboraiah 8c9c0f428a cpufreq: cpu-boost: Use interruptible wait to not affect load average
Using the function wait_event in cpu_boost puts the
process enter to 'D' state which contribute to the
high load average. This change will put the process
boost_sync in the 'S' state (interruptible sleep).

CRs-Fixed: 655484
Change-Id: Ie121adbe1fac1d2862ac5342bb97c7c926f7d7a8
Signed-off-by: Swetha Chikkaboraiah <schikk@codeaurora.org>
2014-07-30 14:32:55 +05:30
Shridhar Rasal dbf931fd93 cpufreq: interactive: delete timers for GOV_START
Make sure that timers cpu_timer and cpu_slack_timer
deactivated before addition of new.

Change-Id: If31c4049606871df6f00efdc24b1d713c86a6f69
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Git-commit: b430123367e78a6557bac3cf1558bcb85193fb12
Git-repo: https://android.googlesource.com/kernel/common/
[mattw@codeaurora.org: resolved trivial context conflict]
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2014-04-02 16:55:14 -07:00
Saravana Kannan 887c61c4c9 cpufreq: cpu-boost: Don't register for cpufreq notifiers too early
The cpufreq notifiers should be registered only after all the data
structures used in the notifier callbacks have been initialized. So, move
the cpufreq notifier registration to a later point in the init function.

Change-Id: I043ab5bc0ebb98164c40549fe151a8d801c8c186
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2014-02-27 02:12:23 -08:00
Saravana Kannan 6e745324a2 cpufreq: cpu-boost: Fix deadlock in wake_up of sync threads
If wake_up() is called on the current task on a CPU, the call will wait
until the current task is switched out before it wakes it up again and
returns.

The sync notifier for a CPU always runs on that CPU.

These two together can result in a deadlock if the sync notifier on CPU A
tries to wake up the sync thread of CPU A as it goes to sleep (is the
current task). A previous commit fixed this by adding a check to the sync
notifier to not wake up the sync thread of CPU A if it's the current task.

But this is still not sufficient to prevent deadlocks.

Sync thread of CPU A could be the current task on CPU B and sync thread of
CPU B could be the current task on CPU A.  At this point, if sync notifier
of CPU A and B try to wake up the sync threads of CPU A and B, it will
result in CPU A waiting for the current task in CPU B to get switched out
and CPU B waiting for the current task in CPU A to get switched out.  This
will result in a deadlock.

Prevent this scenario from happening by pinning the sync threads of each
CPU to run on that CPU. By doing this, we guarantee that sync notifiers
will only try to wake up sync threads running on that CPU. The fix added by
"cpufreq: cpu-boost: Resolve deadlock when waking up sync thread" ensures a
deadlock doesn't happen when a sync notifier tries to wake up a sync thread
running on that CPU.

Change-Id: I864e545529722a23886dd5a82f66089155d2d193
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2014-02-01 05:48:08 -08:00
Saravana Kannan 4f51d1e1f8 cpufreq: cpu-boost: Fix queue_delayed_work_on() race with hotplug
Calling queue_delayed_work_on() on a CPU that's in the process of getting
hotplugged out can result in that CPU infinitely looping in
msm_pm_wait_cpu_shutdown(). If queue_delayed_work_on() is called after the
CPU is hotplugged out, it could wake up the CPU without going through the
hotplug path and cause instability. To avoid this, make sure the CPU is and
stays online while queuing a work on it.

Change-Id: I1b4aae3db803e476b1a7676d08f495c1f38bb154
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2014-02-01 05:46:46 -08:00
Vijay Ganti 945f70f7f6 cpufreq: interactive: Fix null pointer dereference in interactive governor
For the sync_freq feature currently we check pcpu->policy->cur frequency
for each online cpu.  But for a CPU that isn't using interactive governor
or for an offline CPU, pcpu->policy can be null or an invalid value.
This patch tries to avoid that scenario by using pcpu->target_freq
instead of policy->cur to get the frequency of an online CPU.

Kernel crash without this patch:
[   20.132373] Unable to handle kernel NULL pointer dereference at virtual address 00000028
[   20.132375] pgd = c34f34c0
[   20.132377] pgd = ef6f2440
[   20.132383] [00000028] *pgd=00000000
[   20.132385]
[   20.132388] [00000028] *pgd=2e98f003, *pmd=00000000
[   20.132390] Internal error: Oops: 205 [#1] PREEMPT SMP ARM
[   20.132394] Modules linked in:
[   20.132398] CPU: 0 PID: 1560 Comm: chown Tainted: G        W    3.10.0-perf-gb12057b-00001-ga2c6c16-dirty #7
[   20.132401] task: ef9af300 ti: ee49c000 task.ti: ee49c000
[   20.132411] PC is at cpufreq_interactive_timer+0x10c/0x650
[   20.132415] LR is at cpufreq_interactive_timer+0x128/0x650
<snip>
[   20.133002] [<c07eb204>] (cpufreq_interactive_timer+0x10c/0x650) from [<c02804d8>] (call_timer_fn+0x80/0x198)
[   20.133012] [<c02804d8>] (call_timer_fn+0x80/0x198) from [<c0280acc>] (run_timer_softirq+0x1f8/0x270)
[   20.133019] [<c0280acc>] (run_timer_softirq+0x1f8/0x270) from [<c0279e20>] (__do_softirq+0x12c/0x2d4)
[   20.133025] [<c0279e20>] (__do_softirq+0x12c/0x2d4) from [<c027a2d4>] (irq_exit+0x74/0xc8)
[   20.133034] [<c027a2d4>] (irq_exit+0x74/0xc8) from [<c0206a00>] (handle_IRQ+0x68/0x8c)
[   20.133041] [<c0206a00>] (handle_IRQ+0x68/0x8c) from [<c02004b8>] (gic_handle_irq+0x3c/0x60)
[   20.133051] [<c02004b8>] (gic_handle_irq+0x3c/0x60) from [<c0ac6900>] (__irq_svc+0x40/0x70)
<snip>

Change-Id: Ie834f5d383de4d41e0fe6fbd40c8b0a0c05d82f5
Signed-off-by: Vijay Ganti <viganti@codeaurora.org>
2014-01-15 14:59:33 -08:00
Linux Build Service Account 98df9c6279 Merge "cpufreq: ondemand: Remove unnecessary synchronization attempt" 2014-01-08 15:59:05 -08:00
Saravana Kannan a0703e560c cpufreq: Fix policy getting stuck when user & kernel min/max don't overlap
Every __cpufreq_set_policy starts with checking the new policy min/max has
some overlap with the current policy min/max. This works out fine until we
end up with the policy min/max being set to a range that doesn't overlap
with the user policy min/max. Once we get into this situation, the check at
the start of __cpufreq_set_policy fails and prevents us from getting out of
this state.

This only happens when one of the CPUFREQ_ADJUST/CPUFREQ_INCOMPATIBLE
notifiers called inside __cpufreq_set_policy pick a min/max outside the
range of user policy min/max.

The real intent of the check at the start of __cpufreq_set_policy is to
make sure userspace can't set user policy min > user policy max. Since
__cpufreq_set_policy always gets called only with current user policy
min/max except when the actual user space policy min/max is changed, we can
fix the issue by simply checking the new policy min/max against current
user policy min/max.

Change-Id: Iaac805825e64d7985c41fb9052bd96baacdf3d6f
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2014-01-07 17:52:17 -08:00
Linux Build Service Account 0f60297905 Merge "cpufreq: interactive: Use default min_sample_time if SDF is zero" 2013-12-23 16:41:10 -08:00
Linux Build Service Account e4c1ad6762 Merge "cpufreq: interactive: Modifying sync_freq implementation" 2013-12-23 16:41:09 -08:00
Rohit Gupta 5f8e2a205d cpufreq: interactive: Use default min_sample_time if SDF is zero
Use min_sample_time to step down from max frequencies if
sampling_down_factor is set to zero.

Change-Id: I2e89bef6220557cb95efd20d658e0c05753b4c3c
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-12-20 16:29:32 -08:00
Rohit Gupta bc925b1561 cpufreq: interactive: Modifying sync_freq implementation
1. Check for up_threshold_any_cpu_freq instead of sync_freq to
   boost the frequency to sync_freq.
2. Change the load threshold name from sync_freq_load_threshold to
   up_threshold_any_cpu_load
3. Do not consider CPUs with load less than up_threshold_any_cpu_load
   while evaluating max load across CPUs

Change-Id: Ia0e537edbf38a5006c1a22f5c472daa0d086ffc9
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-12-20 13:17:49 -08:00
Linux Build Service Account 57960089a1 Merge "ondemand: add sysfs entry for down_diff_multi_core" 2013-12-17 02:54:35 -08:00
Srivatsa Vaddagiri 5f4df6538e cpufreq: ondemand: Remove unnecessary synchronization attempt
Commit 1ce28d6b (ondemand: updated tune for hardware coordination)
brings in an attempt to synchronize expiry of per-cpu ondemand timer
at same time across all online cpus. This is meant to help systems
where "multiple cores share P-state via Hardware Coordination".

Synchronization is achieved by having timers expire when jiffy value
would be a perfect multiple of sampling window size. While such
synchronozation attemps are unnecessary on systems where cores don't
share P-states, it can hurt on power as cpus can now work off shorter
sampling windows (when percentage utilization over short window can be
observed to be high, causing frequency to be boosted).

Remove this unnecessary attempt to synchronize expiry of ondemand
timer across online cpus. A more acceptable solution could be to have
low-level architecture specific cpufreq driver indicate the need for
synchronization.

Change-Id: I6cb1cf3472ca106f029dc01248e0df7cfbb495b8
Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org>
2013-12-16 15:17:02 -08:00
Zhoulu Luo bf45171730 Merge remote-tracking branch 'remotes/quic/jb_3.2' into HEAD
Conflicts:
	arch/arm/configs/msm8226-perf_defconfig
	arch/arm/configs/msm8226_defconfig
	arch/arm/mach-msm/clock-8974.c
	arch/arm/mach-msm/clock-local2.c
	arch/arm/mach-msm/clock-mdss-8974.c
	arch/arm/mach-msm/clock-mdss-8974.h
	drivers/gpu/msm/kgsl_device.h
	drivers/input/touchscreen/synaptics_i2c_rmi4.c
	drivers/media/platform/msm/vidc/msm_vidc.c
	drivers/media/platform/msm/vidc/venus_hfi.c
	drivers/media/platform/msm/vidc/vidc_hfi_io.h
	drivers/misc/qseecom.c
	drivers/thermal/msm_thermal.c
	drivers/video/msm/mdss/mdp3.c
	drivers/video/msm/mdss/mdp3.h
	drivers/video/msm/mdss/mdp3_ctrl.c
	drivers/video/msm/mdss/mdss_fb.c
	drivers/video/msm/mdss/mdss_mdp_overlay.c
	drivers/video/msm/mdss/mdss_mdp_pp.c
	sound/soc/codecs/msm_hdmi_codec_rx.c
	sound/soc/codecs/wcd9306.c
	sound/soc/codecs/wcd9xxx-resmgr.c
	sound/soc/msm/qdsp6v2/audio_acdb.c

Change-Id: Ibc13fd9186ff593bb11e9fa61bb03b10c22a3383
2013-12-12 13:01:47 -08:00
Krishna Vanka 224c331ddb ondemand: add sysfs entry for down_diff_multi_core
This change adds sysfs entry for the ondemand governor's attribute
down_differential_multi_core. This is required to be able to program
this knob to attain better perf/power for use cases like camcorder.

CRs-fixed: 561456
Change-Id: Ib7c1223215c6b714c286c231ed37f3abfae741c6
Signed-off-by: Krishna Vanka <kvanka@codeaurora.org>
2013-12-11 16:16:41 +05:30
Linux Build Service Account c67779d5a6 Merge "cpufreq: interactive: Remove trace event from idle_start handler" 2013-12-10 17:15:49 -08:00
Linux Build Service Account bae739faee Merge "cpufreq: interactive: sync freq feature for interactive governor" 2013-12-10 17:15:47 -08:00
Rohit Gupta 3b7992b902 cpufreq: interactive: Remove trace event from idle_start handler
Removed the trace_cpufreq_interactive_idle_start.
Also fix a crash resulting from accessing NULL policy before taking
the pcpu->enable_sem lock. The policy can be NULL if the core is
hotplugged out before the enable_sem lock is taken.

Change-Id: I7e2809cc016b3b383a44cdf3c697013e2d2b5417
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-12-09 19:18:35 -08:00
Osvaldo Banuelos 6fe38577e1 cpufreq: ondemand: fix timer-related list corruption in store_powersave_bias()
The dbs_timer_init() call in store_powersave_bias() re-initializes the
dbs_info workqueue, call on dbs_timer_exit() to ensure
outstanding work is cleared prior to making this call. Also, grab the
percpu timer_mutex lock to avoid race conditions with respect to the
dbs timer.

Change-Id: I79f3d43eeb51d2d8e21edd0fe043d6583333951f
Signed-off-by: Osvaldo Banuelos <osvaldob@codeaurora.org>
2013-12-09 17:34:34 -08:00
Linux Build Service Account 0abeecbfff Merge "cpufreq: interactive: Reset floor_validate_time if busy at max for 100ms" 2013-12-07 11:11:14 -08:00
Linux Build Service Account c1b8d4ae00 Merge "cpufreq: interactive: Allow 1 ms error in above_hispeed_delay comparisons" 2013-12-07 11:11:12 -08:00
Linux Build Service Account ffbd80bf09 Merge "cpufreq: Add Input Boost feature to the cpu-boost driver" 2013-12-07 11:11:11 -08:00
Rohit Gupta a2c5e6ffdd cpufreq: interactive: Reset floor_validate_time if busy at max for 100ms
When the interactive governor selects to run at max frequency it doesn't
re-schedule the timer until it hits an idle. This change checks if the CPU
has been continuously busy for last 100ms on hitting an idle start. If yes,
then floor_validate_time is reset so that the CPU stays at max frequency
for at least another 100 ms before stepping down.
This is an important feature for detecting CPU intensive workloads which
require high frequencies for achieving better performance.

Change-Id: I7d48ffbc3d50a80af9be3bf94667ee3d0120b763
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-12-06 16:38:46 -08:00
Rohit Gupta c26e259445 cpufreq: interactive: sync freq feature for interactive governor
1) Add load info to cpufreq_interactive_cpuinfo
2) If load on any other online cpu exceeds sync_freq_load_threshold,
   do not allow the frequency to drop below sync_freq

Change-Id: I3617e10f87b85178914a18bcf04ac2a31a4f1ec1
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-12-06 14:58:45 -08:00
Rohit Gupta c6bd445538 cpufreq: interactive: Allow 1 ms error in above_hispeed_delay comparisons
Allow for an error of 1 ms while taking into account
above_hispeed_delay for a frequency

Change-Id: I744e44387152e4efb5978df4f2b9533bf79d4582
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-12-04 18:37:38 -08:00
Rohit Gupta 40735b8665 cpufreq: Disable cpu-boost by default
Disable cpu-boost by default, so that it can be turned ON only by
setting the module parameter boost_ms through command prompt when
required.

Change-Id: Ia9bc280892f65ed1d2e8051d1951e51922ad13db
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-12-04 15:28:12 -08:00
Rohit Gupta 865e53bac4 cpufreq: Add Input Boost feature to the cpu-boost driver
On incoming input events boost the frequency of all online cpus
for at least input_boost_ms ms. This is accomplished by changing
the policy->min of all the online cpus to input_boost_freq.

Change-Id: Idb0ab75d68ae4ceff259cbbaaec1a9bb3bc871d3
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-12-03 19:45:55 -08:00
Linux Build Service Account b99a99c425 Merge "cpufreq: Add a sync limit to cpu-boost" 2013-11-24 16:17:10 -08:00
Linux Build Service Account bf50dad1c9 Merge "cpufreq: Add cpu-boost driver" 2013-11-24 16:17:09 -08:00
Rohit Gupta 161228f693 cpufreq: Add a sync limit to cpu-boost
Perform frequency synchronization only when source CPU's frequency
is less than sync_threshold, else sync to the sync_threshold.

Change-Id: I544c414568d4e015b80ce5891dd215275bac95da
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-11-24 15:00:45 -08:00
Saravana Kannan bd1b66e488 cpufreq: Add cpu-boost driver
When certain bursty and important events take place, it might take a while
for the current cpufreq governor to notice the new load and react to it.
That would result in poor user experience. To alleviate this, the cpu-boost
driver boosts the frequency of a CPU for a short duration to maintain good
user experience while the governor catches up.

Specifically, this commit deals with ensuring that when "important" tasks
migrate from a fast CPU to a slow CPU, the frequency of the slow CPU is
boosted to be at least as high as the fast CPU for a short duration.

Since this driver enforces the boost by hooking into standard cpufreq
ADJUST notifiers, it has several advantages:
- More portable across kernel versions where the cpufreq internals might
  have been rewritten.
- Governor agnostic and hence works with multiple governors like
  conservative, ondemand, interactive, etc.
- Does not affect the sampling period/logic of existing governors.
- Can have the boost period adjusted independent of governor sampling
  period.

Change-Id: Ibd814a20043d0aba64ee7637a4a79b9ffa1b0991
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
2013-11-24 14:59:03 -08:00
Rohit Gupta e8e984427c cpufreq: interactive: Add a sampling_down_factor for max frequencies
Change min_sample_time to 100ms when running at max

Change-Id: Ia7e35b0625bedf20e7ef3a1f52e5828ffbfed93e
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
2013-11-22 20:33:13 -08:00
Minsung Kim 0d94769c91 cpufreq: interactive: fix show_target_loads and show_above_hispeed_delay
Remove a trailing whitespace from target_loads and above_hispeed_delay. Problem
happens when user-space program tried to restore parameters that saved before
changing parameters. In this case was returned error(EINVAL).

Change-Id: I5a74e3824602cd6f2b74651adda5ec1b627e61e9
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
Git-commit: e116c66cdee9080bf8ecb35c2179d79bd00c3043
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-21 00:06:19 -08:00
Lianwei Wang d1ba106555 cpufreq: interactive: resched timer if max freq raised
When the policy max freq is raised, and before the timer is
rescheduled in idle callback, the cpu freq may stuck at a
lower freq.

The target_freq shall be updated too, else on a high load
situation, the new_freq is always equal to target_freq and
which will cause freq stuck at a lower freq too.

Reschedule the timer on gov limits callback.

Change-Id: I6c187001ab43e859731429b64f75a74eebc37a24
Signed-off-by: Lianwei Wang <a22439@motorola.com>
Git-commit: 0edc2b4c9c30a695d9500d3204acdf5f3ddfa027
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-21 00:04:38 -08:00
Lianwei Wang 5209a72e7a cpufreq: interactive: fix race on cpufreq TRANSITION notifier
The cpufreq TRANSTION notifier callback does not check the
governor_enabled state on affected CPUS, which will case
kernel panic in update_load because the policy object maybe
NULL or invalid when governor_enabled is false.

Change-Id: Ie0f1718124f61e2f9b5da57abc6981ada5b83908
Signed-off-by: Lianwei Wang <a22439@motorola.com>
Git-commit: 44011f4524e86ca5a5e90bb941499cbe37a21987
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-21 00:03:30 -08:00
Minsung Kim 69ac81007f cpufreq: interactive: avoid underflow on active time calculation
Check for idle time delta less than elapsed time delta, avoid
underflow computing active time.

Change-Id: I3e4c6ef1ad794eec49ed379c0c50fa727fd6ad28
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
Git-commit: 3022f93a1aff25b3c9174ac659d7e4a143892267
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-21 00:01:51 -08:00
Todd Poynor d0f4382313 cpufreq: interactive: reduce chance of zero time delta on load eval
Reschedule load sampling timer after timestamp of sample start taken,
hold spinlock across entire sequence to avoid preemption.  Avoid the
WARN for zero time delta in the load sampling timer function.

Change-Id: Idc10a756f09141decb6df92669521a1ebf0dbc10
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Git-commit: 20075d8e9d42aac6e248c7cbe6a2f8a0a00d4ba4
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-21 00:00:49 -08:00
Todd Poynor e61e701c1c cpufreq: interactive: handle errors from cpufreq_frequency_table_target
Add checks for error return from cpufreq_frequency_table_target, and be
less noisy on the existing call with an error check.  CPU hotplug and
system shutdown may cause this call to return -EINVAL.

Bug: 8613560
Change-Id: Id78d8829920462c0db1c7e14e717d91740d6cb44
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Git-commit: 952c6d49444061849e2e254b0d701ebb1664f4b3
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-20 23:59:13 -08:00
Minsung Kim 0b4da2c6c3 cpufreq: interactive: fix uninitialized spinlock
Add missing spinlock init

Backtrace:
[<c0011ce4>] (dump_backtrace+0x0/0x10c) from [<c0662a68>] (dump_stack+0x18/0x1c)
 r6:00000032 r5:c0bd09ec r4:e6848000 r3:00000000
[<c0662a50>] (dump_stack+0x0/0x1c) from [<c06670b0>] (spin_dump+0x80/0x94)
[<c0667030>] (spin_dump+0x0/0x94) from [<c06670f0>] (spin_bug+0x2c/0x30)
 r5:c08f91fc r4:c0bd09ec
[<c06670c4>] (spin_bug+0x0/0x30) from [<c0245f74>] (do_raw_spin_unlock+0x88/0xcc)
 r5:e547bac0 r4:c0bd09ec
[<c0245eec>] (do_raw_spin_unlock+0x0/0xcc) from [<c066c9cc>] (_raw_spin_unlock_irqrestore+0x14/0x40)
 r5:e547bac0 r4:60000013
[<c066c9b8>] (_raw_spin_unlock_irqrestore+0x0/0x40) from [<c044b884>] (store_above_hispeed_delay+0x6c/0x80)
 r4:c0b4cf78 r3:00000007
[<c044b818>] (store_above_hispeed_delay+0x0/0x80) from [<c0235d24>] (kobj_attr_store+0x1c/0x28)
 r7:e68ff000 r6:00000032 r5:e58137c0 r4:e61cde80
[<c0235d08>] (kobj_attr_store+0x0/0x28) from [<c0156b78>] (sysfs_write_file+0x104/0x184)
[<c0156a74>] (sysfs_write_file+0x0/0x184) from [<c0100680>] (vfs_write+0xb0/0x140)
[<c01005d0>] (vfs_write+0x0/0x140) from [<c0100900>] (sys_write+0x44/0x70)
 r8:00000000 r7:00000004 r6:00000032 r5:bee43c90 r4:e5600300
[<c01008bc>] (sys_write+0x0/0x70) from [<c000e400>] (ret_fast_syscall+0x0/0x30)
 r9:e6842000 r8:c000e584 r6:00000032 r5:bee43c90 r4:00000009

Change-Id: I80a1e0b3fecb24adba501ff44f568479deeff7fa
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
Git-commit: 2e745d359ffaa9f4acc4b00950d14322ff364919
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-20 23:57:57 -08:00
Todd Poynor 57cca637e1 cpufreq: interactive: base above_hispeed_delay on target freq, not current
Time to wait should be based on the intended target speed, not the
actual speed (which may be held high by another CPU).

Change-Id: Ifc5bb55d06adddb9a02af90af05398a78f282272
Reported-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Git-commit: c4483b5550079c46dbc68005920a14f371d3f4eb
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-20 23:56:52 -08:00
Todd Poynor 2ce351a776 cpufreq: interactive: fix crash on error paths in get_tokenized_data
Use separate variable for error code, free proper pointer.

Change-Id: Ia83cccb195997789ac6afbf5b8761f7b278196d6
Reported-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Git-commit: cad1684410541be5363d4af9ae8f3f35683a4dd4
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-20 23:54:57 -08:00
Lianwei Wang c4e50bfac3 cpufreq: interactive: add io_is_busy interface
Previously the idle time returned from get_cpu_idle_time_us included the
iowait time. So the iowait time was always calculated as idle time.

But now the idle time returned from get_cpu_idle_time_us does not include
the iowait time anymore because of below commit which cause the iowait time
always calculated as busy time:
    6beea0c nohz: Fix update_ts_time_stat idle accounting

Add the io_is_busy interface, as does the ondemand governor, and let the user
configure the iowait time as busy or idle through the io_is_busy sysfs
interface.

By default, io_is_busy is disabled.

[toddpoynor@google.com: minor updates]
Change-Id: If7d70ff864c43bc9c8d7fd7cfc66f930d339f9b4
Signed-off-by: Lianwei Wang <lian-wei.wang@motorola.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Git-commit: fbcad7234e0aef2725d9f33ac5a0c3a9cc61a9ac
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-20 23:53:14 -08:00
Minsung Kim 4d438df69c cpufreq: interactive: allow arbitrary speed / delay mappings
Accept a string of delays and speeds at which to apply the delay before
raising each step above hispeed. For example, "80000 1300000:200000
1500000:40000" means that the delay at or above 1GHz, until 1.3GHz is 80 msecs,
the delay until 1.5GHz is 200 msecs and the delay at or above 1.5GHz is 40
msecs when hispeed_freq is 1GHz.

[toddpoynor@google.com: add documentation]
Change-Id: Ifeebede8b1acbdd0a53e5c6916bccbf764dc854f
Signed-off-by: Minsung Kim <ms925.kim@samsung.com>
Git-commit: e43dde3b6cec1e1d36a477713bcfb1dda070bef2
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Dilip Gudlur <dgudlur@codeaurora.org>
2013-11-20 16:37:37 -08:00
Linux Build Service Account f2588fb36a Merge "cpufreq: ondemand: add input_boost interface" 2013-10-26 00:03:56 -07:00