From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Thorsten Blum <thorsten.blum@linux.dev>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
Josh Boyer <jwboyer@linux.vnet.ibm.com>,
Grant Likely <grant.likely@secretlab.ca>,
Tony Breeds <tony@bakeyournoodle.com>,
Alistair Popple <alistair@popple.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Thorsten Blum <thorsten.blum@linux.dev>
Subject: Re: [PATCH 1/3] powerpc/boot: Fix simpleboot CPU node lookup check
Date: Thu, 09 Jul 2026 11:56:30 +0530 [thread overview]
Message-ID: <cxwwwueh.ritesh.list@gmail.com> (raw)
In-Reply-To: <20260702211554.56923-4-thorsten.blum@linux.dev>
Thorsten Blum <thorsten.blum@linux.dev> writes:
> fdt_node_offset_by_prop_value() returns a negative error code on
> failure - fix the check accordingly.
>
> Fixes: d2477b5cc8ca ("[POWERPC] bootwrapper: Add a firmware-independent simpleboot target.")
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
yup, if it cannot find the node, then it should return a negative error
code, since cpu node is never the root node. The same thing was anyway
properly done for memory device node in the same function few lines
before...
/* Find the memory range */
node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type",
"memory", sizeof("memory"));
if (node < 0)
fatal("Cannot find memory node\n");
...but for cpu node, it uses a wrong comparison check.
Looks good to me. Please feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
> ---
> arch/powerpc/boot/simpleboot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/boot/simpleboot.c b/arch/powerpc/boot/simpleboot.c
> index c80691d83880..27591df41e9e 100644
> --- a/arch/powerpc/boot/simpleboot.c
> +++ b/arch/powerpc/boot/simpleboot.c
> @@ -68,7 +68,7 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
> /* finally, setup the timebase */
> node = fdt_node_offset_by_prop_value(_dtb_start, -1, "device_type",
> "cpu", sizeof("cpu"));
> - if (!node)
> + if (node < 0)
> fatal("Cannot find cpu node\n");
> timebase = fdt_getprop(_dtb_start, node, "timebase-frequency", &size);
> if (timebase && (size == 4))
prev parent reply other threads:[~2026-07-09 6:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 21:15 [PATCH 1/3] powerpc/boot: Fix simpleboot CPU node lookup check Thorsten Blum
2026-07-02 21:15 ` [PATCH 2/3] powerpc/boot: Fix treeboot-currituck " Thorsten Blum
2026-07-09 6:52 ` Ritesh Harjani
2026-07-02 21:15 ` [PATCH 3/3] powerpc/boot: Fix treeboot-akebono " Thorsten Blum
2026-07-09 6:52 ` Ritesh Harjani
2026-07-09 6:26 ` Ritesh Harjani [this message]
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=cxwwwueh.ritesh.list@gmail.com \
--to=ritesh.list@gmail.com \
--cc=alistair@popple.id.au \
--cc=benh@kernel.crashing.org \
--cc=chleroy@kernel.org \
--cc=grant.likely@secretlab.ca \
--cc=jwboyer@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=thorsten.blum@linux.dev \
--cc=tony@bakeyournoodle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.