aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/powercap
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/powercap
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/powercap')
-rw-r--r--drivers/powercap/intel_rapl.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c
index 61b51e17d932..d9a0770b6c73 100644
--- a/drivers/powercap/intel_rapl.c
+++ b/drivers/powercap/intel_rapl.c
@@ -1374,6 +1374,9 @@ static int __init rapl_init(void)
1374 1374
1375 return -ENODEV; 1375 return -ENODEV;
1376 } 1376 }
1377
1378 cpu_notifier_register_begin();
1379
1377 /* prevent CPU hotplug during detection */ 1380 /* prevent CPU hotplug during detection */
1378 get_online_cpus(); 1381 get_online_cpus();
1379 ret = rapl_detect_topology(); 1382 ret = rapl_detect_topology();
@@ -1385,20 +1388,23 @@ static int __init rapl_init(void)
1385 ret = -ENODEV; 1388 ret = -ENODEV;
1386 goto done; 1389 goto done;
1387 } 1390 }
1388 register_hotcpu_notifier(&rapl_cpu_notifier); 1391 __register_hotcpu_notifier(&rapl_cpu_notifier);
1389done: 1392done:
1390 put_online_cpus(); 1393 put_online_cpus();
1394 cpu_notifier_register_done();
1391 1395
1392 return ret; 1396 return ret;
1393} 1397}
1394 1398
1395static void __exit rapl_exit(void) 1399static void __exit rapl_exit(void)
1396{ 1400{
1401 cpu_notifier_register_begin();
1397 get_online_cpus(); 1402 get_online_cpus();
1398 unregister_hotcpu_notifier(&rapl_cpu_notifier); 1403 __unregister_hotcpu_notifier(&rapl_cpu_notifier);
1399 rapl_unregister_powercap(); 1404 rapl_unregister_powercap();
1400 rapl_cleanup_data(); 1405 rapl_cleanup_data();
1401 put_online_cpus(); 1406 put_online_cpus();
1407 cpu_notifier_register_done();
1402} 1408}
1403 1409
1404module_init(rapl_init); 1410module_init(rapl_init);