From: Paul Mackerras <paulus@ozlabs.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 5/5] powerpc/microwatt: Add SMP support
Date: Fri, 31 Jan 2025 12:34:14 +1100 [thread overview]
Message-ID: <Z5wolsFd82NNfWk8@thinks.paulus.ozlabs.org> (raw)
In-Reply-To: <874j1hss0r.fsf@mpe.ellerman.id.au>
On Wed, Jan 29, 2025 at 11:50:44PM +1100, Michael Ellerman wrote:
> Paul Mackerras <paulus@ozlabs.org> writes:
> There's macros that would make these a little nicer, ie. PPC_RAW_MFSPR()
> and PPC_RAW_BRANCH().
Thanks, I'll use them.
> > /* enable the other CPUs, they start at location 0 */
> > writel((1ul << ncpus) - 1, syscon + SYSCON_CPU_CTRL);
> >
> > timeout = 10000;
> > while (!__secondary_hold_acknowledge) {
> > if (--timeout == 0)
> > break;
> > barrier();
> > }
>
> I assume CPU 0 always boots first?
Yes, on reset, only CPU 0 starts executing, and the rest are held in
the reset state until that writel() to SYSCON_CPU_CTRL enables them.
They all then start executing at location 0.
> Is the loop actually necessary? It only waits for a single non-zero CPU
> to come up after all, not all of them.
Yes, it only waits for the first one to get to the point of setting
__secondary_hold_acknowledge, but that might take a microsecond or so,
meaning we do need a loop (or I suppose a udelay(10) would probably
also be sufficient). The assumption is that any others will get into
the loop very shortly after the first. If that proves incorrect, it
would be possible instead to start them one by one, clearing
__secondary_hold_acknowledge each time (but I don't have a way to test
such code at present).
Paul.
next prev parent reply other threads:[~2025-01-31 1:34 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 22:49 [PATCH 0/5] Microwatt updates Paul Mackerras
2025-01-28 22:51 ` [PATCH 1/5] powerpc/microwatt: Select COMMON_CLK in order to get the clock framework Paul Mackerras
2025-01-29 5:57 ` Nicholas Piggin
2025-01-28 22:52 ` [PATCH 2/5] powerpc/microwatt: Device-tree updates Paul Mackerras
2025-01-29 6:36 ` Nicholas Piggin
2025-01-29 7:18 ` Paul Mackerras
2025-01-29 8:20 ` Nicholas Piggin
2025-01-31 17:03 ` Segher Boessenkool
2025-01-31 16:55 ` Segher Boessenkool
2025-01-31 16:53 ` Segher Boessenkool
2025-01-31 16:48 ` Segher Boessenkool
2025-01-28 22:52 ` [PATCH 3/5] powerpc/microwatt: Define an idle power-save function Paul Mackerras
2025-01-29 6:06 ` Nicholas Piggin
2025-01-29 6:49 ` Paul Mackerras
2025-01-31 16:32 ` Segher Boessenkool
2025-02-01 1:41 ` Paul Mackerras
2025-01-31 16:25 ` Segher Boessenkool
2025-01-28 22:53 ` [PATCH 4/5] powerpc: Define config option for processors without broadcast TLBIE Paul Mackerras
2025-01-29 6:14 ` Nicholas Piggin
2025-01-29 7:10 ` Paul Mackerras
2025-01-29 8:17 ` Nicholas Piggin
2025-01-31 17:30 ` Segher Boessenkool
2025-01-31 17:26 ` Segher Boessenkool
2025-01-28 22:55 ` [PATCH 5/5] powerpc/microwatt: Add SMP support Paul Mackerras
2025-01-29 6:21 ` Nicholas Piggin
2025-01-29 6:57 ` Paul Mackerras
2025-01-29 8:12 ` Nicholas Piggin
2025-01-31 1:27 ` Paul Mackerras
2025-01-29 12:50 ` Michael Ellerman
2025-01-31 1:34 ` Paul Mackerras [this message]
2025-01-31 16:13 ` [PATCH 0/5] Microwatt updates Segher Boessenkool
2025-02-01 1:22 ` Paul Mackerras
2025-03-02 10:13 ` Gabriel Paubert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z5wolsFd82NNfWk8@thinks.paulus.ozlabs.org \
--to=paulus@ozlabs.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).