<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/cpufreq, branch v3.0.86</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/cpufreq?h=v3.0.86</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/cpufreq?h=v3.0.86'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-03-14T18:32:06Z</updated>
<entry>
<title>Fix memory leak in cpufreq stats.</title>
<updated>2013-03-14T18:32:06Z</updated>
<author>
<name>Tu, Xiaobing</name>
<email>xiaobing.tu@intel.com</email>
</author>
<published>2012-10-22T23:03:00Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=eb868f2c44b556ddea6a88e0a1a70945364e0ee1'/>
<id>urn:sha1:eb868f2c44b556ddea6a88e0a1a70945364e0ee1</id>
<content type='text'>
commit e37736777254ce1abc85493a5cacbefe5983b896 upstream.

When system enters sleep, non-boot CPUs will be disabled.
Cpufreq stats sysfs is created when the CPU is up, but it is not
freed when the CPU is going down. This will cause memory leak.

Signed-off-by: xiaobing tu &lt;xiaobing.tu@intel.com&gt;
Signed-off-by: guifang tang &lt;guifang.tang@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Cc: Colin Cross &lt;ccross@google.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible code</title>
<updated>2012-10-31T16:51:37Z</updated>
<author>
<name>Andreas Herrmann</name>
<email>andreas.herrmann3@amd.com</email>
</author>
<published>2012-10-22T22:55:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=eccd54a6c29b2ddce3e03e7f77b89376dd9ee1ca'/>
<id>urn:sha1:eccd54a6c29b2ddce3e03e7f77b89376dd9ee1ca</id>
<content type='text'>
commit e4df1cbcc1f329e53a1fff7450b2229e0addff20 upstream.

