aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 17:55:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-07 17:55:46 -0400
commit467a9e1633043810259a7f5368fbcc1e84746137 (patch)
treec8a5bfd2a65455d7f6a59b312e348e069375bd9b /drivers/hwmon
parentb8780c363d808a726a34793caa900923d32b6b80 (diff)
parenta0e247a8059223593f9c5c3d5c1fd50eedf415c0 (diff)
Merge tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull CPU hotplug notifiers registration fixes from Rafael Wysocki: "The purpose of this single series of commits from Srivatsa S Bhat (with a small piece from Gautham R Shenoy) touching multiple subsystems that use CPU hotplug notifiers is to provide a way to register them that will not lead to deadlocks with CPU online/offline operations as described in the changelog of commit 93ae4f978ca7f ("CPU hotplug: Provide lockless versions of callback registration functions"). The first three commits in the series introduce the API and document it and the rest simply goes through the users of CPU hotplug notifiers and converts them to using the new method" * tag 'cpu-hotplug-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (52 commits) net/iucv/iucv.c: Fix CPU hotplug callback registration net/core/flow.c: Fix CPU hotplug callback registration mm, zswap: Fix CPU hotplug callback registration mm, vmstat: Fix CPU hotplug callback registration profile: Fix CPU hotplug callback registration trace, ring-buffer: Fix CPU hotplug callback registration xen, balloon: Fix CPU hotplug callback registration hwmon, via-cputemp: Fix CPU hotplug callback registration hwmon, coretemp: Fix CPU hotplug callback registration thermal, x86-pkg-temp: Fix CPU hotplug callback registration octeon, watchdog: Fix CPU hotplug callback registration oprofile, nmi-timer: Fix CPU hotplug callback registration intel-idle: Fix CPU hotplug callback registration clocksource, dummy-timer: Fix CPU hotplug callback registration drivers/base/topology.c: Fix CPU hotplug callback registration acpi-cpufreq: Fix CPU hotplug callback registration zsmalloc: Fix CPU hotplug callback registration scsi, fcoe: Fix CPU hotplug callback registration scsi, bnx2fc: Fix CPU hotplug callback registration scsi, bnx2i: Fix CPU hotplug callback registration ...
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/coretemp.c14
-rw-r--r--drivers/hwmon/via-cputemp.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index f31bc4c48644..6d02e3b06375 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -810,20 +810,20 @@ static int __init coretemp_init(void)
810 if (err) 810 if (err)
811 goto exit; 811 goto exit;
812 812
813 get_online_cpus(); 813 cpu_notifier_register_begin();
814 for_each_online_cpu(i) 814 for_each_online_cpu(i)
815 get_core_online(i); 815 get_core_online(i);
816 816
817#ifndef CONFIG_HOTPLUG_CPU 817#ifndef CONFIG_HOTPLUG_CPU
818 if (list_empty(&pdev_list)) { 818 if (list_empty(&pdev_list)) {
819 put_online_cpus(); 819 cpu_notifier_register_done();
820 err = -ENODEV; 820 err = -ENODEV;
821 goto exit_driver_unreg; 821 goto exit_driver_unreg;
822 } 822 }
823#endif 823#endif
824 824
825 register_hotcpu_notifier(&coretemp_cpu_notifier); 825 __register_hotcpu_notifier(&coretemp_cpu_notifier);
826 put_online_cpus(); 826 cpu_notifier_register_done();
827 return 0; 827 return 0;
828 828
829#ifndef CONFIG_HOTPLUG_CPU 829#ifndef CONFIG_HOTPLUG_CPU
@@ -838,8 +838,8 @@ static void __exit coretemp_exit(void)
838{ 838{
839 struct pdev_entry *p, *n; 839 struct pdev_entry *p, *n;
840 840
841 get_online_cpus(); 841 cpu_notifier_register_begin();
842 unregister_hotcpu_notifier(&coretemp_cpu_notifier); 842 __unregister_hotcpu_notifier(&coretemp_cpu_notifier);
843 mutex_lock(&pdev_list_mutex); 843 mutex_lock(&pdev_list_mutex);
844 list_for_each_entry_safe(p, n, &pdev_list, list) { 844 list_for_each_entry_safe(p, n, &pdev_list, list) {
845 platform_device_unregister(p->pdev); 845 platform_device_unregister(p->pdev);
@@ -847,7 +847,7 @@ static void __exit coretemp_exit(void)
847 kfree(p); 847 kfree(p);
848 } 848 }
849 mutex_unlock(&pdev_list_mutex); 849 mutex_unlock(&pdev_list_mutex);
850 put_online_cpus(); 850 cpu_notifier_register_done();
851 platform_driver_unregister(&coretemp_driver); 851 platform_driver_unregister(&coretemp_driver);
852} 852}
853 853
diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c
index 38944e94f65f..8df43c51de2c 100644
--- a/drivers/hwmon/via-cputemp.c
+++ b/drivers/hwmon/via-cputemp.c
@@ -319,7 +319,7 @@ static int __init via_cputemp_init(void)
319 if (err) 319 if (err)
320 goto exit; 320 goto exit;
321 321
322 get_online_cpus(); 322 cpu_notifier_register_begin();
323 for_each_online_cpu(i) { 323 for_each_online_cpu(i) {
324 struct cpuinfo_x86 *c = &cpu_data(i); 324 struct cpuinfo_x86 *c = &cpu_data(i);
325 325
@@ -339,14 +339,14 @@ static int __init via_cputemp_init(void)
339 339
340#ifndef CONFIG_HOTPLUG_CPU 340#ifndef CONFIG_HOTPLUG_CPU
341 if (list_empty(&pdev_list)) { 341 if (list_empty(&pdev_list)) {
342 put_online_cpus(); 342 cpu_notifier_register_done();
343 err = -ENODEV; 343 err = -ENODEV;
344 goto exit_driver_unreg; 344 goto exit_driver_unreg;
345 } 345 }
346#endif 346#endif
347 347
348 register_hotcpu_notifier(&via_cputemp_cpu_notifier); 348 __register_hotcpu_notifier(&via_cputemp_cpu_notifier);
349 put_online_cpus(); 349 cpu_notifier_register_done();
350 return 0; 350 return 0;
351 351
352#ifndef CONFIG_HOTPLUG_CPU 352#ifndef CONFIG_HOTPLUG_CPU
@@ -361,8 +361,8 @@ static void __exit via_cputemp_exit(void)
361{ 361{
362 struct pdev_entry *p, *n; 362 struct pdev_entry *p, *n;
363 363
364 get_online_cpus(); 364 cpu_notifier_register_begin();
365 unregister_hotcpu_notifier(&via_cputemp_cpu_notifier); 365 __unregister_hotcpu_notifier(&via_cputemp_cpu_notifier);
366 mutex_lock(&pdev_list_mutex); 366 mutex_lock(&pdev_list_mutex);
367 list_for_each_entry_safe(p, n, &pdev_list, list) { 367 list_for_each_entry_safe(p, n, &pdev_list, list) {
368 platform_device_unregister(p->pdev); 368 platform_device_unregister(p->pdev);
@@ -370,7 +370,7 @@ static void __exit via_cputemp_exit(void)
370 kfree(p); 370 kfree(p);
371 } 371 }
372 mutex_unlock(&pdev_list_mutex); 372 mutex_unlock(&pdev_list_mutex);
373 put_online_cpus(); 373 cpu_notifier_register_done();
374 platform_driver_unregister(&via_cputemp_driver); 374 platform_driver_unregister(&via_cputemp_driver);
375} 375}
376 376