提交 abb17f9c 编写于 作者: M Milton Miller 提交者: Benjamin Herrenschmidt

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: NMatt Sealey <matt@genesi-usa.com>
Reported-by: NKumar Gala <galak@kernel.crashing.org>
Signed-off-by: NMilton Miller <miltonm@bga.com>
Signed-off-by: NAnton Vorontsov <avorontsov@mvista.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 ca5d0674
...@@ -573,12 +573,6 @@ void ppc64_boot_msg(unsigned int src, const char *msg) ...@@ -573,12 +573,6 @@ void ppc64_boot_msg(unsigned int src, const char *msg)
printk("[boot]%04x %s\n", src, msg); printk("[boot]%04x %s\n", src, msg);
} }
void cpu_die(void)
{
if (ppc_md.cpu_die)
ppc_md.cpu_die();
}
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#define PCPU_DYN_SIZE () #define PCPU_DYN_SIZE ()
......
...@@ -648,4 +648,10 @@ void cpu_hotplug_driver_unlock() ...@@ -648,4 +648,10 @@ void cpu_hotplug_driver_unlock()
{ {
mutex_unlock(&powerpc_cpu_hotplug_driver_mutex); mutex_unlock(&powerpc_cpu_hotplug_driver_mutex);
} }
void cpu_die(void)
{
if (ppc_md.cpu_die)
ppc_md.cpu_die();
}
#endif #endif
...@@ -33,6 +33,8 @@ extern void pmac_setup_pci_dma(void); ...@@ -33,6 +33,8 @@ extern void pmac_setup_pci_dma(void);
extern void pmac_check_ht_link(void); extern void pmac_check_ht_link(void);
extern void pmac_setup_smp(void); extern void pmac_setup_smp(void);
extern void pmac32_cpu_die(void);
extern void low_cpu_die(void) __attribute__((noreturn));
extern int pmac_nvram_init(void); extern int pmac_nvram_init(void);
extern void pmac_pic_init(void); extern void pmac_pic_init(void);
......
...@@ -646,7 +646,7 @@ static int pmac_pci_probe_mode(struct pci_bus *bus) ...@@ -646,7 +646,7 @@ static int pmac_pci_probe_mode(struct pci_bus *bus)
/* access per cpu vars from generic smp.c */ /* access per cpu vars from generic smp.c */
DECLARE_PER_CPU(int, cpu_state); DECLARE_PER_CPU(int, cpu_state);
static void pmac_cpu_die(void) static void pmac64_cpu_die(void)
{ {
/* /*
* turn off as much as possible, we'll be * turn off as much as possible, we'll be
...@@ -717,8 +717,13 @@ define_machine(powermac) { ...@@ -717,8 +717,13 @@ define_machine(powermac) {
.pcibios_after_init = pmac_pcibios_after_init, .pcibios_after_init = pmac_pcibios_after_init,
.phys_mem_access_prot = pci_phys_mem_access_prot, .phys_mem_access_prot = pci_phys_mem_access_prot,
#endif #endif
#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC64) #ifdef CONFIG_HOTPLUG_CPU
.cpu_die = pmac_cpu_die, #ifdef CONFIG_PPC64
.cpu_die = pmac64_cpu_die,
#endif
#ifdef CONFIG_PPC32
.cpu_die = pmac32_cpu_die,
#endif
#endif #endif
#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32) #if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PPC32)
.cpu_die = generic_mach_cpu_die, .cpu_die = generic_mach_cpu_die,
......
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
#include <asm/pmac_low_i2c.h> #include <asm/pmac_low_i2c.h>
#include <asm/pmac_pfunc.h> #include <asm/pmac_pfunc.h>
#include "pmac.h"
#undef DEBUG #undef DEBUG
#ifdef DEBUG #ifdef DEBUG
...@@ -878,10 +880,9 @@ int smp_core99_cpu_disable(void) ...@@ -878,10 +880,9 @@ int smp_core99_cpu_disable(void)
return 0; return 0;
} }
extern void low_cpu_die(void) __attribute__((noreturn)); /* in sleep.S */
static int cpu_dead[NR_CPUS]; static int cpu_dead[NR_CPUS];
void cpu_die(void) void pmac32_cpu_die(void)
{ {
local_irq_disable(); local_irq_disable();
cpu_dead[smp_processor_id()] = 1; cpu_dead[smp_processor_id()] = 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册