Commit 6889125b8b4e09c5e53e6ecab3433bed1ce198c9
(cpufreq/powernow-k8: workqueue user shouldn't migrate the kworker to another CPU)
causes powernow-k8 to trigger a preempt warning, e.g.:

  BUG: using smp_processor_id() in preemptible [00000000] code: cpufreq/3776
  caller is powernowk8_target+0x20/0x49
  Pid: 3776, comm: cpufreq Not tainted 3.6.0 #9
  Call Trace:
   [&lt;ffffffff8125b447&gt;] debug_smp_processor_id+0xc7/0xe0
   [&lt;ffffffff814877e7&gt;] powernowk8_target+0x20/0x49
   [&lt;ffffffff81482b02&gt;] __cpufreq_driver_target+0x82/0x8a
   [&lt;ffffffff81484fc6&gt;] cpufreq_governor_performance+0x4e/0x54
   [&lt;ffffffff81482c50&gt;] __cpufreq_governor+0x8c/0xc9
   [&lt;ffffffff81482e6f&gt;] __cpufreq_set_policy+0x1a9/0x21e
   [&lt;ffffffff814839af&gt;] store_scaling_governor+0x16f/0x19b
   [&lt;ffffffff81484f16&gt;] ? cpufreq_update_policy+0x124/0x124
   [&lt;ffffffff8162b4a5&gt;] ? _raw_spin_unlock_irqrestore+0x2c/0x49
   [&lt;ffffffff81483640&gt;] store+0x60/0x88
   [&lt;ffffffff811708c0&gt;] sysfs_write_file+0xf4/0x130
   [&lt;ffffffff8111243b&gt;] vfs_write+0xb5/0x151
   [&lt;ffffffff811126e0&gt;] sys_write+0x4a/0x71
   [&lt;ffffffff816319a9&gt;] system_call_fastpath+0x16/0x1b

Fix this by by always using work_on_cpu().

Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>cpufreq/powernow-k8: workqueue user shouldn't migrate the kworker to another CPU</title>
<updated>2012-10-02T16:47:22Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-09-18T21:24:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4b1785ad00ad1b809a4a224499ed605f2eb516fa'/>
<id>urn:sha1:4b1785ad00ad1b809a4a224499ed605f2eb516fa</id>
<content type='text'>
commit 6889125b8b4e09c5e53e6ecab3433bed1ce198c9 upstream.

powernowk8_target() runs off a per-cpu work item and if the
cpufreq_policy-&gt;cpu is different from the current one, it migrates the
kworker to the target CPU by manipulating current-&gt;cpus_allowed.  The
function migrates the kworker back to the original CPU but this is
still broken.  Workqueue concurrency management requires the kworkers
to stay on the same CPU and powernowk8_target() ends up triggerring
BUG_ON(rq != this_rq()) in try_to_wake_up_local() if it contends on
fidvid_mutex and sleeps.

It is unclear why this bug is being reported now.  Duncan says it
appeared to be a regression of 3.6-rc1 and couldn't reproduce it on
3.5.  Bisection seemed to point to 63d95a91 "workqueue: use @pool
instead of @gcwq or @cpu where applicable" which is an non-functional
change.  Given that the reproduce case sometimes took upto days to
trigger, it's easy to be misled while bisecting.  Maybe something made
contention on fidvid_mutex more likely?  I don't know.

This patch fixes the bug by using work_on_cpu() instead if @pol-&gt;cpu
isn't the same as the current one.  The code assumes that
cpufreq_policy-&gt;cpu is kept online by the caller, which Rafael tells
me is the case.

stable: ed48ece27c ("workqueue: reimplement work_on_cpu() using
        system_wq") should be applied before this; otherwise, the
        behavior could be horrible.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Duncan &lt;1i5t5.duncan@cox.net&gt;
Tested-by: Duncan &lt;1i5t5.duncan@cox.net&gt;
Cc: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Cc: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt;
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47301
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>powernow-k8: Fix indexing issue</title>
<updated>2012-02-13T19:06:13Z</updated>
<author>
<name>Andreas Herrmann</name>
<email>andreas.herrmann3@amd.com</email>
</author>
<published>2012-01-06T14:57:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=323a479328cbc2fb5cf647790f7414ca570a577b'/>
<id>urn:sha1:323a479328cbc2fb5cf647790f7414ca570a577b</id>
<content type='text'>
commit a8eb28480e9b637cc78b9aa5e08612ba97e1317a upstream.

The driver uses the pstate number from the status register as index in
its table of ACPI pstates (powernow_table). This is wrong as this is
not a 1-to-1 mapping.

For example we can have _PSS information to just utilize Pstate 0 and
Pstate 4, ie.

  powernow-k8: Core Performance Boosting: on.
  powernow-k8:    0 : pstate 0 (2200 MHz)
  powernow-k8:    1 : pstate 4 (1400 MHz)

In this example the driver's powernow_table has just 2 entries. Using
the pstate number (4) as index into this table is just plain wrong.

Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>powernow-k8: Avoid Pstate MSR accesses on systems supporting CPB</title>
<updated>2012-02-13T19:06:13Z</updated>
<author>
<name>Andreas Herrmann</name>
<email>andreas.herrmann3@amd.com</email>
</author>
<published>2012-01-06T14:56:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2d8a3a209b35f8301c86e7962f636a372a0d7cad'/>
<id>urn:sha1:2d8a3a209b35f8301c86e7962f636a372a0d7cad</id>
<content type='text'>
commit 201bf0f129e1715a33568d1563d9a75b840ab4d3 upstream.

Due to CPB we can't directly map SW Pstates to Pstate MSRs. Get rid of
the paranoia check. (assuming that the ACPI Pstate information is
correct.)

Signed-off-by: Andreas Herrmann &lt;andreas.herrmann3@amd.com&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drivers/cpufreq/pcc-cpufreq.c: avoid NULL pointer dereference</title>
<updated>2011-10-03T18:40:31Z</updated>
<author>
<name>Naga Chumbalkar</name>
<email>nagananda.chumbalkar@hp.com</email>
</author>
<published>2011-09-14T23:22:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c780713f786ee22532839502ed35f1bd1cb0fd1d'/>
<id>urn:sha1:c780713f786ee22532839502ed35f1bd1cb0fd1d</id>
<content type='text'>
commit e71f5cc402ecb42b407ae52add7b173bf1c53daa upstream.

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: [&lt;ffffffffa0434314&gt;] 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 &lt;nagananda.chumbalkar@hp.com&gt;
Cc: Dave Jones &lt;davej@codemonkey.org.uk&gt;
Cc: Len Brown &lt;lenb@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>[CPUFREQ] fix cpumask memory leak in acpi-cpufreq on cpu hotplug.</title>
<updated>2011-07-10T21:03:04Z</updated>
<author>
<name>Luming Yu</name>
<email>luming.yu@gmail.com</email>
</author>
<published>2011-07-08T20:37:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=50f4ddd4ff713d2599e2f246775fe2206090126e'/>
<id>urn:sha1:50f4ddd4ff713d2599e2f246775fe2206090126e</id>
<content type='text'>
I came across a memory leak during a cyclic cpu-online-offline test.

Signed-off-by: Yu Luming &lt;luming.yu@intel.com&gt;
Cc: Len Brown &lt;lenb@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
</content>
</entry>
<entry>
<title>[CPUFREQ] powernow-k8: Don't try to transition if the pstate is incorrect</title>
<updated>2011-06-16T20:31:13Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
<email>konrad.wilk@oracle.com</email>
</author>
<published>2011-06-16T19:36:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fbb5b89eabea5ae7d621b7861863159560d8faa4'/>
<id>urn:sha1:fbb5b89eabea5ae7d621b7861863159560d8faa4</id>
<content type='text'>
This patch augments the pstate transition code to error out
(instead of returning 0) when an incorrect pstate is provided.

Suggested-by: Borislav Petkov &lt;bp@alien8.de&gt;
CC: andre.przywara@amd.com
CC: Mark.Langsdorf@amd.com
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>[CPUFREQ] powernow-k8: Don't notify of successful transition if we failed (vid case).</title>
<updated>2011-06-16T20:31:13Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
<email>konrad.wilk@oracle.com</email>
</author>
<published>2011-06-16T19:36:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a9d3d2068064b7a6395871a49616d3784f802d50'/>
<id>urn:sha1:a9d3d2068064b7a6395871a49616d3784f802d50</id>
<content type='text'>
Before this patch if we failed the vid transition would still try to
submit the "new" frequencies to cpufreq.
That is incorrect - also we could submit a non-existing frequency value
which would cause cpufreq to crash. The ultimate fix is in cpufreq
to deal with incorrect values, but this patch improves the error
recovery in the AMD powernowk8 driver.

The failure that was reported was as follows:

powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3700+ (1 cpu cores) (version 2.20.00)
powernow-k8: fid 0x2 (1000 MHz), vid 0x12
powernow-k8: fid 0xa (1800 MHz), vid 0xa
powernow-k8: fid 0xc (2000 MHz), vid 0x8
powernow-k8: fid 0xe (2200 MHz), vid 0x8
Marking TSC unstable due to cpufreq changes
powernow-k8: fid trans failed, fid 0x2, curr 0x0
BUG: unable to handle kernel paging request at ffff880807e07b78
IP: [&lt;ffffffff81479163&gt;] cpufreq_stats_update+0x46/0x5b
...

And transition fails and data-&gt;currfid ends up with 0. Since
the machine does not support 800Mhz value when the calculation is
done ('find_khz_freq_from_fid(data-&gt;currfid);') it reports the
new frequency as 800000 which is bogus. This patch fixes
the issue during target setting.

The patch however does not fix the issue in 'powernowk8_cpu_init'
where the pol-&gt;cur can also be set with the 800000 value:

          pol-&gt;cur = find_khz_freq_from_fid(data-&gt;currfid);
  dprintk("policy current frequency %d kHz\n", pol-&gt;cur);

  /* min/max the cpu is capable of */
  if (cpufreq_frequency_table_cpuinfo(pol, data-&gt;powernow_table)) {

The fix for that looks to update cpufreq_frequency_table_cpuinfo to
check pol-&gt;cur.... but that would cause an regression in how the
acpi-cpufreq driver works (it sets cpu-&gt;cur after calling
cpufreq_frequency_table_cpuinfo). Instead the fix will be to let
cpufreq gracefully handle bogus data (another patch).

Acked-by: Borislav Petkov &lt;bp@alien8.de&gt;
CC: andre.przywara@amd.com
CC: Mark.Langsdorf@amd.com
Reported-by: Tobias Diedrich &lt;ranma+xen@tdiedrich.de&gt;
Tested-by: Tobias Diedrich &lt;ranma+xen@tdiedrich.de&gt;
[v1: Rebased on v3.0-rc2, reduced patch to deal with vid case]
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>[CPUFREQ] Don't set stat-&gt;last_index to -1 if the pol-&gt;cur has incorrect value.</title>
<updated>2011-06-16T20:31:12Z</updated>
<author>
<name>Konrad Rzeszutek Wilk</name>
<email>konrad.wilk@oracle.com</email>
</author>
<published>2011-06-16T19:36:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=46a310b80bc2c9ccc019649c9da91194cbc10944'/>
<id>urn:sha1:46a310b80bc2c9ccc019649c9da91194cbc10944</id>
<content type='text'>
If the driver submitted an non-existing pol&gt;cur value (say it
used the default initialized value of zero), when the cpufreq
stats tries to setup its initial values it incorrectly sets
stat-&gt;last_index to -1 (or 0xfffff...). And cpufreq_stats_update
tries to update at that index location and fails.

This can be caused by:

stat-&gt;last_index = freq_table_get_index(stat, policy-&gt;cur);

not finding the appropiate frequency in the table (b/c the policy-&gt;cur
is wrong) and we end up crashing. The fix however is
concentrated in the 'cpufreq_stats_update' as the last_index
(and old_index) are updated there. Which means it can reset
the last_index to -1 again and on the next iteration cause a crash.

Without this patch, the following crash is observed:

powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3700+ (1 cpu cores) (version 2.20.00)
powernow-k8: fid 0x2 (1000 MHz), vid 0x12
powernow-k8: fid 0xa (1800 MHz), vid 0xa
powernow-k8: fid 0xc (2000 MHz), vid 0x8
powernow-k8: fid 0xe (2200 MHz), vid 0x8
Marking TSC unstable due to cpufreq changes
powernow-k8: fid trans failed, fid 0x2, curr 0x0
BUG: unable to handle kernel paging request at ffff880807e07b78
IP: [&lt;ffffffff81479163&gt;] cpufreq_stats_update+0x46/0x5b
.. snip..
Pid: 1, comm: swapper Not tainted 3.0.0-rc2 #45 MICRO-STAR INTERNATIONAL CO., LTD MS-7094/MS-7094
..snip..
Call Trace:
 [&lt;ffffffff81479248&gt;] cpufreq_stat_notifier_trans+0x48/0x7c
 [&lt;ffffffff81095d68&gt;] notifier_call_chain+0x32/0x5e
 [&lt;ffffffff81095e6b&gt;] __srcu_notifier_call_chain+0x47/0x63
 [&lt;ffffffff81095e96&gt;] srcu_notifier_call_chain+0xf/0x11
 [&lt;ffffffff81477e7a&gt;] cpufreq_notify_transition+0x111/0x134
 [&lt;ffffffff8147b0d4&gt;] powernowk8_target+0x53b/0x617
 [&lt;ffffffff8147723a&gt;] __cpufreq_driver_target+0x2e/0x30
 [&lt;ffffffff8147a127&gt;] cpufreq_governor_dbs+0x339/0x356
 [&lt;ffffffff81477394&gt;] __cpufreq_governor+0xa8/0xe9
 [&lt;ffffffff81477525&gt;] __cpufreq_set_policy+0x132/0x13e
 [&lt;ffffffff8147848d&gt;] cpufreq_add_dev_interface+0x272/0x28c

Reported-by: Tobias Diedrich &lt;ranma+xen@tdiedrich.de&gt;
Tested-by: Tobias Diedrich &lt;ranma+xen@tdiedrich.de&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
</content>
</entry>
</feed>
