diff options
author | Milton Miller <miltonm@bga.com> | 2010-05-18 22:56:29 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-21 03:31:08 -0400 |
commit | abb17f9c3a92c5acf30e749efdf0419b7f50a5b8 (patch) | |
tree | 8b3999693decdb214c93c567e390afcec93445fe /arch | |
parent | ca5d0674c37840366f04a7bbfbf78e7b5f3ce0a4 (diff) |
powerpc: Use common cpu_die (fixes SMP+SUSPEND build)
Configuring a powerpc 32 bit kernel for both SMP and SUSPEND turns on
CPU_HOTPLUG to enable disable_nonboot_cpus to be called by the common
suspend code. Previously the definition of cpu_die for ppc32 was in
the powermac platform code, causing it to be undefined if that platform
as not selected.
arch/powerpc/kernel/built-in.o: In function 'cpu_idle':
arch/powerpc/kernel/idle.c:98: undefined reference to 'cpu_die'
Move the code from setup_64 to smp.c and rename the power mac
versions to their specific names.
Note that this does not setup the cpu_die pointers in either
smp_ops (request a given cpu die) or ppc_md (make this cpu die),
for other platforms but there are generic versions in smp.c.
Reported-by: Matt Sealey <matt@genesi-usa.com>
Reported-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/smp.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/pmac.h | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/smp.c | 5 |
5 files changed, 19 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 914389158a9b..cea66987a6ea 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -573,12 +573,6 @@ void ppc64_boot_msg(unsigned int src, const char *msg) | |||
573 | printk("[boot]%04x %s\n", src, msg); | 573 | printk("[boot]%04x %s\n", src, msg); |
574 | } | 574 | } |
575 | 575 | ||
576 | void cpu_die(void) | ||
577 | { | ||
578 | if (ppc_md.cpu_die) | ||
579 | ppc_md.cpu_die(); | ||
580 | } | ||
581 | |||
582 | #ifdef CONFIG_SMP | 576 | #ifdef CONFIG_SMP |
583 | #define PCPU_DYN_SIZE () | 577 | #define PCPU_DYN_SIZE () |
584 | 578 | ||
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index bf366167d369..5c196d1086d9 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -648,4 +648,10 @@ void cpu_hotplug_driver_unlock() | |||
648 | { | 648 | { |
649 | mutex_unlock(&powerpc_cpu_hotplug_driver_mutex); | 649 | mutex_unlock(&powerpc_cpu_hotplug_driver_mutex); |
650 | } | 650 | } |
651 | |||
652 | void cpu_die(void) | ||
653 | { | ||
654 | if (ppc_md.cpu_die) | ||
655 | ppc_md.cpu_die(); | ||
656 | } | ||
651 | #endif | 657 | #endif |
diff --git a/arch/powerpc/platforms/powermac/pmac.h b/arch/powerpc/platforms/powermac/pmac.h index 3362e781b6a7..f0bc08f6c1f0 100644 --- a/arch/powerpc/platforms/powermac/pmac.h +++ b/arch/powerpc/platforms/powermac/pmac.h | |||
@@ -33,6 +33,8 @@ extern void pmac_setup_pci_dma(void); | |||
33 | extern void pmac_check_ht_link(void); | 33 | extern void pmac_check_ht_link(void); |
34 | 34 | ||
35 | extern void pmac_setup_smp(void); | 35 | extern void pmac_setup_smp(void); |
36 | extern void pmac32_cpu_die(void); | ||
37 | extern void low_cpu_die(void) __attribute__((noreturn)); | ||
36 | 38 | ||
37 | extern int pmac_nvram_init(void); | 39 | extern int pmac_nvram_init(void); |
38 | extern void pmac_pic_init(void); | 40 | extern void pmac_pic_init(void); |
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 47a2b4488557..f1d0132ebcc7 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -646,7 +646,7 @@ static int pmac_pci_probe_mode(struct pci_bus *bus) | |||
646 | /* access per cpu vars from generic smp.c */ | 646 | /* access per cpu vars from generic smp.c */ |
647 | DECLARE_PER_CPU(int, cpu_state); | 647 | DECLARE_PER_CPU(int, cpu_state); |
648 | 648 | ||
649 | static void pmac_cpu_die(void) | 649 | static void pmac64_cpu_die(void) |
650 | { | 650 | { |
651 | /* | 651 | /* |
652 | * turn off as much as possible, we'll be | 652 | * turn off as much as possible, we'll be |
@@ -717,8 +717,13 @@ define_machine(powermac) { | |||
717 | .pcibios_after_init = pmac_pcibios_after_init, | 717 | .pcibios_after_init = pmac_pcibios_after_init, |
718 | .phys_mem_access_prot = pci_phys_mem_access_prot, | 718 | .phys_mem_access_prot = pci_phys_mem_access_prot, |
719 | #endif | 719 | #endif |
720 | #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) | 720 | #ifdef CONFIG_HOTPLUG_CPU |
721 | .cpu_die = pmac_cpu_die, | 721 | #ifdef CONFIG_PPC64 |
722 | .cpu_die = pmac64_cpu_die, | ||
723 | #endif | ||
724 | #ifdef CONFIG_PPC32 | ||
725 | .cpu_die = pmac32_cpu_die, | ||
726 | #endif | ||
722 | #endif | 727 | #endif |
723 | #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32) | 728 | #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32) |
724 | .cpu_die = generic_mach_cpu_die, | 729 | .cpu_die = generic_mach_cpu_die, |
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 02d0b8e5b13c..c95215f4f8b6 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
@@ -53,6 +53,8 @@ | |||
53 | #include <asm/pmac_low_i2c.h> | 53 | #include <asm/pmac_low_i2c.h> |
54 | #include <asm/pmac_pfunc.h> | 54 | #include <asm/pmac_pfunc.h> |
55 | 55 | ||
56 | #include "pmac.h" | ||
57 | |||
56 | #undef DEBUG | 58 | #undef DEBUG |
57 | 59 | ||
58 | #ifdef DEBUG | 60 | #ifdef DEBUG |
@@ -878,10 +880,9 @@ int smp_core99_cpu_disable(void) | |||
878 | return 0; | 880 | return 0; |
879 | } | 881 | } |
880 | 882 | ||
881 | extern void low_cpu_die(void) __attribute__((noreturn)); /* in sleep.S */ | ||
882 | static int cpu_dead[NR_CPUS]; | 883 | static int cpu_dead[NR_CPUS]; |
883 | 884 | ||
884 | void cpu_die(void) | 885 | void pmac32_cpu_die(void) |
885 | { | 886 | { |
886 | local_irq_disable(); | 887 | local_irq_disable(); |
887 | cpu_dead[smp_processor_id()] = 1; | 888 | cpu_dead[smp_processor_id()] = 1; |