diff options
Diffstat (limited to 'arch/i386/kernel')
| -rw-r--r-- | arch/i386/kernel/cpu/mcheck/therm_throt.c | 6 | ||||
| -rw-r--r-- | arch/i386/kernel/smpcommon.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/arch/i386/kernel/cpu/mcheck/therm_throt.c b/arch/i386/kernel/cpu/mcheck/therm_throt.c index 7ba7c3abd3a4..1203dc5ab87a 100644 --- a/arch/i386/kernel/cpu/mcheck/therm_throt.c +++ b/arch/i386/kernel/cpu/mcheck/therm_throt.c | |||
| @@ -134,19 +134,21 @@ static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb, | |||
| 134 | int err; | 134 | int err; |
| 135 | 135 | ||
| 136 | sys_dev = get_cpu_sysdev(cpu); | 136 | sys_dev = get_cpu_sysdev(cpu); |
| 137 | mutex_lock(&therm_cpu_lock); | ||
| 138 | switch (action) { | 137 | switch (action) { |
| 139 | case CPU_ONLINE: | 138 | case CPU_ONLINE: |
| 140 | case CPU_ONLINE_FROZEN: | 139 | case CPU_ONLINE_FROZEN: |
| 140 | mutex_lock(&therm_cpu_lock); | ||
| 141 | err = thermal_throttle_add_dev(sys_dev); | 141 | err = thermal_throttle_add_dev(sys_dev); |
| 142 | mutex_unlock(&therm_cpu_lock); | ||
| 142 | WARN_ON(err); | 143 | WARN_ON(err); |
| 143 | break; | 144 | break; |
| 144 | case CPU_DEAD: | 145 | case CPU_DEAD: |
| 145 | case CPU_DEAD_FROZEN: | 146 | case CPU_DEAD_FROZEN: |
| 147 | mutex_lock(&therm_cpu_lock); | ||
| 146 | thermal_throttle_remove_dev(sys_dev); | 148 | thermal_throttle_remove_dev(sys_dev); |
| 149 | mutex_unlock(&therm_cpu_lock); | ||
| 147 | break; | 150 | break; |
| 148 | } | 151 | } |
| 149 | mutex_unlock(&therm_cpu_lock); | ||
| 150 | return NOTIFY_OK; | 152 | return NOTIFY_OK; |
| 151 | } | 153 | } |
| 152 | 154 | ||
diff --git a/arch/i386/kernel/smpcommon.c b/arch/i386/kernel/smpcommon.c index 1868ae18eb4d..bbfe85a0f699 100644 --- a/arch/i386/kernel/smpcommon.c +++ b/arch/i386/kernel/smpcommon.c | |||
| @@ -47,7 +47,7 @@ int smp_call_function(void (*func) (void *info), void *info, int nonatomic, | |||
| 47 | EXPORT_SYMBOL(smp_call_function); | 47 | EXPORT_SYMBOL(smp_call_function); |
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| 50 | * smp_call_function_single - Run a function on another CPU | 50 | * smp_call_function_single - Run a function on a specific CPU |
| 51 | * @cpu: The target CPU. Cannot be the calling CPU. | 51 | * @cpu: The target CPU. Cannot be the calling CPU. |
| 52 | * @func: The function to run. This must be fast and non-blocking. | 52 | * @func: The function to run. This must be fast and non-blocking. |
| 53 | * @info: An arbitrary pointer to pass to the function. | 53 | * @info: An arbitrary pointer to pass to the function. |
| @@ -66,9 +66,11 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, | |||
| 66 | int ret; | 66 | int ret; |
| 67 | int me = get_cpu(); | 67 | int me = get_cpu(); |
| 68 | if (cpu == me) { | 68 | if (cpu == me) { |
| 69 | WARN_ON(1); | 69 | local_irq_disable(); |
| 70 | func(info); | ||
| 71 | local_irq_enable(); | ||
| 70 | put_cpu(); | 72 | put_cpu(); |
| 71 | return -EBUSY; | 73 | return 0; |
| 72 | } | 74 | } |
| 73 | 75 | ||
| 74 | ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, wait); | 76 | ret = smp_call_function_mask(cpumask_of_cpu(cpu), func, info, wait); |
