powerpc: kill useless SMT code in prom_hold_cpus
This piece of code is broken for >2 threads, and possibly in some other subtle ways (such as comparing a value obtained from an "ibm,ppc-interrupt-server#s" property to a value obtained from a "reg" property) and doesn't seem to have any useful purpose in the first place other than a dubious warning in case NR_CPUS is too small, which probably isn't the right place to do so. Signed-off-by: Nathan Lynch <ntl@pobox.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
ff8dc7698c
commit
7d2f6075f9
|
@ -205,8 +205,6 @@ static int __initdata mem_reserve_cnt;
|
||||||
static cell_t __initdata regbuf[1024];
|
static cell_t __initdata regbuf[1024];
|
||||||
|
|
||||||
|
|
||||||
#define MAX_CPU_THREADS 2
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Error results ... some OF calls will return "-1" on error, some
|
* Error results ... some OF calls will return "-1" on error, some
|
||||||
* will return 0, some will return either. To simplify, here are
|
* will return 0, some will return either. To simplify, here are
|
||||||
|
@ -1339,10 +1337,6 @@ static void __init prom_hold_cpus(void)
|
||||||
unsigned int reg;
|
unsigned int reg;
|
||||||
phandle node;
|
phandle node;
|
||||||
char type[64];
|
char type[64];
|
||||||
int cpuid = 0;
|
|
||||||
unsigned int interrupt_server[MAX_CPU_THREADS];
|
|
||||||
unsigned int cpu_threads, hw_cpu_num;
|
|
||||||
int propsize;
|
|
||||||
struct prom_t *_prom = &RELOC(prom);
|
struct prom_t *_prom = &RELOC(prom);
|
||||||
unsigned long *spinloop
|
unsigned long *spinloop
|
||||||
= (void *) LOW_ADDR(__secondary_hold_spinloop);
|
= (void *) LOW_ADDR(__secondary_hold_spinloop);
|
||||||
|
@ -1386,7 +1380,6 @@ static void __init prom_hold_cpus(void)
|
||||||
reg = -1;
|
reg = -1;
|
||||||
prom_getprop(node, "reg", ®, sizeof(reg));
|
prom_getprop(node, "reg", ®, sizeof(reg));
|
||||||
|
|
||||||
prom_debug("\ncpuid = 0x%x\n", cpuid);
|
|
||||||
prom_debug("cpu hw idx = 0x%x\n", reg);
|
prom_debug("cpu hw idx = 0x%x\n", reg);
|
||||||
|
|
||||||
/* Init the acknowledge var which will be reset by
|
/* Init the acknowledge var which will be reset by
|
||||||
|
@ -1395,28 +1388,9 @@ static void __init prom_hold_cpus(void)
|
||||||
*/
|
*/
|
||||||
*acknowledge = (unsigned long)-1;
|
*acknowledge = (unsigned long)-1;
|
||||||
|
|
||||||
propsize = prom_getprop(node, "ibm,ppc-interrupt-server#s",
|
if (reg != _prom->cpu) {
|
||||||
&interrupt_server,
|
|
||||||
sizeof(interrupt_server));
|
|
||||||
if (propsize < 0) {
|
|
||||||
/* no property. old hardware has no SMT */
|
|
||||||
cpu_threads = 1;
|
|
||||||
interrupt_server[0] = reg; /* fake it with phys id */
|
|
||||||
} else {
|
|
||||||
/* We have a threaded processor */
|
|
||||||
cpu_threads = propsize / sizeof(u32);
|
|
||||||
if (cpu_threads > MAX_CPU_THREADS) {
|
|
||||||
prom_printf("SMT: too many threads!\n"
|
|
||||||
"SMT: found %x, max is %x\n",
|
|
||||||
cpu_threads, MAX_CPU_THREADS);
|
|
||||||
cpu_threads = 1; /* ToDo: panic? */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hw_cpu_num = interrupt_server[0];
|
|
||||||
if (hw_cpu_num != _prom->cpu) {
|
|
||||||
/* Primary Thread of non-boot cpu */
|
/* Primary Thread of non-boot cpu */
|
||||||
prom_printf("%x : starting cpu hw idx %x... ", cpuid, reg);
|
prom_printf("starting cpu hw idx %x... ", reg);
|
||||||
call_prom("start-cpu", 3, 0, node,
|
call_prom("start-cpu", 3, 0, node,
|
||||||
secondary_hold, reg);
|
secondary_hold, reg);
|
||||||
|
|
||||||
|
@ -1431,17 +1405,10 @@ static void __init prom_hold_cpus(void)
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
else
|
else
|
||||||
prom_printf("%x : boot cpu %x\n", cpuid, reg);
|
prom_printf("boot cpu hw idx %x\n", reg);
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
/* Reserve cpu #s for secondary threads. They start later. */
|
|
||||||
cpuid += cpu_threads;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cpuid > NR_CPUS)
|
|
||||||
prom_printf("WARNING: maximum CPUs (" __stringify(NR_CPUS)
|
|
||||||
") exceeded: ignoring extras\n");
|
|
||||||
|
|
||||||
prom_debug("prom_hold_cpus: end...\n");
|
prom_debug("prom_hold_cpus: end...\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue