summaryrefslogtreecommitdiff
path: root/drivers/cpufreq
AgeCommit message (Collapse)Author
2012-05-08cpufreq: interface for setting governor for a cpuPuneet Saxena
This implementation sets governor for a cpu using existing cpufreq interfaces. bug 871958 Change-Id: Ic4e7e2a2b0babaf1829b559b5db211666d449b86 Signed-off-by: Puneet Saxena <puneets@nvidia.com> Reviewed-on: http://git-master/r/97939 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-04-16cpufreq: interactive: change timer rateShridhar Rasal
Tune *timer_rate* used to increase cpu frequency. bug 943712 Change-Id: I3ded757e21825c475606976c2dcfcd75d9467ef8 Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-on: http://git-master/r/96525 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Satya Popuri <spopuri@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2012-04-12tracing: Add tracepoints for CPU scalingAntti P Miettinen
Simple tracepoints for measuring CPU scaling latencies. Bug 960307 Change-Id: I6fd4e67e352a2ff134da58866d943457506d080b Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com> Reviewed-on: http://git-master/r/93080 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-03-21cpufreq: Typecast compared integersAntti P Miettinen
The min/max frequencies in cpufreq_policy are unsigned integers but pm_qos_request() returns a signed int. Compare as unsigned, frequencies are never negative. Bug 949219 Change-Id: Iba0de9ad6bf221f7a2e5560f597aa56cbeb7b6f6 Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com> Reviewed-on: http://git-master/r/91214 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-03-21cpufreq: set go_maxspeed_load to 85%Shridhar Rasal
To get better performance setting it to 85% from 95% bug 941275 Change-Id: I08bc711ea159d070cf6b62ce25506c8a5bdd7ac4 Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-on: http://git-master/r/91159 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-03-20cpufreq: update target freq alwaysShridhar Rasal
set determined target freq always bug 941275 Change-Id: If72936ed145867abd32b43c5c5100290df2fc187 Signed-off-by: Shridhar Rasal <srasal@nvidia.com> Reviewed-on: http://git-master/r/91010 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Satya Popuri <spopuri@nvidia.com> Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-03-15cpufreq: Add a knob to treat IO wait as busysatya popuri
The new sysfs node io_is_busy enables the interactive governor to account any time spent by the CPU waiting for IO as non-idle time. This helps us improve run-time of IO bound tasks by making up for lost IO time in speeding up the CPU bound parts of the task. Reviewed on http://git-master/r/#change,86894 cherry picked from 13a15aadc1134b5dae05cdcf9687396644f87411 Signed-off-by: satya popuri <spopuri@nvidia.com> Change-Id: I4a14ed7fef5fbce00054bb02d52d2d3e0f011f70 Reviewed-on: http://git-master/r/89218 Reviewed-by: Satya Popuri <spopuri@nvidia.com> Tested-by: Satya Popuri <spopuri@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2012-03-15cpufreq: change min_sample_timesatya popuri
We prefer a min_sample_time of 30ms. This is tied to our cluster switch and auto-hotplug artificial delays. Signed-off-by: satya popuri <spopuri@nvidia.com> original commit message: cpufreq: reduce min_sample_time Reduce the minimum amount of time the interactive governor spends at a frequency before ramping down. This parameter (min_sample_time) was 80ms now reduced to 30 ms based on perf and power sweep numbers. Reviewed-on: http://git-master/r/86900 (cherry picked from commit 581f20a5b7b8c3e4ee2c211b28dbc81510af2ae7). Signed-off-by: satya popuri <spopuri@nvidia.com> Change-Id: I24f4cd52737950fd4e78a36b4ee34a84551e0e12 Reviewed-on: http://git-master/r/89217 Reviewed-by: Satya Popuri <spopuri@nvidia.com> Tested-by: Satya Popuri <spopuri@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2012-03-06cpufreq: ondemand: Prevent sysfs create racePeter Boonstoppel
Protecting sysfs_remove_group() in CPUFREQ_GOV_STOP with dbs_mutex Bug 946462 Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-on: http://git-master/r/86426 (cherry picked from commit d1131158e2ad4d5ccc53b3008743c29385650d86) Change-Id: Iae810e83eaa6f0f7d970b56238cbcb61118af610 Reviewed-on: http://git-master/r/87392 Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
2012-02-21cpufreq interactive governor: Unify attribute store functionsPeter Boonstoppel
Change our added attributes' store functions to Google style Change-Id: I5dc641112085698918e87b52378fe3a5bfe44360 Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-on: http://git-master/r/84452 Reviewed-by: Satya Popuri <spopuri@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2012-02-10cpufreq interactive governor: Reduce permissionsDan Willemsen
Reduce permissions on the max_boost and go_maxspeed_load, the init scripts will change their owner so the current users continue to work. Bug 906796 Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Reviewed-on: http://git-master/r/79096 (cherry picked from commit f1d91095baff48e58a04af0062f579f394094b47) Change-Id: Id9542a202bcf02f886cfee9c0bbe69cc83b8c200 Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-on: http://git-master/r/82726 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com>
2012-02-09cpufreq: properly clamp QoS min/maxDonghan Ryu
typically PM QoS clients request the maximum cpu frequency by setting cpu_freq_min to INT_MAX. Therefore, we need to clamp INT_MAX to whatever the maximum frequency allowed by the policy to make the requested cpu_freq_min is same as the maximum allowed cpu frequency. Inverse logic applies to the cpu_freq_max as well. Bug 932477 Signed-off-by: Donghan Ryu <dryu@nvidia.com> Reviewed-on: http://git-master/r/78401 (cherry picked from commit 9688430a621515f3afe3e0ab358ea7ad5aab6d91) Change-Id: Ie5edcd4a873ed5cce45ec0f9b981f28db6091ff1 Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-on: http://git-master/r/80002 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-01-19cpufreq: Preserve sysfs min/max requestAntti P Miettinen
Store the value received via sysfs as the user_policy min/max value instead of the currently enforced min/max. This allows restoring the user min/max values when constraints on enforced min/max change. Bug 888312 Change-Id: I8a5adf022585e5bd91fa3b1d8d448065efa6827a Reviewed-on: http://git-master/r/73982 Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/75886 Reviewed-by: Automatic_Commit_Validation_User
2012-01-19cpufreq: Enforce PM QoS min/max limitsAntti P Miettinen
Observe PM QoS CPU frequency minimum and maximum in addition to policy settings. Bug 888312 Change-Id: Ia4f60a1649a9952e02f6847c8add3b2ea5d47524 Reviewed-on: http://git-master/r/72207 Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/75884 Reviewed-by: Automatic_Commit_Validation_User
2012-01-19cpufreq: Export user_policy min/maxAntti P Miettinen
Add sysfs nodes for user_policy min and max settings. Bug 888312 Change-Id: Ife8ec07f8faebc0c04e7ecf6e24976a311bad73b Reviewed-on: http://git-master/r/72201 Signed-off-by: Antti P Miettinen <amiettinen@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/75882 Reviewed-by: Automatic_Commit_Validation_User
2011-12-08cpufreq interactive governor: Made sysfs nodes writablePeter Boonstoppel
max_boost and go_maxspeed_load need to be writable for service that controls balanced power mode Cherry-picked from: http://git-master/r/#change,57965 Change-Id: I0e3a39ddf317a0f7ba3bb4908afc8a100db1b883 Signed-off-by: Daniel Solomon <daniels@nvidia.com> Reviewed-on: http://git-master/r/65602 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2011-12-08cpufreq interactive governor: Fix attribute write bugPeter Boonstoppel
Attribute store functions used to return 0 upon success, but should return count instead. Change-Id: I2ab15e536d9affbf80bbcb2e557c6d217d5a9dfa Signed-off-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-on: http://git-master/r/68554 Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Tested-by: Daniel Solomon <daniels@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2011-12-08cpufreq interactive governor: add max_boost sysfs nodePeter Boonstoppel
Allows you to specify a max increase in frequency, disabled by default. Cherry-pick from: http://git-master/r/#change,57928 Change-Id: I8174e31faceaa7c27adfe52515e951a4092a39f3 Signed-off-by: Daniel Solomon <daniels@nvidia.com> Reviewed-on: http://git-master/r/65601 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2011-11-30cpufreq interactive governor: Init idle times on governor startAlex Frid
When governor starts initialize time_in_idle and idle_exit_time variables with current data, and restart timer. This is required to properly start governor on busy CPU that would not enter idle state for a long time. (cherry picked from commit 876dc6eddc68054e6abe23f6287cfbf5302a75b9) (cherry picked from commit d0024f3ad1e4c6d4885355df3fda02435ccc471d) Change-Id: I992ca9193cb95e64cc9ef8bfb86675b32ad6d43d Reviewed-on: http://git-master/r/61712 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Ra79d9a3ca97b0cfd49fb642ba7cafb98c11c04f1
2011-11-30cpufreq interactive governor: Update target frequency calculationAlex Frid
Updated target frequency calculation algorithm to take into account current rate CPU is running at: - When CPU is running below go_maxspeed_load threshold, adjust the target frequency based on current rate to reach tunable sustainable load (instead of applying cpu load to max possible cpu rate). Tuned by setting new node ("0" falls back to using max_rate): /sys/devices/system/cpu/cpufreq/interactive/sustain_load - When CPU is running at/above go_maxspeed_load threshold, ramp the target frequency starting from current exponentially with tunable base (instead of immediate jump to maximum cpu rate). Tuned by setting new node ("0" falls back to jump to max_rate): /sys/devices/system/cpu/cpufreq/interactive/boost_factor Defaults for the new tunning parameters are set to "0" - so no changes in governor default behavior. Original-Change-Id: Ie845d747239ba177e6f06b73965c3213649f8135 Reviewed-on: http://git-master/r/34583 Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Tested-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Chih-Lung Huang <lhuang@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Rebase-Id: Re898a7b96d3c1b7343e773aab9788e4ff2b1d7f8
2011-11-30Revert "cpufreq: interactive governor: apply intermediate load on current speed"Dan Willemsen
This reverts commit 6f312490bcf93bf51ad4ba8d4965a952f521cb7d. Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Rebase-Id: Rf54be39acd2c92decd9e5c4522d2b2e47589d84e
2011-11-30Revert "cpufreq: interactive governor: scale to max only if at min speed"Dan Willemsen
This reverts commit 460145c8b1d2ff8a2488baa10d7421e1d8179b7d. Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Rebase-Id: Racc6c054ac5c67c38dec7281c7190c6650bfb8bd
2011-11-30Revert "cpufreq: interactive governor: go to intermediate hi speed before max"Dan Willemsen
This reverts commit d7e7e4f15c62464dfa5d2c58d73bc66f131795bc. Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Rebase-Id: R4a8c8c91c64c2c1d64ecb22dfe8a7c2cd133fd39
2011-11-30Revert "cpufreq: interactive governor: default 20ms timer"Dan Willemsen
This reverts commit 4714e5222b5a9b11030eda6df7b8159034be0008. Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com> Rebase-Id: Rc7c804305f9c37c4b93d5d7eecce0b9b93499e27
2011-11-30Merge branch 'korg-android-tegra-3.1' into after-upstream-androidDan Willemsen
Conflicts: arch/arm/mach-tegra/Kconfig arch/arm/mach-tegra/board-ventana.c drivers/misc/Kconfig drivers/video/tegra/dc/hdmi.c Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
2011-11-30cpufreq: stats: snap freq to next lower freq when not in tablePeter Boonstoppel
When cpu runs at frequency not in cpufreq table (because of other frequency governing mechanisms), bill time spent at that frequency to next lower frequency in cpufreq stats table. Original-Change-Id: I9cfda4e7a223ca3f773f1adb145d242483209799 Reviewed-on: http://git-master/r/47929 Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Tested-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Rebase-Id: Rd25650679bddec2837d92c75b18f8568c7569336
2011-11-30cpufreq: prevent out-of-bounds write when stat->last_index = -1Peter Boonstoppel
When cpu runs at a frequency not in cpufreq table (because of other frequency governing mechanisms), freq_table_get_index() returns -1 which gets used as an array index. Original-Change-Id: Id8fa5d5125c3cd1e2aad8b48ff7bd619f39c57d8 Reviewed-on: http://git-master/r/47887 Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Tested-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Rebase-Id: R032fc27d227d3308e5afa17d909f64d6925e05cc
2011-11-30cpufreq: interactive governor: default 20ms timerTodd Poynor
Change-Id: Ie9952f07b38667f2932474090044195c57976faa Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30cpufreq: interactive governor: go to intermediate hi speed before maxTodd Poynor
* Add attribute hispeed_freq, which defaults to max. * Rename go_maxspeed_load to go_hispeed_load. * If hit go_hispeed_load and at min speed, go to hispeed_freq; if hit go_hispeed_load and already above min speed go to max speed. Change-Id: I1050dec5f013fc1177387352ba787a7e1c68703e Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30cpufreq: interactive governor: scale to max only if at min speedTodd Poynor
Change-Id: Ieffb2aa56b5290036285c948718be7be0d3af9e8 Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30cpufreq: interactive governor: apply intermediate load on current speedTodd Poynor
Calculate intermediate speed by applyng CPU load to current speed, not max speed. Change-Id: Idecf598b9a203b07c989c5d9e9c6efc67a1afc2e Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30power: cpufreq interactive governor: use default sample time 20msTodd Poynor
Lower the default time at which a higher speed is allowed to run before lowering based on lower CPU load from 80ms to 20ms. Most Android devices should trade power for performance here, although tablets and non-battery-powered devices may want to override this default. Change-Id: I1a4f7faeca12793c51d5b92db30a63cca8d4f1be Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30cpufreq: interactive governor: default timer 10ms, maxspeed load 95%Todd Poynor
Modify default timer from 30ms to 10ms, sampling 2 jiffies after idle exit on ARM as in Honeycomb. Modify default go_maxspeed_load from 85% loaded to 95% loaded, for use in phones where power savings is more important (tablets may be best served overriding this). Change-Id: I3361a6279979bfae1df5262666a2e30ea7a44328 Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30cpufreq: interactive: fix possible Division by zero.Axel Haslam
The following dump was seen sometimes while resuming, the only division by zero on this function can happen after delta_time is reassigned, since at the start of the function, there is jump that protects against values less than 1000. After that, If delta_time and delta_idle == 0, we will hit a div 0 Division by zero in kernel. Backtrace: [<c0057184>] (dump_backtrace+0x0/0x110) from [<c05d5ecc>] (dump_stack+0x18/0x1c) r6:010f3000 r5:c113dfb0 r4:c004afb0 r3:c6ff0000 [<c05d5eb4>] (dump_stack+0x0/0x1c) from [<c00572cc>] (__div0+0x1c/0x20) [<c00572b0>] (__div0+0x0/0x20) from [<c02195d4>] (Ldiv0+0x8/0x10) [<c03dfd64>] (cpufreq_interactive_timer+0x0/0x2c0) from [<c00a7efc>] (run_timer_softirq+0x154/0x260) [<c00a7da8>] (run_timer_softirq+0x0/0x260) from [<c00a0c8c>] (__do_softirq+0xc8/0x194) [<c00a0bc4>] (__do_softirq+0x0/0x194) from [<c00a1008>] (irq_exit+0xb4/0xb8) [<c00a0f54>] (irq_exit+0x0/0xb8) from [<c00584b4>] (ipi_timer+0x44/0x48) r4:c004a040 r3:00000001 [<c0058470>] (ipi_timer+0x0/0x48) from [<c004c3e4>] (do_local_timer+0x68/0x84) r5:c004ae2c r4:c07991e8 [<c004c37c>] (do_local_timer+0x0/0x84) from [<c0052948>] (__irq_svc+0x48/0xe0) Change-Id: I639882db67b8d711c5710778ebc212f0f6a998e3 Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Axel Haslam <axelhaslam@ti.com>
2011-11-30cpufreq: interactive: Fix handling of SMP where CPUs must scale in tandemTodd Poynor
The interactive governor relies on quirks of the Tegra 2 cpufreq implementation for handling SMP systems where the CPUs do not have separate rate controls. It needs to determine the maximum rate for all CPUs covered by the policy and set that speed. Change-Id: I1ed9fa171e5a9c45a1fa5944e3fa823eb157e81f Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30cpufreq: interactive: fix checkpatch warnings on long linesAllen Martin
Fix up checkpatch warning introduced by long lines in timer_rate patch. Change-Id: I22b105dafb1b49390799bb7577464da03f0f8afb Signed-off-by: Allen Martin <amartin@nvidia.com>
2011-11-30cpufreq: interactive: cleanup checkpatch warningsAllen Martin
Cleanup some style warnings reported by checkpatch Change-Id: Ie2e6903d52867fb3347e009d7efa3bc4ca755cea Signed-off-by: Allen Martin <amartin@nvidia.com>
2011-11-30cpufreq: Add more verbose description of interactive governorAllen Martin
Update the Kconfig help paragraph to give more detail about interactive governor. Change-Id: I607b817b370accac3a685001649a15e2f7894f59 Signed-off-by: Allen Martin <amartin@nvidia.com>
2011-11-30cpufreq: interactive: add sysfs control for timer rateAllen Martin
Add a new sysfs control that tunes the rate of the timer used to increase cpu frequency Change-Id: I1aa13ae54bb43aff5b3688984d2955f56aae1658 Signed-off-by: Allen Martin <amartin@nvidia.com>
2011-11-30cpufreq: interactive: Add error checking on sysfs interfacesAllen Martin
This adds better error checking on tunable parameters on sysfs interfaces. Also fixes return value from these functions, previously on success they would return 0 which would cause a infinite loop. Change-Id: Ic05038492166f8673d007202092471f98a2f0dfa Signed-off-by: Allen Martin <amartin@nvidia.com>
2011-11-30cpufreq: interactive: use idle notifierAllen Martin
Convert interactive governor to use idle notifier instead of hooking pm_idle directly. Change-Id: I47e007f330468ac559240a0ae8a3cb06a89ccb67 Signed-off-by: Allen Martin <amartin@nvidia.com>
2011-11-30cpufreq: interactive: remove debug trace codeAllen Martin
Remove debug trace code in preparation of upstreaming Change-Id: I0905885e75031f5e9d7cb06878fb68c1fd06d4fe Signed-off-by: Allen Martin <amartin@nvidia.com>
2011-11-30cpufreq interactive: support shared CPU scalingTodd Poynor
Change-Id: Id5267f04067bf023f6b140b4de2e88ef7287e941 Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30cpufreq: Prevent memory leak in cpufreq_stats on hotplugColin Cross
Ensures that cpufreq_stats_free_table is called before __cpufreq_remove_dev on cpu hotplug (which also occurs during suspend on SMP systems) to make sure that sysfs_remove_group can get called before the cpufreq kobj is freed. Otherwise, the sysfs file structures are leaked. Change-Id: I87e55277272f5cfad47e9e7c92630e990bb90069 Signed-off-by: Colin Cross <ccross@android.com>
2011-11-30cpufreq interactive governor: fix crash on CPU shutdownTodd Poynor
Don't reference the saved copy of the CPU's cpufreq policy pointer after the governor has been stopped for the CPU. When the governor is stopped for a CPU: * Use del_timer_sync() to wait for a currently-running timer function to stop. * Delete the timer when the governor is stopped for the associated CPU, not when the last CPU is stopped. * Flush any speed down work ongoing. * Reset the timestamp that is used to tell if the timer function has had a chance to run since last idle exit. Check the governor enabled flag for the CPU before re-arming the timer from within the timer function and at idle exit (in case stopping the governor at runtime). Check the governor enabled flag for the CPU in the worker function and thread before using the policy pointer. (There is still a tiny window in the thread that needs more work to close.) Change-Id: Ifaddf7a495a8dae15a579a57bdc654f7c47f6ada Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30cpufreq interactive governor save/restore IRQs around cpumask spinlocksTodd Poynor
Need to use irqsave/restore spin locking for cpumasks since these are accessed in timers and in thread context. Change-Id: I4a53eaf0ced7e73b445feddba90ec11482de9126 Signed-off-by: Todd Poynor <toddpoynor@google.com>
2011-11-30cpufreq: interactive: New 'interactive' governorMike Chan
This governor is designed for latency-sensitive workloads, such as interactive user interfaces. The interactive governor aims to be significantly more responsive to ramp CPU quickly up when CPU-intensive activity begins. Existing governors sample CPU load at a particular rate, typically every X ms. This can lead to under-powering UI threads for the period of time during which the user begins interacting with a previously-idle system until the next sample period happens. The 'interactive' governor uses a different approach. Instead of sampling the CPU at a specified rate, the governor will check whether to scale the CPU frequency up soon after coming out of idle. When the CPU comes out of idle, a timer is configured to fire within 1-2 ticks. If the CPU is very busy from exiting idle to when the timer fires then we assume the CPU is underpowered and ramp to MAX speed. If the CPU was not sufficiently busy to immediately ramp to MAX speed, then the governor evaluates the CPU load since the last speed adjustment, choosing the highest value between that longer-term load or the short-term load since idle exit to determine the CPU speed to ramp to. A realtime thread is used for scaling up, giving the remaining tasks the CPU performance benefit, unlike existing governors which are more likely to schedule rampup work to occur after your performance starved tasks have completed. The tuneables for this governor are: /sys/devices/system/cpu/cpufreq/interactive/min_sample_time: The minimum amount of time to spend at the current frequency before ramping down. This is to ensure that the governor has seen enough historic CPU load data to determine the appropriate workload. Default is 80000 uS. /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load The CPU load at which to ramp to max speed. Default is 85. Change-Id: Ib2b362607c62f7c56d35f44a9ef3280f98c17585 Signed-off-by: Mike Chan <mike@android.com> Signed-off-by: Todd Poynor <toddpoynor@google.com> Bug: 3152864
2011-09-14drivers/cpufreq/pcc-cpufreq.c: avoid NULL pointer dereferenceNaga Chumbalkar
per_cpu(processors, n) can be NULL, resulting in: Loading CPUFreq modules[ 437.661360] BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffffa0434314>] pcc_cpufreq_cpu_init+0x74/0x220 [pcc_cpufreq] It's better to avoid the oops by failing the driver, and allowing the system to boot. Signed-off-by: Naga Chumbalkar <nagananda.chumbalkar@hp.com> Cc: Dave Jones <davej@codemonkey.org.uk> Cc: Len Brown <lenb@kernel.org> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-26Merge branch 'drm-core-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 * 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (135 commits) drm/radeon/kms: fix DP training for DPEncoderService revision bigger than 1.1 drm/radeon/kms: add missing vddci setting on NI+ drm/radeon: Add a rmb() in IH processing drm/radeon: ATOM Endian fix for atombios_crtc_program_pll() drm/radeon: Fix the definition of RADEON_BUF_SWAP_32BIT drm/radeon: Do an MMIO read on interrupts when not uisng MSIs drm/radeon: Writeback endian fixes drm/radeon: Remove a bunch of useless _iomem casts drm/gem: add support for private objects DRM: clean up and document parsing of video= parameter DRM: Radeon: Fix section mismatch. drm: really make debug levels match in edid failure code drm/radeon/kms: fix i2c map for rv250/280 drm/nouveau/gr: disable fifo access and idle before suspend ctx unload drm/nouveau: pass flag to engine fini() method on suspend drm/nouveau: replace nv04_graph_fifo_access() use with direct reg bashing drm/nv40/gr: rewrite/split context takedown functions drm/nouveau: detect disabled device in irq handler and return IRQ_NONE drm/nouveau: ignore connector type when deciding digital/analog on DVI-I drm/nouveau: Add a quirk for Gigabyte NX86T ...
2011-07-25Merge branch 'next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (99 commits) drivers/virt: add missing linux/interrupt.h to fsl_hypervisor.c powerpc/85xx: fix mpic configuration in CAMP mode powerpc: Copy back TIF flags on return from softirq stack powerpc/64: Make server perfmon only built on ppc64 server devices powerpc/pseries: Fix hvc_vio.c build due to recent changes powerpc: Exporting boot_cpuid_phys powerpc: Add CFAR to oops output hvc_console: Add kdb support powerpc/pseries: Fix hvterm_raw_get_chars to accept < 16 chars, fixing xmon powerpc/irq: Quieten irq mapping printks powerpc: Enable lockup and hung task detectors in pseries and ppc64 defeconfigs powerpc: Add mpt2sas driver to pseries and ppc64 defconfig powerpc: Disable IRQs off tracer in ppc64 defconfig powerpc: Sync pseries and ppc64 defconfigs powerpc/pseries/hvconsole: Fix dropped console output hvc_console: Improve tty/console put_chars handling powerpc/kdump: Fix timeout in crash_kexec_wait_realmode powerpc/mm: Fix output of total_ram. powerpc/cpufreq: Add cpufreq driver for Momentum Maple boards powerpc: Correct annotations of pmu registration functions ... Fix up trivial Kconfig/Makefile conflicts in arch/powerpc, drivers, and drivers/cpufreq