Li Zhong
5025d628c8
cpufreq: fix bad unlock balance on !CONFIG_SMP
This patch tries to fix lockdep complaint attached below.
It seems that we should always read acquire the cpufreq_rwsem,
whether CONFIG_SMP is enabled or not. And CONFIG_HOTPLUG_CPU
depends on CONFIG_SMP, so it seems we don't need CONFIG_SMP for the
code enabled by CONFIG_HOTPLUG_CPU.
[ 0.504191] =====================================
[ 0.504627] [ BUG: bad unlock balance detected! ]
[ 0.504627] 3.11.0-rc6-next-20130819 #1 Not tainted
[ 0.504627] -------------------------------------
[ 0.504627] swapper/1 is trying to release lock (cpufreq_rwsem) at:
[ 0.504627] [<ffffffff813d927a>] cpufreq_add_dev+0x13a/0x3e0
[ 0.504627] but there are no more locks to release!
[ 0.504627]
[ 0.504627] other info that might help us debug this:
[ 0.504627] 1 lock held by swapper/1:
[ 0.504627] #0: (subsys mutex#4){+.+.+.}, at: [<ffffffff8134a7bf>] subsys_interface_register+0x4f/0xe0
[ 0.504627]
[ 0.504627] stack backtrace:
[ 0.504627] CPU: 0 PID: 1 Comm: swapper Not tainted 3.11.0-rc6-next-20130819 #1
[ 0.504627] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 0.504627] ffffffff813d927a ffff88007f847c98 ffffffff814c062b ffff88007f847cc8
[ 0.504627] ffffffff81098bce ffff88007f847cf8 ffffffff81aadc30 ffffffff813d927a
[ 0.504627] 00000000ffffffff ffff88007f847d68 ffffffff8109d0be 0000000000000006
[ 0.504627] Call Trace:
[ 0.504627] [<ffffffff813d927a>] ? cpufreq_add_dev+0x13a/0x3e0
[ 0.504627] [<ffffffff814c062b>] dump_stack+0x19/0x1b
[ 0.504627] [<ffffffff81098bce>] print_unlock_imbalance_bug+0xfe/0x110
[ 0.504627] [<ffffffff813d927a>] ? cpufreq_add_dev+0x13a/0x3e0
[ 0.504627] [<ffffffff8109d0be>] lock_release_non_nested+0x1ee/0x310
[ 0.504627] [<ffffffff81099d0e>] ? mark_held_locks+0xae/0x120
[ 0.504627] [<ffffffff811510cb>] ? kfree+0xcb/0x1d0
[ 0.504627] [<ffffffff813d77ea>] ? cpufreq_policy_free+0x4a/0x60
[ 0.504627] [<ffffffff813d927a>] ? cpufreq_add_dev+0x13a/0x3e0
[ 0.504627] [<ffffffff8109d2a4>] lock_release+0xc4/0x250
[ 0.504627] [<ffffffff8106c9f3>] up_read+0x23/0x40
[ 0.504627] [<ffffffff813d927a>] cpufreq_add_dev+0x13a/0x3e0
[ 0.504627] [<ffffffff8134a809>] subsys_interface_register+0x99/0xe0
[ 0.504627] [<ffffffff81b19f3b>] ? cpufreq_gov_dbs_init+0x12/0x12
[ 0.504627] [<ffffffff813d7f0d>] cpufreq_register_driver+0x9d/0x1d0
[ 0.504627] [<ffffffff81b19f3b>] ? cpufreq_gov_dbs_init+0x12/0x12
[ 0.504627] [<ffffffff81b1a039>] acpi_cpufreq_init+0xfe/0x1f8
[ 0.504627] [<ffffffff810002ba>] do_one_initcall+0xda/0x180
[ 0.504627] [<ffffffff81ae301e>] kernel_init_freeable+0x12c/0x1bb
[ 0.504627] [<ffffffff81ae2841>] ? do_early_param+0x8c/0x8c
[ 0.504627] [<ffffffff814b4dd0>] ? rest_init+0x140/0x140
[ 0.504627] [<ffffffff814b4dde>] kernel_init+0xe/0xf0
[ 0.504627] [<ffffffff814d029a>] ret_from_fork+0x7a/0xb0
[ 0.504627] [<ffffffff814b4dd0>] ? rest_init+0x140/0x140
Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Acked-and-tested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-08-21 02:04:31 +02:00
..
2013-08-14 22:24:22 +02:00
2013-04-10 13:19:26 +02:00
2013-05-22 12:43:33 +02:00
2013-06-24 18:18:58 +05:30
2013-05-12 14:04:15 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-08-14 22:21:16 +02:00
2013-08-14 22:21:16 +02:00
2013-08-14 22:21:16 +02:00
2013-08-14 22:21:16 +02:00
2013-08-07 23:34:09 +02:00
2013-08-07 23:34:09 +02:00
2013-08-07 23:34:10 +02:00
2013-06-21 01:06:34 +02:00
2013-08-14 22:24:22 +02:00
2013-08-10 03:24:47 +02:00
2013-08-21 02:04:31 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-06-24 18:18:58 +05:30
2013-07-14 19:36:57 -04:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-02-21 14:58:40 -08:00
2013-02-21 14:58:40 -08:00
2013-02-21 14:58:40 -08:00
2013-08-12 12:00:18 +05:30
2013-08-14 22:22:57 +02:00
2013-08-12 12:00:21 +05:30
2013-08-07 23:34:09 +02:00
2013-08-14 22:24:23 +02:00
2013-03-04 14:23:11 +01:00
2013-08-10 03:24:47 +02:00
2013-06-24 18:19:00 +05:30
2013-04-08 13:02:31 +02:00
2013-08-10 03:24:47 +02:00
2013-05-12 14:04:16 +02:00
2013-08-12 12:00:21 +05:30
2013-06-27 21:46:45 +02:00
2013-06-18 13:53:11 +05:30
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-07-14 19:36:57 -04:00
2013-08-10 03:24:47 +02:00
2013-08-14 22:21:16 +02:00
2013-07-26 01:06:43 +02:00
2013-08-10 03:24:47 +02:00
2013-07-14 19:36:57 -04:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2011-05-19 18:51:07 -04:00
2013-08-10 03:24:47 +02:00
2012-09-09 22:05:30 +02:00
2013-04-10 13:19:26 +02:00
2013-04-10 13:19:26 +02:00
2013-08-10 03:24:47 +02:00
2013-04-10 13:19:26 +02:00
2013-08-10 03:24:47 +02:00
2013-08-14 22:24:23 +02:00
2013-08-14 22:24:23 +02:00
2013-05-20 23:04:28 +09:00
2013-08-14 22:24:24 +02:00
2013-08-10 03:24:47 +02:00
2013-05-20 23:04:28 +09:00
2013-05-20 23:04:28 +09:00
2013-08-10 03:24:47 +02:00
2013-05-20 23:04:28 +09:00
2013-04-02 15:24:00 +02:00
2013-04-10 13:19:24 +02:00
2013-04-10 13:19:24 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2013-06-04 14:25:59 +02:00
2013-08-10 03:24:47 +02:00
2013-08-10 03:24:47 +02:00
2012-01-26 16:49:06 -08:00
2011-05-19 18:51:07 -04:00
2013-08-10 03:24:47 +02:00
2013-06-27 21:47:03 +02:00
2013-08-14 22:24:24 +02:00