diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:12:41 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:12:41 -0400 |
commit | 5c2aae8355f7ec1341d5c473c500a77bbfa7f701 (patch) | |
tree | bdb6059fbc1b476c36e7cda433fc4db64c627407 /arch/powerpc | |
parent | 3fbc4d63744b21ed6814ce768672531500bd3f14 (diff) | |
parent | 16ff816d3b5d2b81fcff5ca44eb9a98ac3b604b4 (diff) |
Merge branch 'acpi-hotplug'
* acpi-hotplug:
ACPI / memhotplug: Use defined marco METHOD_NAME__STA
ACPI / hotplug: Use kobject_init_and_add() instead of _init() and _add()
ACPI / hotplug: Don't set kobject parent pointer explicitly
ACPI / hotplug: Set kobject name via kobject_add(), not kobject_set_name()
hotplug, powerpc, x86: Remove cpu_hotplug_driver_lock()
hotplug / x86: Disable ARCH_CPU_PROBE_RELEASE on x86
hotplug / x86: Add hotplug lock to missing places
hotplug / x86: Fix online state in cpu0 debug interface
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/smp.c | 12 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/dlpar.c | 43 |
2 files changed, 16 insertions, 39 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 8e59abc237d7..930cd8af3503 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -844,18 +844,6 @@ void __cpu_die(unsigned int cpu) | |||
844 | smp_ops->cpu_die(cpu); | 844 | smp_ops->cpu_die(cpu); |
845 | } | 845 | } |
846 | 846 | ||
847 | static DEFINE_MUTEX(powerpc_cpu_hotplug_driver_mutex); | ||
848 | |||
849 | void cpu_hotplug_driver_lock() | ||
850 | { | ||
851 | mutex_lock(&powerpc_cpu_hotplug_driver_mutex); | ||
852 | } | ||
853 | |||
854 | void cpu_hotplug_driver_unlock() | ||
855 | { | ||
856 | mutex_unlock(&powerpc_cpu_hotplug_driver_mutex); | ||
857 | } | ||
858 | |||
859 | void cpu_die(void) | 847 | void cpu_die(void) |
860 | { | 848 | { |
861 | if (ppc_md.cpu_die) | 849 | if (ppc_md.cpu_die) |
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 7cfdaae1721a..a8fe5aa3d34f 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c | |||
@@ -404,46 +404,38 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count) | |||
404 | unsigned long drc_index; | 404 | unsigned long drc_index; |
405 | int rc; | 405 | int rc; |
406 | 406 | ||
407 | cpu_hotplug_driver_lock(); | ||
408 | rc = strict_strtoul(buf, 0, &drc_index); | 407 | rc = strict_strtoul(buf, 0, &drc_index); |
409 | if (rc) { | 408 | if (rc) |
410 | rc = -EINVAL; | 409 | return -EINVAL; |
411 | goto out; | ||
412 | } | ||
413 | 410 | ||
414 | parent = of_find_node_by_path("/cpus"); | 411 | parent = of_find_node_by_path("/cpus"); |
415 | if (!parent) { | 412 | if (!parent) |
416 | rc = -ENODEV; | 413 | return -ENODEV; |
417 | goto out; | ||
418 | } | ||
419 | 414 | ||
420 | dn = dlpar_configure_connector(drc_index, parent); | 415 | dn = dlpar_configure_connector(drc_index, parent); |
421 | if (!dn) { | 416 | if (!dn) |
422 | rc = -EINVAL; | 417 | return -EINVAL; |
423 | goto out; | ||
424 | } | ||
425 | 418 | ||
426 | of_node_put(parent); | 419 | of_node_put(parent); |
427 | 420 | ||
428 | rc = dlpar_acquire_drc(drc_index); | 421 | rc = dlpar_acquire_drc(drc_index); |
429 | if (rc) { | 422 | if (rc) { |
430 | dlpar_free_cc_nodes(dn); | 423 | dlpar_free_cc_nodes(dn); |
431 | rc = -EINVAL; | 424 | return -EINVAL; |
432 | goto out; | ||
433 | } | 425 | } |
434 | 426 | ||
435 | rc = dlpar_attach_node(dn); | 427 | rc = dlpar_attach_node(dn); |
436 | if (rc) { | 428 | if (rc) { |
437 | dlpar_release_drc(drc_index); | 429 | dlpar_release_drc(drc_index); |
438 | dlpar_free_cc_nodes(dn); | 430 | dlpar_free_cc_nodes(dn); |
439 | goto out; | 431 | return rc; |
440 | } | 432 | } |
441 | 433 | ||
442 | rc = dlpar_online_cpu(dn); | 434 | rc = dlpar_online_cpu(dn); |
443 | out: | 435 | if (rc) |
444 | cpu_hotplug_driver_unlock(); | 436 | return rc; |
445 | 437 | ||
446 | return rc ? rc : count; | 438 | return count; |
447 | } | 439 | } |
448 | 440 | ||
449 | static int dlpar_offline_cpu(struct device_node *dn) | 441 | static int dlpar_offline_cpu(struct device_node *dn) |
@@ -516,30 +508,27 @@ static ssize_t dlpar_cpu_release(const char *buf, size_t count) | |||
516 | return -EINVAL; | 508 | return -EINVAL; |
517 | } | 509 | } |
518 | 510 | ||
519 | cpu_hotplug_driver_lock(); | ||
520 | rc = dlpar_offline_cpu(dn); | 511 | rc = dlpar_offline_cpu(dn); |
521 | if (rc) { | 512 | if (rc) { |
522 | of_node_put(dn); | 513 | of_node_put(dn); |
523 | rc = -EINVAL; | 514 | return -EINVAL; |
524 | goto out; | ||
525 | } | 515 | } |
526 | 516 | ||
527 | rc = dlpar_release_drc(*drc_index); | 517 | rc = dlpar_release_drc(*drc_index); |
528 | if (rc) { | 518 | if (rc) { |
529 | of_node_put(dn); | 519 | of_node_put(dn); |
530 | goto out; | 520 | return rc; |
531 | } | 521 | } |
532 | 522 | ||
533 | rc = dlpar_detach_node(dn); | 523 | rc = dlpar_detach_node(dn); |
534 | if (rc) { | 524 | if (rc) { |
535 | dlpar_acquire_drc(*drc_index); | 525 | dlpar_acquire_drc(*drc_index); |
536 | goto out; | 526 | return rc; |
537 | } | 527 | } |
538 | 528 | ||
539 | of_node_put(dn); | 529 | of_node_put(dn); |
540 | out: | 530 | |
541 | cpu_hotplug_driver_unlock(); | 531 | return count; |
542 | return rc ? rc : count; | ||
543 | } | 532 | } |
544 | 533 | ||
545 | static int __init pseries_dlpar_init(void) | 534 | static int __init pseries_dlpar_init(void) |