PowerNV: correctly start secondary CPUs
Fix AP startup, which was broken. Created by: Nathan Whitehorn <nwhitehorn@freebsd.org> Submitted by: Wojciech Macek <wma@freebsd.org> Sponsored by: FreeBSD Foundation
This commit is contained in:
parent
999af6c5ea
commit
2c77116bf2
@ -71,6 +71,7 @@ static int powernv_smp_start_cpu(platform_t, struct pcpu *cpu);
|
||||
static struct cpu_group *powernv_smp_topo(platform_t plat);
|
||||
#endif
|
||||
static void powernv_reset(platform_t);
|
||||
static void powernv_cpu_idle(sbintime_t sbt);
|
||||
|
||||
static platform_method_t powernv_methods[] = {
|
||||
PLATFORMMETHOD(platform_probe, powernv_probe),
|
||||
@ -115,6 +116,8 @@ powernv_attach(platform_t plat)
|
||||
/* Ping OPAL again just to make sure */
|
||||
opal_check();
|
||||
|
||||
cpu_idle_hook = powernv_cpu_idle;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -270,23 +273,19 @@ powernv_smp_get_bsp(platform_t plat, struct cpuref *cpuref)
|
||||
static int
|
||||
powernv_smp_start_cpu(platform_t plat, struct pcpu *pc)
|
||||
{
|
||||
int result, err, timeout;
|
||||
int result;
|
||||
|
||||
ap_pcpu = pc;
|
||||
powerpc_sync();
|
||||
|
||||
result = opal_call(OPAL_START_CPU, pc->pc_cpuid, EXC_RST);
|
||||
if (result < 0 || err != 0) {
|
||||
printf("OPAL error (%d/%d): unable to start AP %d\n",
|
||||
result, err, pc->pc_cpuid);
|
||||
if (result != OPAL_SUCCESS) {
|
||||
printf("OPAL error (%d): unable to start AP %d\n",
|
||||
result, pc->pc_cpuid);
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
timeout = 10000;
|
||||
while (!pc->pc_awake && timeout--)
|
||||
DELAY(100);
|
||||
|
||||
return ((pc->pc_awake) ? 0 : EBUSY);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static struct cpu_group *
|
||||
@ -333,3 +332,7 @@ powernv_smp_ap_init(platform_t platform)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
powernv_cpu_idle(sbintime_t sbt)
|
||||
{
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user