<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/cpufreq/cpufreq.c, branch linux-3.6.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.6.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.6.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-07-20T19:39:25Z</updated>
<entry>
<title>cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch</title>
<updated>2012-07-20T19:39:25Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2012-07-20T18:14:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a9144436271583115a2230db15d0b6ae2c481d3c'/>
<id>urn:sha1:a9144436271583115a2230db15d0b6ae2c481d3c</id>
<content type='text'>
Running one program that continuously hotplugs and replugs a cpu
concurrently with another program that continuously writes to the
scaling_setspeed node eventually deadlocks with:

=============================================
[ INFO: possible recursive locking detected ]
3.4.0 #37 Tainted: G        W
---------------------------------------------
filemonkey/122 is trying to acquire lock:
 (s_active#13){++++.+}, at: [&lt;c01a3d28&gt;] sysfs_remove_dir+0x9c/0xb4

but task is already holding lock:
 (s_active#13){++++.+}, at: [&lt;c01a22f0&gt;] sysfs_write_file+0xe8/0x140

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(s_active#13);
  lock(s_active#13);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by filemonkey/122:
 #0:  (&amp;buffer-&gt;mutex){+.+.+.}, at: [&lt;c01a2230&gt;] sysfs_write_file+0x28/0x140
 #1:  (s_active#13){++++.+}, at: [&lt;c01a22f0&gt;] sysfs_write_file+0xe8/0x140

stack backtrace:
[&lt;c0014fcc&gt;] (unwind_backtrace+0x0/0x120) from [&lt;c00ca600&gt;] (validate_chain+0x6f8/0x1054)
[&lt;c00ca600&gt;] (validate_chain+0x6f8/0x1054) from [&lt;c00cb778&gt;] (__lock_acquire+0x81c/0x8d8)
[&lt;c00cb778&gt;] (__lock_acquire+0x81c/0x8d8) from [&lt;c00cb9c0&gt;] (lock_acquire+0x18c/0x1e8)
[&lt;c00cb9c0&gt;] (lock_acquire+0x18c/0x1e8) from [&lt;c01a3ba8&gt;] (sysfs_addrm_finish+0xd0/0x180)
[&lt;c01a3ba8&gt;] (sysfs_addrm_finish+0xd0/0x180) from [&lt;c01a3d28&gt;] (sysfs_remove_dir+0x9c/0xb4)
[&lt;c01a3d28&gt;] (sysfs_remove_dir+0x9c/0xb4) from [&lt;c02d0e5c&gt;] (kobject_del+0x10/0x38)
[&lt;c02d0e5c&gt;] (kobject_del+0x10/0x38) from [&lt;c02d0f74&gt;] (kobject_release+0xf0/0x194)
[&lt;c02d0f74&gt;] (kobject_release+0xf0/0x194) from [&lt;c0565a98&gt;] (cpufreq_cpu_put+0xc/0x24)
[&lt;c0565a98&gt;] (cpufreq_cpu_put+0xc/0x24) from [&lt;c05683f0&gt;] (store+0x6c/0x74)
[&lt;c05683f0&gt;] (store+0x6c/0x74) from [&lt;c01a2314&gt;] (sysfs_write_file+0x10c/0x140)
[&lt;c01a2314&gt;] (sysfs_write_file+0x10c/0x140) from [&lt;c014af44&gt;] (vfs_write+0xb0/0x128)
[&lt;c014af44&gt;] (vfs_write+0xb0/0x128) from [&lt;c014b06c&gt;] (sys_write+0x3c/0x68)
[&lt;c014b06c&gt;] (sys_write+0x3c/0x68) from [&lt;c000e0e0&gt;] (ret_fast_syscall+0x0/0x3c)

This is because store() in cpufreq.c indirectly calls
kobject_get() via cpufreq_cpu_get() and is the last one to call
kobject_put() via cpufreq_cpu_put(). Sysfs code should not call
kobject_get() or kobject_put() directly (see the comment around
sysfs_schedule_callback() for more information).

Fix this deadlock by introducing two new functions:

	struct cpufreq_policy *cpufreq_cpu_get_sysfs(unsigned int cpu)
	void cpufreq_cpu_put_sysfs(struct cpufreq_policy *data)

which do the same thing as cpufreq_cpu_{get,put}() but don't call
kobject functions.

To easily trigger this deadlock you can insert an msleep() with a
reasonably large value right after the fail label at the bottom
of the store() function in cpufreq.c and then write
scaling_setspeed in one task and offline the cpu in another. The
first task will hang and be detected by the hung task detector.

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>provide disable_cpufreq() function to disable the API.</title>
<updated>2012-03-14T18:45:03Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
</author>
<published>2012-03-13T23:18:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7b422cda5084db7265c3b23310a959b43b47529'/>
<id>urn:sha1:a7b422cda5084db7265c3b23310a959b43b47529</id>
<content type='text'>
useful for disabling cpufreq altogether. The cpu frequency
scaling drivers and cpu frequency governors will fail to register.

Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq</title>
<updated>2012-01-12T02:53:33Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2012-01-12T02:53:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02d929502ce7b57f4835d8bb7c828d36e6d9e8ce'/>
<id>urn:sha1:02d929502ce7b57f4835d8bb7c828d36e6d9e8ce</id>
<content type='text'>
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq: (23 commits)
  [CPUFREQ] EXYNOS: Removed useless headers and codes
  [CPUFREQ] EXYNOS: Make EXYNOS common cpufreq driver
  [CPUFREQ] powernow-k8: Update copyright, maintainer and documentation information
  [CPUFREQ] powernow-k8: Fix indexing issue
  [CPUFREQ] powernow-k8: Avoid Pstate MSR accesses on systems supporting CPB
  [CPUFREQ] update lpj only if frequency has changed
  [CPUFREQ] cpufreq:userspace: fix cpu_cur_freq updation
  [CPUFREQ] Remove wall variable from cpufreq_gov_dbs_init()
  [CPUFREQ] EXYNOS4210: cpufreq code is changed for stable working
  [CPUFREQ] EXYNOS4210: Update frequency table for cpu divider
  [CPUFREQ] EXYNOS4210: Remove code about bus on cpufreq
  [CPUFREQ] s3c64xx: Use pr_fmt() for consistent log messages
  cpufreq: OMAP: fixup for omap_device changes, include &lt;linux/module.h&gt;
  cpufreq: OMAP: fix freq_table leak
  cpufreq: OMAP: put clk if cpu_init failed
  cpufreq: OMAP: only supports OPP library
  cpufreq: OMAP: dont support !freq_table
  cpufreq: OMAP: deny initialization if no mpudev
  cpufreq: OMAP: move clk name decision to init
  cpufreq: OMAP: notify even with bad boot frequency
  ...
</content>
</entry>
<entry>
<title>[CPUFREQ] update lpj only if frequency has changed</title>
<updated>2012-01-06T15:10:53Z</updated>
<author>
<name>Afzal Mohammed</name>
</author>
<published>2012-01-04T05:22:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d08de0c19c3fc5b9cf557ce3b42795d036ad5da9'/>
<id>urn:sha1:d08de0c19c3fc5b9cf557ce3b42795d036ad5da9</id>
<content type='text'>
During scaling up of cpu frequency, loops_per_jiffy
is updated upon invoking PRECHANGE notifier.
If setting to new frequency fails in cpufreq driver,
lpj is left at incorrect value.

Hence update lpj only if cpu frequency is changed,
i.e. upon invoking POSTCHANGE notifier.

Penalty would be that during time period between
changing cpu frequency &amp; invocation of POSTCHANGE
notifier, udelay(x) may not gurantee minimal delay
of 'x' us for frequency scaling up operation.

Perhaps a better solution would be to define
CPUFREQ_ABORTCHANGE &amp; handle accordingly, but then
it would be more intrusive (using ABORTCHANGE may
help drivers also; if any has registered notifier
and expect POST for a PRECHANGE, their needs can
be taken care using ABORT)

Signed-off-by: Afzal Mohammed &lt;afzal@ti.com&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
</content>
</entry>
<entry>
<title>cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem</title>
<updated>2011-12-21T22:29:42Z</updated>
<author>
<name>Kay Sievers</name>
</author>
<published>2011-12-21T22:29:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a25a2fd126c621f44f3aeaef80d51f00fc11639'/>
<id>urn:sha1:8a25a2fd126c621f44f3aeaef80d51f00fc11639</id>
<content type='text'>
This moves the 'cpu sysdev_class' over to a regular 'cpu' subsystem
and converts the devices to regular devices. The sysdev drivers are
implemented as subsystem interfaces now.

After all sysdev classes are ported to regular driver core entities, the
sysdev implementation will be entirely removed from the kernel.

Userspace relies on events and generic sysfs subsystem infrastructure
from sysdev devices, which are made available with this conversion.

Cc: Haavard Skinnemoen &lt;hskinnemoen@gmail.com&gt;
Cc: Hans-Christian Egtvedt &lt;egtvedt@samfundet.no&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Paul Mundt &lt;lethal@linux-sh.org&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Chris Metcalf &lt;cmetcalf@tilera.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Borislav Petkov &lt;bp@amd64.org&gt;
Cc: Tigran Aivazian &lt;tigran@aivazian.fsnet.co.uk&gt;
Cc: Len Brown &lt;lenb@kernel.org&gt;
Cc: Zhang Rui &lt;rui.zhang@intel.com&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Cc: "Srivatsa S. Bhat" &lt;srivatsa.bhat@linux.vnet.ibm.com&gt;
Signed-off-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>cpufreq: expose a cpufreq_quick_get_max routine</title>
<updated>2011-06-28T20:54:26Z</updated>
<author>
<name>Jesse Barnes</name>
</author>
<published>2011-06-28T17:59:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d73710880afa3d61cf57b5d4eb192e812eb7e4f'/>
<id>urn:sha1:3d73710880afa3d61cf57b5d4eb192e812eb7e4f</id>
<content type='text'>
This allows drivers and other code to get the max reported CPU frequency.
Initial use is for scaling ring frequency with GPU frequency in the i915
driver.

Signed-off-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Signed-off-by: Keith Packard &lt;keithp@keithp.com&gt;
</content>
</entry>
<entry>
<title>[CPUFREQ] remove redundant sprintf from request_module call.</title>
<updated>2011-05-04T15:50:58Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2011-05-04T15:38:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a8e1463a49aaa452da1cefe184a00d4df47f1ef'/>
<id>urn:sha1:1a8e1463a49aaa452da1cefe184a00d4df47f1ef</id>
<content type='text'>
Since format string handling is part of request_module, there is no
need to construct the module name. As such, drop the redundant sprintf
and heap usage.

Signed-off-by: Kees Cook &lt;kees.cook@canonical.com&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
</content>
</entry>
<entry>
<title>[CPUFREQ] use dynamic debug instead of custom infrastructure</title>
<updated>2011-05-04T15:50:57Z</updated>
<author>
<name>Dominik Brodowski</name>
</author>
<published>2011-03-27T13:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2d06d8c49afdcc9bb35a85039fa50f0fe35bd40e'/>
<id>urn:sha1:2d06d8c49afdcc9bb35a85039fa50f0fe35bd40e</id>
<content type='text'>
With dynamic debug having gained the capability to report debug messages
also during the boot process, it offers a far superior interface for
debug messages than the custom cpufreq infrastructure. As a first step,
remove the old cpufreq_debug_printk() function and replace it with a call
to the generic pr_debug() function.

How can dynamic debug be used on cpufreq? You need a kernel which has
CONFIG_DYNAMIC_DEBUG enabled.

To enabled debugging during runtime, mount debugfs and

$ echo -n 'module cpufreq +p' &gt; /sys/kernel/debug/dynamic_debug/control

for debugging the complete "cpufreq" module. To achieve the same goal during
boot, append

	ddebug_query="module cpufreq +p"

as a boot parameter to the kernel of your choice.

For more detailled instructions, please see
Documentation/dynamic-debug-howto.txt

Signed-off-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
</content>
</entry>
<entry>
<title>[CPUFREQ] CPU hotplug, re-create sysfs directory and symlinks</title>
<updated>2011-05-04T15:50:57Z</updated>
<author>
<name>Jacob Shin</name>
</author>
<published>2011-04-27T18:32:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=27ecddc2a9f99ce4ac9a59a0acd77f7100b6d034'/>
<id>urn:sha1:27ecddc2a9f99ce4ac9a59a0acd77f7100b6d034</id>
<content type='text'>
When we discover CPUs that are affected by each other's
frequency/voltage transitions, the first CPU gets a sysfs directory
created, and rest of the siblings get symlinks. Currently, when we
hotplug off only the first CPU, all of the symlinks and the sysfs
directory gets removed. Even though rest of the siblings are still
online and functional, they are orphaned, and no longer governed by
cpufreq.

This patch, given the above scenario, creates a sysfs directory for
the first sibling and symlinks for the rest of the siblings.

Please note the recursive call, it was rather too ugly to roll it
out. And the removal of redundant NULL setting (it is already taken
care of near the top of the function).

Signed-off-by: Jacob Shin &lt;jacob.shin@amd.com&gt;
Acked-by: Mark Langsdorf &lt;mark.langsdorf@amd.com&gt;
Reviewed-by: Thomas Renninger &lt;trenn@suse.de&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>Fix common misspellings</title>
<updated>2011-03-31T14:26:23Z</updated>
<author>
<name>Lucas De Marchi</name>
</author>
<published>2011-03-31T01:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=25985edcedea6396277003854657b5f3cb31a628'/>
<id>urn:sha1:25985edcedea6396277003854657b5f3cb31a628</id>
<content type='text'>
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
</content>
</entry>
</feed>
