<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/cpufreq, branch v3.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-09-30T19:02:34Z</updated>
<entry>
<title>cpufreq: update 'cpufreq_suspended' after stopping governors</title>
<updated>2014-09-30T19:02:34Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2014-09-30T04:03:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b1b12babe3b72cfb08b875245e5a5d7c2747c772'/>
<id>urn:sha1:b1b12babe3b72cfb08b875245e5a5d7c2747c772</id>
<content type='text'>
Commit 8e30444e1530 ("cpufreq: fix cpufreq suspend/resume for intel_pstate")
introduced a bug where the governors wouldn't be stopped anymore for
-&gt;target{_index}() drivers during suspend. This happens because
'cpufreq_suspended' is updated before stopping the governors during suspend
and due to this __cpufreq_governor() would return early due to this check:

	/* Don't start any governor operations if we are entering suspend */
	if (cpufreq_suspended)
		return 0;

Fixes: 8e30444e1530 ("cpufreq: fix cpufreq suspend/resume for intel_pstate")
Cc: 3.15+ &lt;stable@vger.kernel.org&gt; # 3.15+: 8e30444e1530 "cpufreq: fix cpufreq suspend/resume for intel_pstate"
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: integrator: fix integrator_cpufreq_remove return type</title>
<updated>2014-09-29T13:36:03Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2014-09-26T20:19:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d62dbf77f7dfaa6fb455b4b9828069a11965929c'/>
<id>urn:sha1:d62dbf77f7dfaa6fb455b4b9828069a11965929c</id>
<content type='text'>
When building this driver as a module, we get a helpful warning
about the return type:

drivers/cpufreq/integrator-cpufreq.c:232:2: warning: initialization from incompatible pointer type
  .remove = __exit_p(integrator_cpufreq_remove),

If the remove callback returns void, the caller gets an undefined
value as it expects an integer to be returned. This fixes the
problem by passing down the value from cpufreq_unregister_driver.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: All applicable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: pcc-cpufreq: Fix wait_event() under spinlock</title>
<updated>2014-09-29T13:35:50Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2014-09-27T19:56:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e65b5ddba84634f31d42dfd86013f4c6be5e9e32'/>
<id>urn:sha1:e65b5ddba84634f31d42dfd86013f4c6be5e9e32</id>
<content type='text'>
Fix the following bug introduced by commit 8fec051eea73 (cpufreq:
Convert existing drivers to use cpufreq_freq_transition_{begin|end})
that forgot to move the spin_lock() in pcc_cpufreq_target() past
cpufreq_freq_transition_begin() which calls wait_event():

BUG: sleeping function called from invalid context at drivers/cpufreq/cpufreq.c:370
in_atomic(): 1, irqs_disabled(): 0, pid: 2636, name: modprobe
Preemption disabled at:[&lt;ffffffffa04d74d7&gt;] pcc_cpufreq_target+0x27/0x200 [pcc_cpufreq]
[   51.025044]
CPU: 57 PID: 2636 Comm: modprobe Tainted: G            E  3.17.0-default #7
Hardware name: Hewlett-Packard ProLiant DL980 G7, BIOS P66 07/07/2010
 00000000ffffffff ffff88026c46b828 ffffffff81589dbd 0000000000000000
 ffff880037978090 ffff88026c46b848 ffffffff8108e1df ffff880037978090
 0000000000000000 ffff88026c46b878 ffffffff8108e298 ffff88026d73ec00
