From: dinguyen@altera.com (Dinh Nguyen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 for soc 4/4] arm: socfpga: Add SMP support for actual socfpga harware
Date: Mon, 4 Feb 2013 10:12:44 -0600 [thread overview]
Message-ID: <1359994364.10570.4.camel@linux-builds1> (raw)
In-Reply-To: <20130203183641.GA30825@amd.pavel.ucw.cz>
Hi Pavel,
On Sun, 2013-02-03 at 19:36 +0100, ZY - pavel wrote:
> Hi!
>
> > > > Point taken...thanks Russell.
> > >
> > > Well, I don't think we normally check dtbs for validity with
> > > user-helpful error messages, but it is relatively easy in this case.
> > >
> > > ---cut here---
> > >
> > > Continue booting with second core disabled if cpu1-start-addr is not
> > > present in .dtb.
> > >
> > > Signed-off-by: Pavel Machek <pavel@denx.de>
> > >
> > > diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-
> > > socfpga/platsmp.c
> > > index 81e0da0..90facdd 100644
> > > --- a/arch/arm/mach-socfpga/platsmp.c
> > > +++ b/arch/arm/mach-socfpga/platsmp.c
> > > @@ -82,6 +82,9 @@ static void __init socfpga_smp_init_cpus(void)
> > > ncores = 1;
> > > }
> > > #endif
> > > + if (!cpu1start_addr)
> > > + ncores = 1;
> > > +
> >
> > This will not work because of commit 5587164eea4aad88fcb79d9b21dc8f14fea598cd
> > I sent out a V3 series of this patch, CPU1 will simply fail to come online if
> > cpu1-start-addr is not defined.
>
> Are you sure? As far as I can see you still need such a line in v3 of
> the patch:
>
> @@ -72,6 +73,11 @@ void __init socfpga_sysmgr_init(void)
> struct device_node *np;
>
> np = of_find_compatible_node(NULL, NULL, "altr,sys-mgr");
> +
> + if (of_property_read_u32(np, "cpu1-start-addr",
> + (u32 *) &cpu1start_addr))
> + pr_err("SMP: Need cpu1-start-addr in device tree.\n");
> +
> sys_manager_base_addr = of_iomap(np, 0);
>
> np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
>
> ...so cpu1-start-addr is not there, cpu1start_addr is NULL but you
> continue booting.
>
> ENTRY(secondary_trampoline)
> - movw r0, #:lower16:CPU1_START_ADDR
> - movt r0, #:upper16:CPU1_START_ADDR
> + movw r2, #:lower16:cpu1start_addr
> + movt r2, #:upper16:cpu1start_addr
> +
> + /* The socfpga VT cannot handle a 0xC0000000 page offset when
> loading
> + the cpu1start_addr, we bit clear it. Tested on HW and
> VT. */
> + bic r2, r2, #0x40000000
>
> + ldr r0, [r2]
> ldr r1, [r0]
> bx r1
>
> ...and you'll dereference the NULL pointer here, no?
You're right, somehow my initial test did not catch this error. For v4,
I'm just going to wrap everything in sofpga_boot_secodardy in a
if (cpu1start_addr){}
Dinh
>
> Sorry for the noise, this really is not all that important...
> Pavel
next prev parent reply other threads:[~2013-02-04 16:12 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-31 17:05 [PATCHv2 for soc 0/4] Enabling socfpga on hardware dinguyen at altera.com
2013-01-31 17:05 ` [PATCHv2 for soc 1/4] arm: socfpga: Add new device tree source for actual socfpga HW dinguyen at altera.com
2013-02-01 3:46 ` Olof Johansson
2013-02-01 15:23 ` Dinh Nguyen
2013-01-31 17:05 ` [PATCHv2 for soc 2/4] arm: socfpga: Add entries to enable make dtbs socfpga dinguyen at altera.com
2013-01-31 17:05 ` [PATCHv2 for soc 3/4] arm: Add v7_invalidate_l1 to cache-v7.S dinguyen at altera.com
2013-01-31 18:11 ` Stephen Warren
2013-02-01 3:47 ` Olof Johansson
2013-02-01 11:29 ` Santosh Shilimkar
2013-02-01 11:32 ` Russell King - ARM Linux
2013-02-01 11:44 ` Santosh Shilimkar
2013-02-01 12:48 ` Russell King - ARM Linux
2013-02-01 13:04 ` Santosh Shilimkar
2013-02-01 13:20 ` Russell King - ARM Linux
2013-02-01 14:09 ` Santosh Shilimkar
2013-02-01 12:11 ` Lorenzo Pieralisi
2013-02-01 12:24 ` Santosh Shilimkar
2013-02-01 12:54 ` Russell King - ARM Linux
2013-02-01 14:10 ` Lorenzo Pieralisi
2013-02-01 14:19 ` Russell King - ARM Linux
2013-02-01 14:31 ` Russell King - ARM Linux
2013-02-01 14:43 ` Santosh Shilimkar
2013-02-01 14:49 ` Russell King - ARM Linux
2013-02-01 14:53 ` Santosh Shilimkar
2013-02-01 14:34 ` Lorenzo Pieralisi
2013-01-31 17:05 ` [PATCHv2 for soc 4/4] arm: socfpga: Add SMP support for actual socfpga harware dinguyen at altera.com
2013-02-01 3:50 ` Olof Johansson
2013-02-01 10:46 ` Pavel Machek
2013-02-01 15:27 ` Dinh Nguyen
2013-02-01 15:31 ` Russell King - ARM Linux
2013-02-01 16:39 ` Dinh Nguyen
2013-02-02 19:24 ` Pavel Machek
2013-02-02 21:37 ` Dinh Nguyen
2013-02-03 18:36 ` Pavel Machek
2013-02-04 16:12 ` Dinh Nguyen [this message]
2013-02-01 10:50 ` Pavel Machek
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=1359994364.10570.4.camel@linux-builds1 \
--to=dinguyen@altera.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).