aboutsummaryrefslogtreecommitdiff
path: root/drivers/cpufreq
AgeCommit message (Collapse)Author
2007-10-09[CPUFREQ] Don't take semaphore in cpufreq_quick_get()Andi Kleen
I don't see any reason to take an expensive lock in cpufreq_quick_get() Reading policy->cur is a single atomic operation and after the lock is dropped again the state could change any time anyways. So don't take the lock in the first place. This also makes this function interrupt safe which is useful for some code of mine. Signed-off-by: Andi Kleen <ak@suse.de> Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-10-04[CPUFREQ] cpufreq_stats: misc cpuinit section annotationsSatyam Sharma
* Stop referencing the callback directly from the __init and __exit functions of this driver, and instead explicitly call cpufreq_update_policy() et al. This enables the callback function to be marked as __cpuinit (and the notifier_block __cpuinitdata), thereby saving space when HOTPLUG_CPU=n. This also enables us to use other tricks to replace __cpuinit{data} in future. * cpufreq_stats_free_table() is only called from __cpuinit or __exit marked functions, making it an ideal candidate for __cpuexit. * Fix missing space in the module description Signed-off-by: Satyam Sharma <satyam@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-10-04[CPUFREQ] mark hotplug notifier callback as __cpuinitSatyam Sharma
The notifier_block is already __cpuinitdata, thereby allowing us to safely mark the callback function as __cpuinit also, thereby saving space when HOTPLUG_CPU=n. Signed-off-by: Satyam Sharma <satyam@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-10-04[CPUFREQ] Only check for transition latency on problematic governors ↵Thomas Renninger
(kconfig fix) Cc: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-10-04[CPUFREQ] allow ondemand and conservative cpufreq governors to be used as ↵Thomas Renninger
default Depending on the transition latency of the HW for cpufreq switches, the ondemand or conservative governor cannot be used with certain cpufreq drivers. Still the ondemand should be the default governor on a wide range of systems. This patch allows this and lets the governor fallback to the performance governor at cpufreq driver load time, if the driver does not support fast enough frequency switching. Main benefit is that on e.g. installation or other systems without userspace support a working dynamic cpufreq support can be achieved on most systems by simply loading the cpufreq driver. This is especially essential for recent x86(_64) laptop hardware which may rely on working dynamic cpufreq OS support. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Bryan Wu <bryan.wu@analog.com> Cc: Andi Kleen <ak@suse.de> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-10-04[CPUFREQ] move policy's governor initialisation out of low-level drivers ↵Thomas Renninger
into cpufreq core Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Bryan Wu <bryan.wu@analog.com> Cc: Andi Kleen <ak@suse.de> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-07-13[CPUFREQ] Restore previously used governor on a hot-replugged CPUThomas Renninger
Negative side effect: needs NR_CPUs pointer array of memory in CONFIG_HOTPLUG_CPU case. Still needs userspace track keeping and rewriting of governors if governors change while a CPU is not active (always the governor at CPU remove time is restored). Move of policy->user_policy.governor assignment is just a minor cleanup. http://bugzilla.kernel.org/show_bug.cgi?id=8671 Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-07-13[CPUFREQ] bugfix cpufreq in combination with performance governorPeter Oruba
There is a frequency scaling issue that I encountered with the performance governor in combination with CPU hotplug. In cpufreq.c CPU frequency is reduced to its minimum before the CPU gets unregistered and set offline. Does that have a particular reason? Since the (k8-)governor does not monitor CPU frequency that setting also applies then to the remaining CPU as well and lets the system run on the lowest frequency although performance is chose as the policy. Signed-off-by: Peter Oruba <peter.oruba@amd.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-07-12Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreqLinus Torvalds
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq: [CPUFREQ] Fix sysfs_create_file return value handling [CPUFREQ] ondemand: fix tickless accounting and software coordination bug [CPUFREQ] ondemand: add a check to avoid negative load calculation [CPUFREQ] Keep userspace governor quiet when it is not being used [CPUFREQ] Longhaul - Proper register access [CPUFREQ] Kconfig powernow-k8 driver should depend on ACPI P-States driver [CPUFREQ] Longhaul - Replace ACPI functions with direct I/O [CPUFREQ] Longhaul - Remove duplicate multipliers [CPUFREQ] Longhaul - Embedded "conservative" [CPUFREQ] acpi-cpufreq: Proper ReadModifyWrite of PERF_CTL MSR [CPUFREQ] check return value of sysfs_create_file [CPUFREQ] Longhaul - Check ACPI "BM DMA in progress" bit [CPUFREQ] Longhaul - Move old_ratio to correct place [CPUFREQ] Longhaul - VT8237 support [CPUFREQ] Longhaul - Use all kinds of support [CPUFREQ] powernow-k8: clarify number of cores.
2007-07-11sysfs: kill unnecessary attribute->ownerTejun Heo
sysfs is now completely out of driver/module lifetime game. After deletion, a sysfs node doesn't access anything outside sysfs proper, so there's no reason to hold onto the attribute owners. Note that often the wrong modules were accounted for as owners leading to accessing removed modules. This patch kills now unnecessary attribute->owner. Note that with this change, userland holding a sysfs node does not prevent the backing module from being unloaded. For more info regarding lifetime rule cleanup, please read the following message. http://article.gmane.org/gmane.linux.kernel/510293 (tweaked by Greg to not delete the field just yet, to make it easier to merge things properly.) Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-06-21[CPUFREQ] Fix sysfs_create_file return value handlingTobias Klauser
Commit 0a4b2ccc555fa2ca6873d60219047104e4805d45 in cpufreq.git eliminates the build warnings but does not pass on the error code of sysfs_create_file to the function calling cpufreq_add_dev. Instead some previous value of ret would be returned. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Dave Jones <davej@redhat.com>
2007-06-21[CPUFREQ] ondemand: fix tickless accounting and software coordination bugVenki Pallipadi
With tickless kernel and software coordination os P-states, ondemand can look at wrong idle statistics. This can happen when ondemand sampling is happening on CPU 0 and due to software coordination sampling also looks at utilization of CPU 1. If CPU 1 is in tickless state at that moment, its idle statistics will not be uptodate and CPU 0 thinks CPU 1 is idle for less amount of time than it actually is. This can be resolved by looking at all the busy times of CPUs, which is accurate, even with tickless, and use that to determine idle time in a round about way (total time - busy time). Thanks to Arjan for originally reporting the ondemand bug on Lenovo T61. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-06-21[CPUFREQ] ondemand: add a check to avoid negative load calculationVenki Pallipadi
Due to rounding and inexact jiffy accounting, idle_ticks can sometimes be higher than total_ticks. Make sure those cases are handled as zero load case. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-06-21[CPUFREQ] Keep userspace governor quiet when it is not being usedVenki Pallipadi
Userspace governor registers a frequency change notifier at init time, even when no CPU is set to userspace governor. Make it register only when atleast one CPU is using userspace. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-05-29[CPUFREQ] check return value of sysfs_create_fileThomas Renninger
Eliminate build warning (sysfs_create_file return value must be checked) Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Dave Jones <davej@redhat.com>
2007-05-09Add suspend-related notifications for CPU hotplugRafael J. Wysocki
Since nonboot CPUs are now disabled after tasks and devices have been frozen and the CPU hotplug infrastructure is used for this purpose, we need special CPU hotplug notifications that will help the CPU-hotplug-aware subsystems distinguish normal CPU hotplug events from CPU hotplug events related to a system-wide suspend or resume operation in progress. This patch introduces such notifications and causes them to be used during suspend and resume transitions. It also changes all of the CPU-hotplug-aware subsystems to take these notifications into consideration (for now they are handled in the same way as the corresponding "normal" ones). [oleg@tv-sign.ru: cleanups] Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: Gautham R Shenoy <ego@in.ibm.com> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08Add a new deferrable delayed work initVenki Pallipadi
Add a new deferrable delayed work init. This can be used to schedule work that are 'unimportant' when CPU is idle and can be called later, when CPU eventually comes out of idle. Use this init in cpufreq ondemand governor. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Dave Jones <davej@codemonkey.org.uk> Cc: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-26[CPUFREQ] cleanup kconfig optionsMike Frysinger
Adds proper lines to help output of kconfig so people can find the module names. Also fixed some broken leading spaces versus tabs. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-26[CPUFREQ] Remove deprecated /proc/acpi/processor/performance write supportThomas Renninger
Remove deprecated /proc/acpi/processor/performance write support Writing to /proc/acpi/processor/xy/performance interferes with sysfs cpufreq interface. Also removes buggy cpufreq_set_policy exported symbol. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Dave Jones <davej@redhat.com>
2007-04-26[CPUFREQ] Fix limited cpufreq when booted on batteryThomas Renninger
References: https://bugzilla.novell.com/show_bug.cgi?id=231107 https://bugzilla.novell.com/show_bug.cgi?id=264077 Fix limited cpufreq when booted on battery If booted on battery: cpufreq_set_policy (evil) is invoked which calls verify_within_limits. max_freq gets lowered and therefore users_policy.max, which is used to restore higher freqs via update_policy later is set to the already limited frequency -> you can never go up again, even BIOS allows higher freqs later. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Dave Jones <davej@redhat.com>
2007-03-27[PATCH] Fix maxcpus=1 trigerring BUG() in cpufreqVenki Pallipadi
Ingo reported it on lkml in the thread "2.6.21-rc5: maxcpus=1 crash in cpufreq: kernel BUG at drivers/cpufreq/cpufreq.c:82!" This check added to remove_dev is symmetric to one in add_dev and handles callbacks for offline cpus cleanly. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-26Revert "[CPUFREQ] constify cpufreq_driver where possible."Linus Torvalds
This reverts commit aeeddc1435c37fa3fc844f31d39c185b08de4158, which was half-baked and broken. It just resulted in compile errors, since cpufreq_register_driver() still changes the 'driver_data' by setting bits in the flags field. So claiming it is 'const' _really_ doesn't work. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-26Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreqLinus Torvalds
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq: [CPUFREQ] constify some data tables. [CPUFREQ] constify cpufreq_driver where possible. {rd,wr}msr_on_cpu SMP=n optimization [CPUFREQ] cpufreq_ondemand.c: don't use _WORK_NAR rdmsr_on_cpu, wrmsr_on_cpu [CPUFREQ] Revert default on deprecated config X86_SPEEDSTEP_CENTRINO_ACPI
2007-02-22[CPUFREQ] constify cpufreq_driver where possible.Dave Jones
Not all cases are possible due to ->flags being set at runtime on some drivers. Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-20[CPUFREQ] cpufreq_ondemand.c: don't use _WORK_NAROleg Nesterov
Looks like dbs_timer() is very careful wrt per_cpu(cpu_dbs_info), and it doesn't need the help of WORK_STRUCT_NOAUTOREL. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Acked-By: David Howells <dhowells@redhat.com> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-16Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreqLinus Torvalds
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq: [CPUFREQ] Longhaul - Redo Longhaul ver. 2 [CPUFREQ] EPS - Correct 2nd brand test [CPUFREQ] Longhaul - Separate frequency and voltage transition [CPUFREQ] Longhaul - Models of Nehemiah [CPUFREQ] Whitespace fixup [CPUFREQ] Longhaul - Simplier minmult [CPUFREQ] CPU_FREQ_TABLE shouldn't be a def_tristate [CPUFREQ] ondemand governor use new cpufreq rwsem locking in work callback [CPUFREQ] ondemand governor restructure the work callback [CPUFREQ] Rewrite lock in cpufreq to eliminate cpufreq/hotplug related issues [CPUFREQ] Remove hotplug cpu crap [CPUFREQ] Enhanced PowerSaver driver [CPUFREQ] Longhaul - Add VT8235 support [CPUFREQ] Longhaul - Fix guess_fsb function [CPUFREQ] Longhaul - Remove duplicate tables [CPUFREQ] Longhaul - Introduce Nehemiah C [CPUFREQ] fix cpuinfo_cur_freq for CPU_HW_PSTATE [CPUFREQ] Longhaul - Remove "ignore_latency" option
2007-02-14[PATCH] remove many unneeded #includes of sched.hTim Schmielau
After Al Viro (finally) succeeded in removing the sched.h #include in module.h recently, it makes sense again to remove other superfluous sched.h includes. There are quite a lot of files which include it but don't actually need anything defined in there. Presumably these includes were once needed for macros that used to live in sched.h, but moved to other header files in the course of cleaning it up. To ease the pain, this time I did not fiddle with any header files and only removed #includes from .c-files, which tend to cause less trouble. Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha, arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig, allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all configs in arch/arm/configs on arm. I also checked that no new warnings were introduced by the patch (actually, some warnings are removed that were emitted by unnecessarily included header files). Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-10[CPUFREQ] Whitespace fixupDave Jones
Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-10[CPUFREQ] CPU_FREQ_TABLE shouldn't be a def_tristateAdrian Bunk
CPU_FREQ_TABLE enables helper code and gets select'ed when it's required. Building it as a module when it's not required doesn't seem to make much sense. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-10[CPUFREQ] ondemand governor use new cpufreq rwsem locking in work callbackVenkatesh Pallipadi
Eliminate flush_workqueue in cpufreq_governor(STOP) callpath. Using flush there has a deadlock potential as in http://uwsg.iu.edu/hypermail/linux/kernel/0611.3/1223.html Also, cleanup the locking issues with do_dbs_timer delayed_work callback. As it changes the CPU frequency using __cpufreq_target, it needs to have policy_rwsem in write mode, which also protects it from hot plug. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-10[CPUFREQ] ondemand governor restructure the work callbackVenkatesh Pallipadi
Restructure the delayed_work callback in ondemand. This eliminates the need for smp_processor_id in the callback function and also helps in proper locking and avoiding flush_workqueue when stopping the governor (done in subsequent patch). Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-10[CPUFREQ] Rewrite lock in cpufreq to eliminate cpufreq/hotplug related issuesVenkatesh Pallipadi
Yet another attempt to resolve cpufreq and hotplug locking issues. Patchset has 3 patches: * Rewrite the lock infrastructure of cpufreq using a per cpu rwsem. * Minor restructuring of work callback in ondemand driver. * Use the new cpufreq rwsem infrastructure in ondemand work. This patch: Convert policy->lock to rwsem and move it to per_cpu area. This rwsem will protect against both changing/accessing policy related parameters and CPU hot plug/unplug. [malattia@linux.it: fix oops in kref_put()] Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-02-10[CPUFREQ] Remove hotplug cpu crapDave Jones
The hotplug CPU locking in cpufreq is horrendous. No-one seems to care enough to fix it, so just remove it so that the 99.9% of the real world users of this code can use cpufreq without being bothered by warnings. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
2007-01-29[CPUFREQ] check sysfs_create_link return valueAhmed S. Darwish
Trivial patch to check sysfs_create_link return values. Fail gracefully if needed. Signed-off-by: Ahmed Darwish <darwish.07@gmail.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-12-22[CPUFREQ] Bug fix for acpi-cpufreq and cpufreq_stats oops on frequency ↵Venkatesh Pallipadi
change notification Fixes the oops in cpufreq_stats with acpi_cpufreq driver. The issue was that the frequency was reported as 0 in acpi-cpufreq.c. The bug is due to different indicies for freq_table and ACPI perf table. Also adds a check in cpufreq_stats to check for error return from freq_table_get_index() and avoid using the error return value. Patch fixes the issue reported at http://www.ussg.iu.edu/hypermail/linux/kernel/0611.2/0629.html and also other similar issue here http://bugme.osdl.org/show_bug.cgi?id=7383 comment 53 Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Jones <davej@redhat.com>
2006-12-13[CPUFREQ] fixes typo in cpufreq.cDhaval Giani
This patch fixes a typo in cpufreq.c From: Dhaval Giani <dhaval.giani@gmail.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-12-12Merge ../linusDave Jones
Conflicts: drivers/cpufreq/cpufreq.c
2006-12-07[PATCH] hotplug CPU: clean up hotcpu_notifier() useIngo Molnar
There was lots of #ifdef noise in the kernel due to hotcpu_notifier(fn, prio) not correctly marking 'fn' as used in the !HOTPLUG_CPU case, and thus generating compiler warnings of unused symbols, hence forcing people to add #ifdefs. the compiler can skip truly unused functions just fine: text data bss dec hex filename 1624412 728710 3674856 6027978 5bfaca vmlinux.before 1624412 728710 3674856 6027978 5bfaca vmlinux.after [akpm@osdl.org: topology.c fix] Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-22WorkStruct: make allyesconfigDavid Howells
Fix up for make allyesconfig. Signed-Off-By: David Howells <dhowells@redhat.com>
2006-11-22WorkStruct: Pass the work_struct pointer instead of context dataDavid Howells
Pass the work_struct pointer to the work function rather than context data. The work function can use container_of() to work out the data. For the cases where the container of the work_struct may go away the moment the pending bit is cleared, it is made possible to defer the release of the structure by deferring the clearing of the pending bit. To make this work, an extra flag is introduced into the management side of the work_struct. This governs auto-release of the structure upon execution. Ordinarily, the work queue executor would release the work_struct for further scheduling or deallocation by clearing the pending bit prior to jumping to the work function. This means that, unless the driver makes some guarantee itself that the work_struct won't go away, the work function may not access anything else in the work_struct or its container lest they be deallocated.. This is a problem if the auxiliary data is taken away (as done by the last patch). However, if the pending bit is *not* cleared before jumping to the work function, then the work function *may* access the work_struct and its container with no problems. But then the work function must itself release the work_struct by calling work_release(). In most cases, automatic release is fine, so this is the default. Special initiators exist for the non-auto-release case (ending in _NAR). Signed-Off-By: David Howells <dhowells@redhat.com>
2006-11-21[PATCH] Fix CPU_FREQ_GOV_ONDEMAND=y compile errorDave Jones
The ONDEMAND governor needs FREQ_TABLE Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-20Add "pure_initcall" for static variable initializationLinus Torvalds
This is a quick hack to overcome the fact that SRCU currently does not allow static initializers, and we need to sometimes initialize those things before any other initializers (even "core" ones) can do so. Currently we don't allow this at all for modules, and the only user that needs is right now is cpufreq. As reported by Thomas Gleixner: "Commit b4dfdbb3c707474a2254c5b4d7e62be31a4b7da9 ("[PATCH] cpufreq: make the transition_notifier chain use SRCU breaks cpu frequency notification users, which register the callback > on core_init level." Cc: Thomas Gleixner <tglx@timesys.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Arjan van de Ven <arjan@infradead.org> Cc: Andrew Morton <akpm@osdl.org>, Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-06[CPUFREQ] Fix coding style issues in cpufreq.Gautham R Shenoy
Clean up cpufreq subsystem to fix coding style issues and to improve the readability. Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-10-21[CPUFREQ] handle sysfs errorsJeff Garzik
Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Jones <davej@redhat.com>
2006-10-15[CPUFREQ][8/8] acpi-cpufreq: Add support for freq feedback from hardwareVenkatesh Pallipadi
Enable ondemand governor and acpi-cpufreq to use IA32_APERF and IA32_MPERF MSR to get active frequency feedback for the last sampling interval. This will make ondemand take right frequency decisions when hardware coordination of frequency is going on. Without APERF/MPERF, ondemand can take wrong decision at times due to underlying hardware coordination or TM2. Example: * CPU 0 and CPU 1 are hardware cooridnated. * CPU 1 running at highest frequency. * CPU 0 was running at highest freq. Now ondemand reduces it to some intermediate frequency based on utilization. * Due to underlying hardware coordination with other CPU 1, CPU 0 continues to run at highest frequency (as long as other CPU is at highest). * When ondemand samples CPU 0 again next time, without actual frequency feedback from APERF/MPERF, it will think that previous frequency change was successful and can go to wrong target frequency. This is because it thinks that utilization it has got this sampling interval is when running at intermediate frequency, rather than actual highest frequency. More information about IA32_APERF IA32_MPERF MSR: Refer to IA-32 Intel® Architecture Software Developer's Manual at http://developer.intel.com Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
2006-10-04[PATCH] cpufreq: make the transition_notifier chain use SRCUAlan Stern
This patch (as762) changes the cpufreq_transition_notifier_list from a blocking_notifier_head to an srcu_notifier_head. This will prevent errors caused attempting to call down_read() to access the notifier chain at a time when interrupts must remain disabled, during system suspend. It's not clear to me whether this is really necessary; perhaps the chain could be made into an atomic_notifier. However a couple of the callout routines do use blocking operations, so this approach seems safer. The head of the notifier chain needs to be initialized before use; this is done by an __init routine at core_initcall time. If this turns out not to be a good choice, it can easily be changed. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: "Paul E. McKenney" <paulmck@us.ibm.com> Cc: Jesse Brandeburg <jesse.brandeburg@gmail.com> Cc: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-26[CPUFREQ] Fix cut-n-paste bug in suspend printkDave Jones
Signed-off-by: Dave Jones <davej@redhat.com>
2006-09-22[CPUFREQ] Fix some more CPU hotplug locking.Dave Jones
Lukewarm IQ detected in hotplug locking BUG: warning at kernel/cpu.c:38/lock_cpu_hotplug() [<b0134a42>] lock_cpu_hotplug+0x42/0x65 [<b02f8af1>] cpufreq_update_policy+0x25/0xad [<b0358756>] kprobe_flush_task+0x18/0x40 [<b0355aab>] schedule+0x63f/0x68b [<b01377c2>] __link_module+0x0/0x1f [<b0119e7d>] __cond_resched+0x16/0x34 [<b03560bf>] cond_resched+0x26/0x31 [<b0355b0e>] wait_for_completion+0x17/0xb1 [<f965c547>] cpufreq_stat_cpu_callback+0x13/0x20 [cpufreq_stats] [<f9670074>] cpufreq_stats_init+0x74/0x8b [cpufreq_stats] [<b0137872>] sys_init_module+0x91/0x174 [<b0102c81>] sysenter_past_esp+0x56/0x79 As there are other places that call cpufreq_update_policy without the hotplug lock, it seems better to keep the hotplug locking at the lower level for the time being until this is revamped. Signed-off-by: Dave Jones <davej@redhat.com>
2006-09-05[CPUFREQ] Fix sparse warning in ondemandDave Jones
drivers/cpufreq/cpufreq_ondemand.c:323:2: warning: Using plain integer as NULL pointer Signed-off-by: Dave Jones <davej@redhat.com>
2006-08-14[CPUFREQ] make drivers/cpufreq/cpufreq_ondemand.c:powersave_bias_target() staticAdrian Bunk
This patch makes the needlessly global powersave_bias_target() static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Dave Jones <davej@redhat.com>