Call Trace:
 [&lt;ffffffff81589dbd&gt;] dump_stack+0x4d/0x90
 [&lt;ffffffff8108e1df&gt;] ___might_sleep+0x10f/0x180
 [&lt;ffffffff8108e298&gt;] __might_sleep+0x48/0xd0
 [&lt;ffffffff8145b905&gt;] cpufreq_freq_transition_begin+0x75/0x140 drivers/cpufreq/cpufreq.c:370 wait_event(policy-&gt;transition_wait, !policy-&gt;transition_ongoing);
 [&lt;ffffffff8108fc99&gt;] ? preempt_count_add+0xb9/0xc0
 [&lt;ffffffffa04d7513&gt;] pcc_cpufreq_target+0x63/0x200 [pcc_cpufreq] drivers/cpufreq/pcc-cpufreq.c:207 spin_lock(&amp;pcc_lock);
 [&lt;ffffffff810e0d0f&gt;] ? update_ts_time_stats+0x7f/0xb0
 [&lt;ffffffff8145be55&gt;] __cpufreq_driver_target+0x85/0x170
 [&lt;ffffffff8145e4c8&gt;] od_check_cpu+0xa8/0xb0
 [&lt;ffffffff8145ef10&gt;] dbs_check_cpu+0x180/0x1d0
 [&lt;ffffffff8145f310&gt;] cpufreq_governor_dbs+0x3b0/0x720
 [&lt;ffffffff8145ebe3&gt;] od_cpufreq_governor_dbs+0x33/0xe0
 [&lt;ffffffff814593d9&gt;] __cpufreq_governor+0xa9/0x210
 [&lt;ffffffff81459fb2&gt;] cpufreq_set_policy+0x1e2/0x2e0
 [&lt;ffffffff8145a6cc&gt;] cpufreq_init_policy+0x8c/0x110
 [&lt;ffffffff8145c9a0&gt;] ? cpufreq_update_policy+0x1b0/0x1b0
 [&lt;ffffffff8108fb99&gt;] ? preempt_count_sub+0xb9/0x100
 [&lt;ffffffff8145c6c6&gt;] __cpufreq_add_dev+0x596/0x6b0
 [&lt;ffffffffa016c608&gt;] ? pcc_cpufreq_probe+0x4b4/0x4b4 [pcc_cpufreq]
 [&lt;ffffffff8145c7ee&gt;] cpufreq_add_dev+0xe/0x10
 [&lt;ffffffff81408e81&gt;] subsys_interface_register+0xc1/0xf0
 [&lt;ffffffff8108fb99&gt;] ? preempt_count_sub+0xb9/0x100
 [&lt;ffffffff8145b3d7&gt;] cpufreq_register_driver+0x117/0x2a0
 [&lt;ffffffffa016c65d&gt;] pcc_cpufreq_init+0x55/0x9f8 [pcc_cpufreq]
 [&lt;ffffffffa016c608&gt;] ? pcc_cpufreq_probe+0x4b4/0x4b4 [pcc_cpufreq]
 [&lt;ffffffff81000298&gt;] do_one_initcall+0xc8/0x1f0
 [&lt;ffffffff811a731d&gt;] ? __vunmap+0x9d/0x100
 [&lt;ffffffff810eb9a0&gt;] do_init_module+0x30/0x1b0
 [&lt;ffffffff810edfa6&gt;] load_module+0x686/0x710
 [&lt;ffffffff810ebb20&gt;] ? do_init_module+0x1b0/0x1b0
 [&lt;ffffffff810ee1db&gt;] SyS_init_module+0x9b/0xc0
 [&lt;ffffffff8158f7a9&gt;] system_call_fastpath+0x16/0x1b

