https://github.com/torvalds/linux
Revision e65b5ddba84634f31d42dfd86013f4c6be5e9e32 authored by Rafael J. Wysocki on 27 September 2014, 19:56:08 UTC, committed by Rafael J. Wysocki on 29 September 2014, 13:35:50 UTC
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:[<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: 8fec051eea73 (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>
1 parent fe82dce
History
Tip revision: e65b5ddba84634f31d42dfd86013f4c6be5e9e32 authored by Rafael J. Wysocki on 27 September 2014, 19:56:08 UTC
cpufreq: pcc-cpufreq: Fix wait_event() under spinlock
Tip revision: e65b5dd
File Mode Size
Kconfig -rw-r--r-- 20.8 KB
Kconfig.debug -rw-r--r-- 1015 bytes
Makefile -rw-r--r-- 2.2 KB
backing-dev.c -rw-r--r-- 16.7 KB
balloon_compaction.c -rw-r--r-- 9.7 KB
bootmem.c -rw-r--r-- 20.8 KB
cleancache.c -rw-r--r-- 12.7 KB
cma.c -rw-r--r-- 8.7 KB
compaction.c -rw-r--r-- 34.8 KB
debug-pagealloc.c -rw-r--r-- 2.1 KB
dmapool.c -rw-r--r-- 13.0 KB
early_ioremap.c -rw-r--r-- 5.4 KB
fadvise.c -rw-r--r-- 3.6 KB
failslab.c -rw-r--r-- 1.3 KB
filemap.c -rw-r--r-- 70.4 KB
filemap_xip.c -rw-r--r-- 11.3 KB
fremap.c -rw-r--r-- 7.3 KB
frontswap.c -rw-r--r-- 13.4 KB
gup.c -rw-r--r-- 20.6 KB
highmem.c -rw-r--r-- 11.8 KB
huge_memory.c -rw-r--r-- 78.2 KB
hugetlb.c -rw-r--r-- 98.0 KB
hugetlb_cgroup.c -rw-r--r-- 10.3 KB
hwpoison-inject.c -rw-r--r-- 3.3 KB
init-mm.c -rw-r--r-- 619 bytes
internal.h -rw-r--r-- 11.4 KB
interval_tree.c -rw-r--r-- 3.2 KB
iov_iter.c -rw-r--r-- 16.8 KB
kmemcheck.c -rw-r--r-- 2.8 KB
kmemleak-test.c -rw-r--r-- 3.2 KB
kmemleak.c -rw-r--r-- 53.2 KB
ksm.c -rw-r--r-- 63.3 KB
list_lru.c -rw-r--r-- 3.4 KB
maccess.c -rw-r--r-- 1.6 KB
madvise.c -rw-r--r-- 14.1 KB
memblock.c -rw-r--r-- 44.7 KB
memcontrol.c -rw-r--r-- 176.6 KB
memory-failure.c -rw-r--r-- 47.8 KB
memory.c -rw-r--r-- 102.2 KB
memory_hotplug.c -rw-r--r-- 50.8 KB
mempolicy.c -rw-r--r-- 71.5 KB
mempool.c -rw-r--r-- 10.7 KB
migrate.c -rw-r--r-- 49.1 KB
mincore.c -rw-r--r-- 7.8 KB
mlock.c -rw-r--r-- 22.8 KB
mm_init.c -rw-r--r-- 5.0 KB
mmap.c -rw-r--r-- 88.1 KB
mmu_context.c -rw-r--r-- 1.3 KB
mmu_notifier.c -rw-r--r-- 10.5 KB
mmzone.c -rw-r--r-- 2.4 KB
mprotect.c -rw-r--r-- 10.7 KB
mremap.c -rw-r--r-- 15.0 KB
msync.c -rw-r--r-- 2.7 KB
nobootmem.c -rw-r--r-- 10.8 KB
nommu.c -rw-r--r-- 53.4 KB
oom_kill.c -rw-r--r-- 19.7 KB
page-writeback.c -rw-r--r-- 74.5 KB
page_alloc.c -rw-r--r-- 184.4 KB
page_cgroup.c -rw-r--r-- 12.0 KB
page_io.c -rw-r--r-- 9.5 KB
page_isolation.c -rw-r--r-- 7.5 KB
pagewalk.c -rw-r--r-- 5.9 KB
percpu-km.c -rw-r--r-- 2.8 KB
percpu-vm.c -rw-r--r-- 13.1 KB
percpu.c -rw-r--r-- 57.0 KB
pgtable-generic.c -rw-r--r-- 5.2 KB
process_vm_access.c -rw-r--r-- 10.2 KB
quicklist.c -rw-r--r-- 2.4 KB
readahead.c -rw-r--r-- 15.6 KB
rmap.c -rw-r--r-- 48.3 KB
shmem.c -rw-r--r-- 88.9 KB
slab.c -rw-r--r-- 109.1 KB
slab.h -rw-r--r-- 8.5 KB
slab_common.c -rw-r--r-- 20.3 KB
slob.c -rw-r--r-- 15.7 KB
slub.c -rw-r--r-- 126.2 KB
sparse-vmemmap.c -rw-r--r-- 6.0 KB
sparse.c -rw-r--r-- 20.9 KB
swap.c -rw-r--r-- 31.7 KB
swap_state.c -rw-r--r-- 12.9 KB
swapfile.c -rw-r--r-- 77.0 KB
truncate.c -rw-r--r-- 22.5 KB
util.c -rw-r--r-- 9.4 KB
vmacache.c -rw-r--r-- 3.1 KB
vmalloc.c -rw-r--r-- 68.3 KB
vmpressure.c -rw-r--r-- 11.4 KB
vmscan.c -rw-r--r-- 110.1 KB
vmstat.c -rw-r--r-- 35.4 KB
workingset.c -rw-r--r-- 13.6 KB
zbud.c -rw-r--r-- 17.7 KB
zpool.c -rw-r--r-- 9.5 KB
zsmalloc.c -rw-r--r-- 30.3 KB
zswap.c -rw-r--r-- 24.9 KB

back to top