diff options
author | Dave Jones <davej@redhat.com> | 2007-04-11 18:22:34 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2007-04-26 14:32:02 -0400 |
commit | e8e49190f64896afe79f7136a67c2bdefbd3e322 (patch) | |
tree | f4c9a03f68317dac9c11a7046729e029d143416a /arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c | |
parent | fb48e15645fb702cb2ec02c84f82ece2fbc1574d (diff) |
Fix preemption warnings in speedstep-centrino.c
BUG: using smp_processor_id() in preemptible [00000001] code:
kondemand/0/2473
caller is centrino_target+0xfb/0x600
[<401e3646>] debug_smp_processor_id+0x9e/0xb0
[<40112afb>] centrino_target+0xfb/0x600
[<40112a00>] centrino_target+0x0/0x600
[<40305bd9>] __cpufreq_driver_target+0x5c/0x6b
[<f897a537>] do_dbs_timer+0x1bc/0x208 [cpufreq_ondemand]
[<40134a46>] run_workqueue+0x85/0x125
[<40374f7f>] _spin_lock_irqsave+0x18/0x66
[<f897a37b>] do_dbs_timer+0x0/0x208 [cpufreq_ondemand]
[<401353fb>] worker_thread+0xf9/0x124
[<401213b9>] default_wake_function+0x0/0xc
[<40135302>] worker_thread+0x0/0x124
[<40137b37>] kthread+0xb0/0xd9
[<40137a87>] kthread+0x0/0xd9
[<40104b2f>] kernel_thread_helper+0x7/0x10
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c')
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c index f43b987f952b..35489fd68852 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c | |||
@@ -720,6 +720,7 @@ static int centrino_target (struct cpufreq_policy *policy, | |||
720 | cpu_set(j, set_mask); | 720 | cpu_set(j, set_mask); |
721 | 721 | ||
722 | set_cpus_allowed(current, set_mask); | 722 | set_cpus_allowed(current, set_mask); |
723 | preempt_disable(); | ||
723 | if (unlikely(!cpu_isset(smp_processor_id(), set_mask))) { | 724 | if (unlikely(!cpu_isset(smp_processor_id(), set_mask))) { |
724 | dprintk("couldn't limit to CPUs in this domain\n"); | 725 | dprintk("couldn't limit to CPUs in this domain\n"); |
725 | retval = -EAGAIN; | 726 | retval = -EAGAIN; |
@@ -727,6 +728,7 @@ static int centrino_target (struct cpufreq_policy *policy, | |||
727 | /* We haven't started the transition yet. */ | 728 | /* We haven't started the transition yet. */ |
728 | goto migrate_end; | 729 | goto migrate_end; |
729 | } | 730 | } |
731 | preempt_enable(); | ||
730 | break; | 732 | break; |
731 | } | 733 | } |
732 | 734 | ||
@@ -761,10 +763,13 @@ static int centrino_target (struct cpufreq_policy *policy, | |||
761 | } | 763 | } |
762 | 764 | ||
763 | wrmsr(MSR_IA32_PERF_CTL, oldmsr, h); | 765 | wrmsr(MSR_IA32_PERF_CTL, oldmsr, h); |
764 | if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) | 766 | if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { |
767 | preempt_enable(); | ||
765 | break; | 768 | break; |
769 | } | ||
766 | 770 | ||
767 | cpu_set(j, covered_cpus); | 771 | cpu_set(j, covered_cpus); |
772 | preempt_enable(); | ||
768 | } | 773 | } |
769 | 774 | ||
770 | for_each_cpu_mask(k, online_policy_cpus) { | 775 | for_each_cpu_mask(k, online_policy_cpus) { |
@@ -796,8 +801,11 @@ static int centrino_target (struct cpufreq_policy *policy, | |||
796 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 801 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
797 | } | 802 | } |
798 | } | 803 | } |
804 | set_cpus_allowed(current, saved_mask); | ||
805 | return 0; | ||
799 | 806 | ||
800 | migrate_end: | 807 | migrate_end: |
808 | preempt_enable(); | ||
801 | set_cpus_allowed(current, saved_mask); | 809 | set_cpus_allowed(current, saved_mask); |
802 | return 0; | 810 | return 0; |
803 | } | 811 | } |