Fixes: 8fec051eea73 (cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end})
Reported-and-tested-by: Mike Galbraith &lt;umgwanakikbuti@gmail.com&gt;
Cc: 3.15+ &lt;stable@vger.kernel.org&gt; # 3.15+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: release policy-&gt;rwsem on error</title>
<updated>2014-09-22T12:32:43Z</updated>
<author>
<name>Prarit Bhargava</name>
<email>prarit@redhat.com</email>
</author>
<published>2014-09-10T14:12:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7106e02baed4a72fb23de56b02ad4d31daa74d95'/>
<id>urn:sha1:7106e02baed4a72fb23de56b02ad4d31daa74d95</id>
<content type='text'>
While debugging a cpufreq-related hardware failure on a system I saw the
following lockdep warning:

 =========================
 [ BUG: held lock freed! ] 3.17.0-rc4+ #1 Tainted: G            E
 -------------------------
 insmod/2247 is freeing memory ffff88006e1b1400-ffff88006e1b17ff, with a lock still held there!
  (&amp;policy-&gt;rwsem){+.+...}, at: [&lt;ffffffff8156d37d&gt;] __cpufreq_add_dev.isra.21+0x47d/0xb80
 3 locks held by insmod/2247:
  #0:  (subsys mutex#5){+.+.+.}, at: [&lt;ffffffff81485579&gt;] subsys_interface_register+0x69/0x120
  #1:  (cpufreq_rwsem){.+.+.+}, at: [&lt;ffffffff8156cf73&gt;] __cpufreq_add_dev.isra.21+0x73/0xb80
  #2:  (&amp;policy-&gt;rwsem){+.+...}, at: [&lt;ffffffff8156d37d&gt;] __cpufreq_add_dev.isra.21+0x47d/0xb80

 stack backtrace:
 CPU: 0 PID: 2247 Comm: insmod Tainted: G            E  3.17.0-rc4+ #1
 Hardware name: HP ProLiant MicroServer Gen8, BIOS J06 08/24/2013
  0000000000000000 000000008f3063c4 ffff88006f87bb30 ffffffff8171b358
  ffff88006bcf3750 ffff88006f87bb68 ffffffff810e09e1 ffff88006e1b1400
  ffffea0001b86c00 ffffffff8156d327 ffff880073003500 0000000000000246
 Call Trace:
  [&lt;ffffffff8171b358&gt;] dump_stack+0x4d/0x66
  [&lt;ffffffff810e09e1&gt;] debug_check_no_locks_freed+0x171/0x180
  [&lt;ffffffff8156d327&gt;] ? __cpufreq_add_dev.isra.21+0x427/0xb80
  [&lt;ffffffff8121412b&gt;] kfree+0xab/0x2b0
  [&lt;ffffffff8156d327&gt;] __cpufreq_add_dev.isra.21+0x427/0xb80
  [&lt;ffffffff81724cf7&gt;] ? _raw_spin_unlock+0x27/0x40
  [&lt;ffffffffa003517f&gt;] ? pcc_cpufreq_do_osc+0x17f/0x17f [pcc_cpufreq]
  [&lt;ffffffff8156da8e&gt;] cpufreq_add_dev+0xe/0x10
  [&lt;ffffffff814855d1&gt;] subsys_interface_register+0xc1/0x120
  [&lt;ffffffff8156bcf2&gt;] cpufreq_register_driver+0x112/0x340
  [&lt;ffffffff8121415a&gt;] ? kfree+0xda/0x2b0
  [&lt;ffffffffa003517f&gt;] ? pcc_cpufreq_do_osc+0x17f/0x17f [pcc_cpufreq]
  [&lt;ffffffffa003562e&gt;] pcc_cpufreq_init+0x4af/0xe81 [pcc_cpufreq]
  [&lt;ffffffffa003517f&gt;] ? pcc_cpufreq_do_osc+0x17f/0x17f [pcc_cpufreq]
  [&lt;ffffffff81002144&gt;] do_one_initcall+0xd4/0x210
  [&lt;ffffffff811f7472&gt;] ? __vunmap+0xd2/0x120
  [&lt;ffffffff81127155&gt;] load_module+0x1315/0x1b70
  [&lt;ffffffff811222a0&gt;] ? store_uevent+0x70/0x70
  [&lt;ffffffff811229d9&gt;] ? copy_module_from_fd.isra.44+0x129/0x180
  [&lt;ffffffff81127b86&gt;] SyS_finit_module+0xa6/0xd0
  [&lt;ffffffff81725b69&gt;] system_call_fastpath+0x16/0x1b
 cpufreq: __cpufreq_add_dev: -&gt;get() failed
insmod: ERROR: could not insert module pcc-cpufreq.ko: No such device

