From: Rafael J. Wysocki Date: Sun, 28 Apr 2013 22:08:16 +0000 (+0200) Subject: cpufreq: Revert incorrect commit 5800043 X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~92^2^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c3d85dd4e21a405e8de54131a5f759f9a0115b7;p=pandora-kernel.git cpufreq: Revert incorrect commit 5800043 Commit 5800043 (cpufreq: convert cpufreq_driver to using RCU) causes the following call trace to be spit on boot: BUG: sleeping function called from invalid context at /scratch/rafael/work/linux-pm/mm/slab.c:3179 in_atomic(): 0, irqs_disabled(): 0, pid: 292, name: systemd-udevd 2 locks held by systemd-udevd/292: #0: (subsys mutex){+.+.+.}, at: [] subsys_interface_register+0x4a/0xe0 #1: (rcu_read_lock){.+.+.+}, at: [] cpufreq_add_dev_interface+0x60/0x5e0 Pid: 292, comm: systemd-udevd Not tainted 3.9.0-rc8+ #323 Call Trace: [] __might_sleep+0x140/0x1f0 [] kmem_cache_alloc+0x42/0x2b0 [] sysfs_new_dirent+0x59/0x130 [] sysfs_add_file_mode+0x6b/0x110 [] ? cpufreq_add_dev_interface+0x60/0x5e0 [] ? __lock_is_held+0x54/0x80 [] sysfs_add_file+0xd/0x10 [] sysfs_create_file+0x21/0x30 [] cpufreq_add_dev_interface+0xd0/0x5e0 [] ? cpufreq_add_dev_interface+0x60/0x5e0 [] ? acpi_processor_get_platform_limit+0x32/0xbb [processor] [] ? do_drv_write+0x70/0x70 [acpi_cpufreq] [] ? __lock_is_held+0x54/0x80 [] ? up_read+0x1e/0x40 [] ? __blocking_notifier_call_chain+0x72/0xc0 [] cpufreq_add_dev+0x62d/0xae0 [] ? cpufreq_add_dev+0x228/0xae0 [] subsys_interface_register+0x99/0xe0 [] ? 0xffffffffa014cfff [] cpufreq_register_driver+0x9d/0x200 [] ? 0xffffffffa014cfff [] acpi_cpufreq_init+0xe9/0x1000 [acpi_cpufreq] [] do_one_initcall+0x11a/0x170 [] load_module+0x1cf7/0x2920 [] ? ddebug_proc_open+0xb0/0xb0 [] ? retint_restore_args+0xe/0xe [] sys_init_module+0xd7/0x120 [] system_call_fastpath+0x16/0x1b which is quite obvious, because that commit put (multiple instances of) sysfs_create_file() under rcu_read_lock()/rcu_read_unlock(), although sysfs_create_file() may cause memory to be allocated with GFP_KERNEL and that may sleep, which is not permitted in RCU read critical section. Revert the buggy commit altogether along with some changes on top of it. Signed-off-by: Rafael J. Wysocki --- Reading git-diff-tree failed