rk: cpufreq: fix lock warning
author黄涛 <huangtao@rock-chips.com>
Tue, 22 Apr 2014 11:41:07 +0000 (19:41 +0800)
committer黄涛 <huangtao@rock-chips.com>
Tue, 22 Apr 2014 11:43:55 +0000 (19:43 +0800)
INFO: trying to register non-static key.
the code is fine but needs lockdep annotation.
turning off the locking correctness validator.
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.10.0 #21
[<c0014264>] (unwind_backtrace+0x0/0xe0) from [<c0011b7c>] (show_stack+0x10/0x14)
[<c0011b7c>] (show_stack+0x10/0x14) from [<c007d50c>] (__lock_acquire.isra.24+0x1a4/0x77c)
[<c007d50c>] (__lock_acquire.isra.24+0x1a4/0x77c) from [<c007e09c>] (lock_acquire+0x120/0x144)
[<c007e09c>] (lock_acquire+0x120/0x144) from [<c070bc1c>] (_raw_spin_lock_irqsave+0x4c/0x60)
[<c070bc1c>] (_raw_spin_lock_irqsave+0x4c/0x60) from [<c04672dc>] (store_target_loads+0x34/0x70)
[<c04672dc>] (store_target_loads+0x34/0x70) from [<c0467f04>] (cpufreq_governor_interactive+0x1a4/0x56c)
[<c0467f04>] (cpufreq_governor_interactive+0x1a4/0x56c) from [<c0462f08>] (__cpufreq_governor.part.11+0x18/0x84)
[<c0462f08>] (__cpufreq_governor.part.11+0x18/0x84) from [<c0463728>] (__cpufreq_set_policy.part.15+0xe8/0x16c)
[<c0463728>] (__cpufreq_set_policy.part.15+0xe8/0x16c) from [<c0463a30>] (cpufreq_add_dev_interface+0x20c/0x250)
[<c0463a30>] (cpufreq_add_dev_interface+0x20c/0x250) from [<c0463cb0>] (cpufreq_add_dev+0x23c/0x33c)
[<c0463cb0>] (cpufreq_add_dev+0x23c/0x33c) from [<c02e7560>] (subsys_interface_register+0x80/0xb8)
[<c02e7560>] (subsys_interface_register+0x80/0xb8) from [<c0462a50>] (cpufreq_register_driver+0xa0/0x188)
[<c0462a50>] (cpufreq_register_driver+0xa0/0x188) from [<c00086e4>] (do_one_initcall+0x34/0xc8)
[<c00086e4>] (do_one_initcall+0x34/0xc8) from [<c09dbb3c>] (do_initcalls+0x70/0xa0)
[<c09dbb3c>] (do_initcalls+0x70/0xa0) from [<c09dbbf8>] (kernel_init_freeable+0x8c/0x12c)
[<c09dbbf8>] (kernel_init_freeable+0x8c/0x12c) from [<c06ed2d4>] (kernel_init+0x8/0xe4)
[<c06ed2d4>] (kernel_init+0x8/0xe4) from [<c000db58>] (ret_from_fork+0x14/0x3c)

drivers/cpufreq/cpufreq_interactive.c

index 8362b3dbf54a12193044a624196615e0c86d22b6..e052f0831cadbe0b811e03cb39f09049595ec378 100644 (file)
@@ -1155,6 +1155,9 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
                tunables->boostpulse_duration_val = DEFAULT_MIN_SAMPLE_TIME;
                tunables->timer_slack_val = DEFAULT_TIMER_SLACK;
 
+               spin_lock_init(&tunables->target_loads_lock);
+               spin_lock_init(&tunables->above_hispeed_delay_lock);
+
 #ifdef CONFIG_ARCH_ROCKCHIP
                {
                        unsigned int index;
@@ -1172,9 +1175,6 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
                }
 #endif
 
-               spin_lock_init(&tunables->target_loads_lock);
-               spin_lock_init(&tunables->above_hispeed_delay_lock);
-
                policy->governor_data = tunables;
                if (!have_governor_per_policy())
                        common_tunables = tunables;