The warning occurs in the __cpufreq_add_dev() code which does

        down_write(&amp;policy-&gt;rwsem);
	...
        if (cpufreq_driver-&gt;get &amp;&amp; !cpufreq_driver-&gt;setpolicy) {
                policy-&gt;cur = cpufreq_driver-&gt;get(policy-&gt;cpu);
                if (!policy-&gt;cur) {
                        pr_err("%s: -&gt;get() failed\n", __func__);
                        goto err_get_freq;
                }

If cpufreq_driver-&gt;get(policy-&gt;cpu) returns an error we execute the
code at err_get_freq, which does not up the policy-&gt;rwsem.  This causes
the lockdep warning.

Trivial patch to up the policy-&gt;rwsem in the error path.

After the patch has been applied, and an error occurs in the
cpufreq_driver-&gt;get(policy-&gt;cpu) call we will now see

cpufreq: __cpufreq_add_dev: -&gt;get() failed
cpufreq: __cpufreq_add_dev: -&gt;get() failed
modprobe: ERROR: could not insert 'pcc_cpufreq': No such device

Fixes: 4e97b631f24c (cpufreq: Initialize governor for a new policy under policy-&gt;rwsem)
Signed-off-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Cc: 3.14+ &lt;stable@vger.kernel.org&gt; # 3.14+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: fix cpufreq suspend/resume for intel_pstate</title>
<updated>2014-09-22T12:23:18Z</updated>
<author>
<name>Lan Tianyu</name>
<email>tianyu.lan@intel.com</email>
</author>
<published>2014-09-18T07:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8e30444e153008e8eb3e74cbcb7a865bfcfb04a0'/>
<id>urn:sha1:8e30444e153008e8eb3e74cbcb7a865bfcfb04a0</id>
<content type='text'>
Cpufreq core introduces cpufreq_suspended flag to let cpufreq sysfs nodes
across S2RAM/S2DISK. But the flag is only set in the cpufreq_suspend()
for cpufreq drivers which have target or target_index callback. This
skips intel_pstate driver. This patch is to set the flag before checking
target or target_index callback.

Fixes: 2f0aea936360 (cpufreq: suspend governors on system suspend/hibernate)
Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Cc: 3.15+ &lt;stable@vger.kernel.org&gt; # 3.15+
[rjw: Subject]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq / OPP: Fix the order of arguments for kcalloc()</title>
<updated>2014-09-07T22:02:58Z</updated>
<author>
<name>Anand Moon</name>
<email>moon.linux@yahoo.com</email>
</author>
<published>2014-09-05T03:08:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d359992070901bcd774615910d36cec67dbdb1a7'/>
<id>urn:sha1:d359992070901bcd774615910d36cec67dbdb1a7</id>
<content type='text'>
These changes fix the argument to the kcalloc
        @n: number of elements.
        @size: element size.
        @flags: the type of memory to allocate (see kmalloc).

        void *kcalloc(size_t n, size_t size, gfp_t flags)

Fixes: 3c5445ce3a0c (cpufreq: OPP: Avoid sleeping while atomic)
Signed-off-by: Anand Moon &lt;moon.linux@yahoo.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Remove unneeded variable</title>
<updated>2014-09-02T23:31:04Z</updated>
<author>
<name>Gabriele Mazzotta</name>
<email>gabriele.mzt@gmail.com</email>
</author>
<published>2014-09-01T12:23:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=73f1ae8ab08b4972052de7d0358f031ce0343fff'/>
<id>urn:sha1:73f1ae8ab08b4972052de7d0358f031ce0343fff</id>
<content type='text'>
It should have been removed with commit d1b6848590af
("cpufreq / intel_pstate: Optimize intel_pstate_set_policy")

Signed-off-by: Gabriele Mazzotta &lt;gabriele.mzt@gmail.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: s5pv210: Remove spurious __init annotation</title>
<updated>2014-08-27T23:30:55Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@linaro.org</email>
</author>
<published>2014-08-27T11:00:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dc2687423964ec65f2953f3f08b5f97d02058acd'/>
<id>urn:sha1:dc2687423964ec65f2953f3f08b5f97d02058acd</id>
<content type='text'>
Since this is a platform driver and can be probed at any time we can't
annotate funtions in the probe path as __init, the code can't safely be
discarded at the end of kernel init.

Signed-off-by: Mark Brown &lt;broonie@linaro.org&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpufreq: intel_pstate: Add CPU ID for Braswell processor</title>
<updated>2014-08-27T23:26:21Z</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2014-08-22T10:05:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=16405f98bca8eb39a23b3ce03e241ca19e7af370'/>
<id>urn:sha1:16405f98bca8eb39a23b3ce03e241ca19e7af370</id>
<content type='text'>
This is pretty much the same as Intel Baytrail, only the CPU ID is
different. Add the new ID to the supported CPU list.

Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Acked-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Dirk Brandewie &lt;dirk.j.brandewie@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>intel_pstate: Turn per cpu printk into pr_debug</title>
<updated>2014-08-27T23:23:08Z</updated>
<author>
<name>Andi Kleen</name>
<email>ak@linux.intel.com</email>
</author>
<published>2014-08-27T17:17:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ce717613f3fb531dea3e11c8c24d80585331f137'/>
<id>urn:sha1:ce717613f3fb531dea3e11c8c24d80585331f137</id>
<content type='text'>
On larger systems intel_pstate currently spams the boot up
log with its "Intel pstate controlling ..." message for each CPU.
It's the only subsystem that prints a message for each
CPU.

Turn the message into a pr_debug.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Acked-by: Dirk Brandewie &lt;dirk.j.brandewie@intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
