diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2006-07-30 06:03:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-31 16:28:39 -0400 |
commit | be6b5a3505fa0cd54c3b5959a39293f47c648980 (patch) | |
tree | a7171d3dc5acf71c21f954b5c4f4906904873a0b /arch/x86_64 | |
parent | 7c7165c90801609b70492e50b2a9c69a677c573a (diff) |
[PATCH] cpu hotplug: use hotplug version of registration in late inits
Use hotplug version of register_cpu_notifier in late init functions.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64')
-rw-r--r-- | arch/x86_64/kernel/mce.c | 12 | ||||
-rw-r--r-- | arch/x86_64/kernel/mce_amd.c | 19 |
2 files changed, 12 insertions, 19 deletions
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index 88845674c661..4e017fb30fb3 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c | |||
@@ -615,7 +615,7 @@ static __cpuinit int mce_create_device(unsigned int cpu) | |||
615 | } | 615 | } |
616 | 616 | ||
617 | #ifdef CONFIG_HOTPLUG_CPU | 617 | #ifdef CONFIG_HOTPLUG_CPU |
618 | static __cpuinit void mce_remove_device(unsigned int cpu) | 618 | static void mce_remove_device(unsigned int cpu) |
619 | { | 619 | { |
620 | int i; | 620 | int i; |
621 | 621 | ||
@@ -626,10 +626,9 @@ static __cpuinit void mce_remove_device(unsigned int cpu) | |||
626 | sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval); | 626 | sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval); |
627 | sysdev_unregister(&per_cpu(device_mce,cpu)); | 627 | sysdev_unregister(&per_cpu(device_mce,cpu)); |
628 | } | 628 | } |
629 | #endif | ||
630 | 629 | ||
631 | /* Get notified when a cpu comes on/off. Be hotplug friendly. */ | 630 | /* Get notified when a cpu comes on/off. Be hotplug friendly. */ |
632 | static __cpuinit int | 631 | static int |
633 | mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | 632 | mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) |
634 | { | 633 | { |
635 | unsigned int cpu = (unsigned long)hcpu; | 634 | unsigned int cpu = (unsigned long)hcpu; |
@@ -638,18 +637,17 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
638 | case CPU_ONLINE: | 637 | case CPU_ONLINE: |
639 | mce_create_device(cpu); | 638 | mce_create_device(cpu); |
640 | break; | 639 | break; |
641 | #ifdef CONFIG_HOTPLUG_CPU | ||
642 | case CPU_DEAD: | 640 | case CPU_DEAD: |
643 | mce_remove_device(cpu); | 641 | mce_remove_device(cpu); |
644 | break; | 642 | break; |
645 | #endif | ||
646 | } | 643 | } |
647 | return NOTIFY_OK; | 644 | return NOTIFY_OK; |
648 | } | 645 | } |
649 | 646 | ||
650 | static struct notifier_block __cpuinitdata mce_cpu_notifier = { | 647 | static struct notifier_block mce_cpu_notifier = { |
651 | .notifier_call = mce_cpu_callback, | 648 | .notifier_call = mce_cpu_callback, |
652 | }; | 649 | }; |
650 | #endif | ||
653 | 651 | ||
654 | static __init int mce_init_device(void) | 652 | static __init int mce_init_device(void) |
655 | { | 653 | { |
@@ -664,7 +662,7 @@ static __init int mce_init_device(void) | |||
664 | mce_create_device(i); | 662 | mce_create_device(i); |
665 | } | 663 | } |
666 | 664 | ||
667 | register_cpu_notifier(&mce_cpu_notifier); | 665 | register_hotcpu_notifier(&mce_cpu_notifier); |
668 | misc_register(&mce_log_device); | 666 | misc_register(&mce_log_device); |
669 | return err; | 667 | return err; |
670 | } | 668 | } |
diff --git a/arch/x86_64/kernel/mce_amd.c b/arch/x86_64/kernel/mce_amd.c index db2acbf7ad28..883fe747f64c 100644 --- a/arch/x86_64/kernel/mce_amd.c +++ b/arch/x86_64/kernel/mce_amd.c | |||
@@ -558,7 +558,7 @@ out: | |||
558 | * of shared sysfs dir/files, and rest of the cores will be symlinked to it. | 558 | * of shared sysfs dir/files, and rest of the cores will be symlinked to it. |
559 | */ | 559 | */ |
560 | 560 | ||
561 | static __cpuinit void deallocate_threshold_block(unsigned int cpu, | 561 | static void deallocate_threshold_block(unsigned int cpu, |
562 | unsigned int bank) | 562 | unsigned int bank) |
563 | { | 563 | { |
564 | struct threshold_block *pos = NULL; | 564 | struct threshold_block *pos = NULL; |
@@ -578,7 +578,7 @@ static __cpuinit void deallocate_threshold_block(unsigned int cpu, | |||
578 | per_cpu(threshold_banks, cpu)[bank]->blocks = NULL; | 578 | per_cpu(threshold_banks, cpu)[bank]->blocks = NULL; |
579 | } | 579 | } |
580 | 580 | ||
581 | static __cpuinit void threshold_remove_bank(unsigned int cpu, int bank) | 581 | static void threshold_remove_bank(unsigned int cpu, int bank) |
582 | { | 582 | { |
583 | int i = 0; | 583 | int i = 0; |
584 | struct threshold_bank *b; | 584 | struct threshold_bank *b; |
@@ -618,7 +618,7 @@ free_out: | |||
618 | per_cpu(threshold_banks, cpu)[bank] = NULL; | 618 | per_cpu(threshold_banks, cpu)[bank] = NULL; |
619 | } | 619 | } |
620 | 620 | ||
621 | static __cpuinit void threshold_remove_device(unsigned int cpu) | 621 | static void threshold_remove_device(unsigned int cpu) |
622 | { | 622 | { |
623 | unsigned int bank; | 623 | unsigned int bank; |
624 | 624 | ||
@@ -629,14 +629,8 @@ static __cpuinit void threshold_remove_device(unsigned int cpu) | |||
629 | } | 629 | } |
630 | } | 630 | } |
631 | 631 | ||
632 | #else /* !CONFIG_HOTPLUG_CPU */ | ||
633 | static void threshold_remove_device(unsigned int cpu) | ||
634 | { | ||
635 | } | ||
636 | #endif | ||
637 | |||
638 | /* get notified when a cpu comes on/off */ | 632 | /* get notified when a cpu comes on/off */ |
639 | static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb, | 633 | static int threshold_cpu_callback(struct notifier_block *nfb, |
640 | unsigned long action, void *hcpu) | 634 | unsigned long action, void *hcpu) |
641 | { | 635 | { |
642 | /* cpu was unsigned int to begin with */ | 636 | /* cpu was unsigned int to begin with */ |
@@ -659,9 +653,10 @@ static int __cpuinit threshold_cpu_callback(struct notifier_block *nfb, | |||
659 | return NOTIFY_OK; | 653 | return NOTIFY_OK; |
660 | } | 654 | } |
661 | 655 | ||
662 | static struct notifier_block threshold_cpu_notifier __cpuinitdata = { | 656 | static struct notifier_block threshold_cpu_notifier = { |
663 | .notifier_call = threshold_cpu_callback, | 657 | .notifier_call = threshold_cpu_callback, |
664 | }; | 658 | }; |
659 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
665 | 660 | ||
666 | static __init int threshold_init_device(void) | 661 | static __init int threshold_init_device(void) |
667 | { | 662 | { |
@@ -673,7 +668,7 @@ static __init int threshold_init_device(void) | |||
673 | if (err) | 668 | if (err) |
674 | return err; | 669 | return err; |
675 | } | 670 | } |
676 | register_cpu_notifier(&threshold_cpu_notifier); | 671 | register_hotcpu_notifier(&threshold_cpu_notifier); |
677 | return 0; | 672 | return 0; |
678 | } | 673 | } |
679 | 674 | ||