question powermac_smp_start_cpu return values vs. cpu_mp_unleash use of them (SMP context)

Mark Millard via freebsd-ppc <[email protected]>
Newsgroups gmane.os.freebsd.devel.ppc
Message-ID <[email protected]>
The following is based on head -r343670 .


( from /usr/src/sys/powerpc/powermac/platform_powermac.c )

static int
powermac_smp_start_cpu(platform_t plat, struct pcpu *pc)
{
#ifdef SMP
. . .
        while (!pc->pc_awake && timeout--)
                DELAY(100);

        return ((pc->pc_awake) ? 0 : EBUSY);
#else
. . .
#endif
}

So EBUSY above indicates pc->pc_awake==0 on return.
0 indicates pc->pc_awake!=0 .

But:
( from /usr/src/sys/powerpc/powerpc/mp_machdep.c )

static void
cpu_mp_unleash(void *dummy)
{
. . .
                        ret = platform_smp_start_cpu(pc);
                        if (ret == 0) {
                                timeout = 2000; /* wait 2sec for the AP */
                                while (!pc->pc_awake && --timeout > 0)
                                        DELAY(1000);
                        }
. . .
}

So cpu_mp_unleash only waits for pc->pc_awake!=0 if it it receives
a status value indicating that pc->pc_pc_awake was already not zero.
EBUSY results in no waiting in the cpu_mp_unleash code above despite
pc->pc_awake having been zero at the return.

How things match up for powermac seems odd to me. Is something wrong
here?

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)

_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ppc
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.