Rafael J. Wysocki
e65b5ddba8
cpufreq: pcc-cpufreq: Fix wait_event() under spinlock
Fix the following bug introduced by commit 8fec051eea (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:[<ffffffffa04d74d7>] 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:
[<ffffffff81589dbd>] dump_stack+0x4d/0x90
[<ffffffff8108e1df>] ___might_sleep+0x10f/0x180
[<ffffffff8108e298>] __might_sleep+0x48/0xd0
[<ffffffff8145b905>] cpufreq_freq_transition_begin+0x75/0x140 drivers/cpufreq/cpufreq.c:370 wait_event(policy->transition_wait, !policy->transition_ongoing);
[<ffffffff8108fc99>] ? preempt_count_add+0xb9/0xc0
[<ffffffffa04d7513>] pcc_cpufreq_target+0x63/0x200 [pcc_cpufreq] drivers/cpufreq/pcc-cpufreq.c:207 spin_lock(&pcc_lock);
[<ffffffff810e0d0f>] ? update_ts_time_stats+0x7f/0xb0
[<ffffffff8145be55>] __cpufreq_driver_target+0x85/0x170
[<ffffffff8145e4c8>] od_check_cpu+0xa8/0xb0
[<ffffffff8145ef10>] dbs_check_cpu+0x180/0x1d0
[<ffffffff8145f310>] cpufreq_governor_dbs+0x3b0/0x720
[<ffffffff8145ebe3>] od_cpufreq_governor_dbs+0x33/0xe0
[<ffffffff814593d9>] __cpufreq_governor+0xa9/0x210
[<ffffffff81459fb2>] cpufreq_set_policy+0x1e2/0x2e0
[<ffffffff8145a6cc>] cpufreq_init_policy+0x8c/0x110
[<ffffffff8145c9a0>] ? cpufreq_update_policy+0x1b0/0x1b0
[<ffffffff8108fb99>] ? preempt_count_sub+0xb9/0x100
[<ffffffff8145c6c6>] __cpufreq_add_dev+0x596/0x6b0
[<ffffffffa016c608>] ? pcc_cpufreq_probe+0x4b4/0x4b4 [pcc_cpufreq]
[<ffffffff8145c7ee>] cpufreq_add_dev+0xe/0x10
[<ffffffff81408e81>] subsys_interface_register+0xc1/0xf0
[<ffffffff8108fb99>] ? preempt_count_sub+0xb9/0x100
[<ffffffff8145b3d7>] cpufreq_register_driver+0x117/0x2a0
[<ffffffffa016c65d>] pcc_cpufreq_init+0x55/0x9f8 [pcc_cpufreq]
[<ffffffffa016c608>] ? pcc_cpufreq_probe+0x4b4/0x4b4 [pcc_cpufreq]
[<ffffffff81000298>] do_one_initcall+0xc8/0x1f0
[<ffffffff811a731d>] ? __vunmap+0x9d/0x100
[<ffffffff810eb9a0>] do_init_module+0x30/0x1b0
[<ffffffff810edfa6>] load_module+0x686/0x710
[<ffffffff810ebb20>] ? do_init_module+0x1b0/0x1b0
[<ffffffff810ee1db>] SyS_init_module+0x9b/0xc0
[<ffffffff8158f7a9>] system_call_fastpath+0x16/0x1b
Fixes: 8fec051eea (cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end})
Reported-and-tested-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Cc: 3.15+ <stable@vger.kernel.org> # 3.15+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-09-29 15:35:50 +02:00
..
2014-09-25 22:59:30 +02:00
2014-09-06 11:27:15 +09:00
2014-08-13 18:27:40 -06:00
2014-09-15 16:20:56 -07:00
2014-08-25 15:39:23 -04:00
2014-09-13 09:39:55 -07:00
2014-07-31 01:07:28 +02:00
2014-09-11 10:43:39 -07:00
2014-09-11 22:28:38 +09:30
2014-09-09 13:52:18 -07:00
2014-08-08 11:14:29 -07:00
2014-09-29 15:35:50 +02:00
2014-08-27 15:40:45 +01:00
2014-09-24 14:23:34 +08:00
2014-09-23 18:22:55 +05:30
2014-08-28 11:59:09 +05:30
2014-08-15 17:56:45 -06:00
2014-08-06 09:38:14 -07:00
2014-09-23 22:01:55 +01:00
2014-09-25 15:25:52 -07:00
2014-09-25 06:49:26 +10:00
2014-08-27 09:38:06 -07:00
2014-08-06 20:06:14 -07:00
2014-08-04 17:32:24 -07:00
2014-09-22 11:11:48 -07:00
2014-09-25 16:08:15 +02:00
2014-08-05 21:16:46 -07:00
2014-08-15 17:06:40 -04:00
2014-09-14 18:21:23 +01:00
2014-09-23 16:47:34 -07:00
2014-09-26 11:04:31 -07:00
2014-09-05 16:01:46 +02:00
2014-09-03 12:08:10 +00:00
2014-08-22 11:31:30 -07:00
2014-09-02 10:02:13 -07:00
2014-08-06 18:01:19 -07:00
2014-08-07 17:23:16 -07:00
2014-09-24 08:53:33 -07:00
2014-09-21 21:27:57 -03:00
2014-07-29 19:26:30 -05:00
2014-09-16 16:55:55 -04:00
2014-08-28 15:57:55 +01:00
2014-09-08 14:38:14 -07:00
2014-08-14 18:10:33 -06:00
2014-09-06 12:12:09 -07:00
2014-09-24 12:45:24 -07:00
2014-09-07 23:45:53 +02:00
2014-09-14 00:10:38 -04:00
2014-09-25 11:55:50 +01:00
2014-09-21 22:31:08 +02:00
2014-08-08 15:57:25 -07:00
2014-09-24 09:46:29 -07:00
2014-08-07 08:50:34 -07:00
2014-09-12 11:35:31 +05:30
2014-09-10 14:25:51 +02:00
2014-09-03 10:45:12 -07:00
2014-08-08 11:14:29 -07:00
2014-09-03 01:29:00 +02:00
2014-08-12 12:15:14 -06:00
2014-08-18 10:58:43 +02:00
2014-08-12 12:15:14 -06:00
2014-09-10 11:35:02 +01:00
2014-09-26 08:10:35 -07:00
2014-09-08 08:27:00 -07:00
2014-08-05 18:57:18 -07:00
2014-09-22 18:23:33 -07:00
2014-08-22 12:28:16 +09:00
2014-09-23 21:38:32 -07:00
2014-09-16 16:20:19 -07:00
2014-08-25 15:39:22 -04:00
2014-09-19 15:32:20 -07:00
2014-09-17 13:44:01 -07:00
2014-08-26 14:54:48 -07:00
2014-09-08 16:33:56 -07:00
2014-09-19 15:01:38 -07:00
2014-09-08 16:03:21 -07:00
2014-08-08 10:39:16 -06:00
2014-09-12 11:45:10 +03:00
2014-08-08 15:57:30 -07:00
2014-08-07 08:47:00 -07:00
2014-09-11 16:52:29 -07:00
2014-08-04 17:32:24 -07:00
2014-08-04 18:34:04 -07:00