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 | |
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')
-rw-r--r-- | arch/i386/kernel/cpu/intel_cacheinfo.c | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/palinfo.c | 13 | ||||
-rw-r--r-- | arch/ia64/kernel/topology.c | 2 | ||||
-rw-r--r-- | arch/s390/appldata/appldata_base.c | 10 | ||||
-rw-r--r-- | arch/x86_64/kernel/mce.c | 12 | ||||
-rw-r--r-- | arch/x86_64/kernel/mce_amd.c | 19 |
6 files changed, 25 insertions, 33 deletions
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c index e9f0b928b0a9..5c43be47587f 100644 --- a/arch/i386/kernel/cpu/intel_cacheinfo.c +++ b/arch/i386/kernel/cpu/intel_cacheinfo.c | |||
@@ -759,7 +759,7 @@ static int __cpuinit cache_sysfs_init(void) | |||
759 | if (num_cache_leaves == 0) | 759 | if (num_cache_leaves == 0) |
760 | return 0; | 760 | return 0; |
761 | 761 | ||
762 | register_cpu_notifier(&cacheinfo_cpu_notifier); | 762 | register_hotcpu_notifier(&cacheinfo_cpu_notifier); |
763 | 763 | ||
764 | for_each_online_cpu(i) { | 764 | for_each_online_cpu(i) { |
765 | cacheinfo_cpu_callback(&cacheinfo_cpu_notifier, CPU_ONLINE, | 765 | cacheinfo_cpu_callback(&cacheinfo_cpu_notifier, CPU_ONLINE, |
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index 3f5bac59209a..ab5b52413e91 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c | |||
@@ -958,9 +958,9 @@ remove_palinfo_proc_entries(unsigned int hcpu) | |||
958 | } | 958 | } |
959 | } | 959 | } |
960 | 960 | ||
961 | static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb, | 961 | #ifdef CONFIG_HOTPLUG_CPU |
962 | unsigned long action, | 962 | static int palinfo_cpu_callback(struct notifier_block *nfb, |
963 | void *hcpu) | 963 | unsigned long action, void *hcpu) |
964 | { | 964 | { |
965 | unsigned int hotcpu = (unsigned long)hcpu; | 965 | unsigned int hotcpu = (unsigned long)hcpu; |
966 | 966 | ||
@@ -968,20 +968,19 @@ static int __cpuinit palinfo_cpu_callback(struct notifier_block *nfb, | |||
968 | case CPU_ONLINE: | 968 | case CPU_ONLINE: |
969 | create_palinfo_proc_entries(hotcpu); | 969 | create_palinfo_proc_entries(hotcpu); |
970 | break; | 970 | break; |
971 | #ifdef CONFIG_HOTPLUG_CPU | ||
972 | case CPU_DEAD: | 971 | case CPU_DEAD: |
973 | remove_palinfo_proc_entries(hotcpu); | 972 | remove_palinfo_proc_entries(hotcpu); |
974 | break; | 973 | break; |
975 | #endif | ||
976 | } | 974 | } |
977 | return NOTIFY_OK; | 975 | return NOTIFY_OK; |
978 | } | 976 | } |
979 | 977 | ||
980 | static struct notifier_block __cpuinitdata palinfo_cpu_notifier = | 978 | static struct notifier_block palinfo_cpu_notifier = |
981 | { | 979 | { |
982 | .notifier_call = palinfo_cpu_callback, | 980 | .notifier_call = palinfo_cpu_callback, |
983 | .priority = 0, | 981 | .priority = 0, |
984 | }; | 982 | }; |
983 | #endif | ||
985 | 984 | ||
986 | static int __init | 985 | static int __init |
987 | palinfo_init(void) | 986 | palinfo_init(void) |
@@ -1020,7 +1019,7 @@ palinfo_exit(void) | |||
1020 | /* | 1019 | /* |
1021 | * Unregister from cpu notifier callbacks | 1020 | * Unregister from cpu notifier callbacks |
1022 | */ | 1021 | */ |
1023 | unregister_cpu_notifier(&palinfo_cpu_notifier); | 1022 | unregister_hotcpu_notifier(&palinfo_cpu_notifier); |
1024 | } | 1023 | } |
1025 | 1024 | ||
1026 | module_init(palinfo_init); | 1025 | module_init(palinfo_init); |
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index b146f1cfad31..d24fa393b182 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c | |||
@@ -435,7 +435,7 @@ static int __cpuinit cache_sysfs_init(void) | |||
435 | (void *)(long)i); | 435 | (void *)(long)i); |
436 | } | 436 | } |
437 | 437 | ||
438 | register_cpu_notifier(&cache_cpu_notifier); | 438 | register_hotcpu_notifier(&cache_cpu_notifier); |
439 | 439 | ||
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index d0f82c995af6..6a4b5f9715c9 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c | |||
@@ -617,7 +617,8 @@ appldata_offline_cpu(int cpu) | |||
617 | spin_unlock(&appldata_timer_lock); | 617 | spin_unlock(&appldata_timer_lock); |
618 | } | 618 | } |
619 | 619 | ||
620 | static int __cpuinit | 620 | #ifdef CONFIG_HOTPLUG_CPU |
621 | static int | ||
621 | appldata_cpu_notify(struct notifier_block *self, | 622 | appldata_cpu_notify(struct notifier_block *self, |
622 | unsigned long action, void *hcpu) | 623 | unsigned long action, void *hcpu) |
623 | { | 624 | { |
@@ -625,20 +626,19 @@ appldata_cpu_notify(struct notifier_block *self, | |||
625 | case CPU_ONLINE: | 626 | case CPU_ONLINE: |
626 | appldata_online_cpu((long) hcpu); | 627 | appldata_online_cpu((long) hcpu); |
627 | break; | 628 | break; |
628 | #ifdef CONFIG_HOTPLUG_CPU | ||
629 | case CPU_DEAD: | 629 | case CPU_DEAD: |
630 | appldata_offline_cpu((long) hcpu); | 630 | appldata_offline_cpu((long) hcpu); |
631 | break; | 631 | break; |
632 | #endif | ||
633 | default: | 632 | default: |
634 | break; | 633 | break; |
635 | } | 634 | } |
636 | return NOTIFY_OK; | 635 | return NOTIFY_OK; |
637 | } | 636 | } |
638 | 637 | ||
639 | static struct notifier_block __devinitdata appldata_nb = { | 638 | static struct notifier_block appldata_nb = { |
640 | .notifier_call = appldata_cpu_notify, | 639 | .notifier_call = appldata_cpu_notify, |
641 | }; | 640 | }; |
641 | #endif | ||
642 | 642 | ||
643 | /* | 643 | /* |
644 | * appldata_init() | 644 | * appldata_init() |
@@ -662,7 +662,7 @@ static int __init appldata_init(void) | |||
662 | appldata_online_cpu(i); | 662 | appldata_online_cpu(i); |
663 | 663 | ||
664 | /* Register cpu hotplug notifier */ | 664 | /* Register cpu hotplug notifier */ |
665 | register_cpu_notifier(&appldata_nb); | 665 | register_hotcpu_notifier(&appldata_nb); |
666 | 666 | ||
667 | appldata_sysctl_header = register_sysctl_table(appldata_dir_table, 1); | 667 | appldata_sysctl_header = register_sysctl_table(appldata_dir_table, 1); |
668 | #ifdef MODULE | 668 | #ifdef MODULE |
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 | ||