diff options
author | Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 2014-03-10 16:37:28 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-03-20 08:43:43 -0400 |
commit | 7b7139d4abe8a94446db6a91882f1400920891d5 (patch) | |
tree | 4a2a6fc395a1d2b7f3a48226932dca1475993c6c /arch/x86 | |
parent | 4e6192bbec2ec21d2a6685987674a1c73e810de1 (diff) |
x86, therm_throt.c: Remove unused therm_cpu_lock
After fixing the CPU hotplug callback registration code, the callbacks
invoked for each online CPU, during the initialization phase in
thermal_throttle_init_device(), can no longer race with the actual CPU
hotplug notifier callbacks (in thermal_throttle_cpu_callback). Hence the
therm_cpu_lock is unnecessary now. Remove it.
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/therm_throt.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index e05dfa398dc2..d921b7ee6595 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c | |||
@@ -271,9 +271,6 @@ static void thermal_throttle_remove_dev(struct device *dev) | |||
271 | sysfs_remove_group(&dev->kobj, &thermal_attr_group); | 271 | sysfs_remove_group(&dev->kobj, &thermal_attr_group); |
272 | } | 272 | } |
273 | 273 | ||
274 | /* Mutex protecting device creation against CPU hotplug: */ | ||
275 | static DEFINE_MUTEX(therm_cpu_lock); | ||
276 | |||
277 | /* Get notified when a cpu comes on/off. Be hotplug friendly. */ | 274 | /* Get notified when a cpu comes on/off. Be hotplug friendly. */ |
278 | static int | 275 | static int |
279 | thermal_throttle_cpu_callback(struct notifier_block *nfb, | 276 | thermal_throttle_cpu_callback(struct notifier_block *nfb, |
@@ -289,18 +286,14 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb, | |||
289 | switch (action) { | 286 | switch (action) { |
290 | case CPU_UP_PREPARE: | 287 | case CPU_UP_PREPARE: |
291 | case CPU_UP_PREPARE_FROZEN: | 288 | case CPU_UP_PREPARE_FROZEN: |
292 | mutex_lock(&therm_cpu_lock); | ||
293 | err = thermal_throttle_add_dev(dev, cpu); | 289 | err = thermal_throttle_add_dev(dev, cpu); |
294 | mutex_unlock(&therm_cpu_lock); | ||
295 | WARN_ON(err); | 290 | WARN_ON(err); |
296 | break; | 291 | break; |
297 | case CPU_UP_CANCELED: | 292 | case CPU_UP_CANCELED: |
298 | case CPU_UP_CANCELED_FROZEN: | 293 | case CPU_UP_CANCELED_FROZEN: |
299 | case CPU_DEAD: | 294 | case CPU_DEAD: |
300 | case CPU_DEAD_FROZEN: | 295 | case CPU_DEAD_FROZEN: |
301 | mutex_lock(&therm_cpu_lock); | ||
302 | thermal_throttle_remove_dev(dev); | 296 | thermal_throttle_remove_dev(dev); |
303 | mutex_unlock(&therm_cpu_lock); | ||
304 | break; | 297 | break; |
305 | } | 298 | } |
306 | return notifier_from_errno(err); | 299 | return notifier_from_errno(err); |
@@ -321,17 +314,11 @@ static __init int thermal_throttle_init_device(void) | |||
321 | 314 | ||
322 | cpu_notifier_register_begin(); | 315 | cpu_notifier_register_begin(); |
323 | 316 | ||
324 | #ifdef CONFIG_HOTPLUG_CPU | ||
325 | mutex_lock(&therm_cpu_lock); | ||
326 | #endif | ||
327 | /* connect live CPUs to sysfs */ | 317 | /* connect live CPUs to sysfs */ |
328 | for_each_online_cpu(cpu) { | 318 | for_each_online_cpu(cpu) { |
329 | err = thermal_throttle_add_dev(get_cpu_device(cpu), cpu); | 319 | err = thermal_throttle_add_dev(get_cpu_device(cpu), cpu); |
330 | WARN_ON(err); | 320 | WARN_ON(err); |
331 | } | 321 | } |
332 | #ifdef CONFIG_HOTPLUG_CPU | ||
333 | mutex_unlock(&therm_cpu_lock); | ||
334 | #endif | ||
335 | 322 | ||
336 | __register_hotcpu_notifier(&thermal_throttle_cpu_notifier); | 323 | __register_hotcpu_notifier(&thermal_throttle_cpu_notifier); |
337 | cpu_notifier_register_done(); | 324 | cpu_notifier_register_done(); |