Re: [PATCH v1 1/3] powerpc: Fix processing of CONFIG_CMDLINE

2023-01-03 Thread Rob Herring
On Tue, Jan 3, 2023 at 10:45 AM Geoff Levand  wrote:
>
> Hi Rob,
>
> On 1/2/23 18:03, Rob Herring wrote:
> > On Mon, Jan 2, 2023 at 1:41 PM Geoff Levand  wrote:
>
> >> --- a/arch/powerpc/kernel/prom.c
> >> +++ b/arch/powerpc/kernel/prom.c
> >> @@ -761,7 +761,7 @@ void __init early_init_devtree(void *params)
> >> DBG(" -> early_init_devtree(%px)\n", params);
> >>
> >> /* Too early to BUG_ON(), do it by hand */
> >> -   if (!early_init_dt_verify(params))
> >> +   if (!early_init_dt_scan(params))
> >
> > It would be nice if this could be used instead, but it does other
> > things like memory setup which I think will not work for some PPC
> > platforms.
>
> It seems like what we need is to pull out the command line processing
> code from early_init_dt_scan_nodes and put that into a new function,
> say early_init_setup_cmdline, then have both early_init_dt_scan_nodes
> and powerpc's early_init_devtree call early_init_setup_cmdline.
>
> I'll split this series into two, one for the PS3 updates, and one
> that adds early_init_setup_cmdline.

What is really needed is to make progress on the generic command line
handling, but the 2 different implementations can't seem to work
together to resolve the differences.

Short of that, I don't really want to see another function exposed to
the arch as I've been trying to reduce them. I'll post an alternative
shortly.

Rob


Re: [PATCH v1 1/3] powerpc: Fix processing of CONFIG_CMDLINE

2023-01-03 Thread Geoff Levand
Hi Rob,

On 1/2/23 18:03, Rob Herring wrote:
> On Mon, Jan 2, 2023 at 1:41 PM Geoff Levand  wrote:

>> --- a/arch/powerpc/kernel/prom.c
>> +++ b/arch/powerpc/kernel/prom.c
>> @@ -761,7 +761,7 @@ void __init early_init_devtree(void *params)
>> DBG(" -> early_init_devtree(%px)\n", params);
>>
>> /* Too early to BUG_ON(), do it by hand */
>> -   if (!early_init_dt_verify(params))
>> +   if (!early_init_dt_scan(params))
> 
> It would be nice if this could be used instead, but it does other
> things like memory setup which I think will not work for some PPC
> platforms.

It seems like what we need is to pull out the command line processing
code from early_init_dt_scan_nodes and put that into a new function,
say early_init_setup_cmdline, then have both early_init_dt_scan_nodes
and powerpc's early_init_devtree call early_init_setup_cmdline.

I'll split this series into two, one for the PS3 updates, and one
that adds early_init_setup_cmdline.

-Geoff



Re: [PATCH v1 1/3] powerpc: Fix processing of CONFIG_CMDLINE

2023-01-02 Thread Rob Herring
On Mon, Jan 2, 2023 at 1:41 PM Geoff Levand  wrote:
>
> Commit a7d550f82b445cf218b47a2c1a9c56e97ecb8c7a (of: fdt: Honor 
> CONFIG_CMDLINE*
> even without /chosen node) moved the processing of the kernel built-in command
> line (CONFIG_CMDLINE) from the early_init_dt_scan_chosen routine to the
> early_init_dt_scan_nodes routine.
>
> The current powerpc startup code does not call into early_init_dt_scan_nodes, 
> so
> processing of CONFIG_CMDLINE never happens, even if CONFIG_CMDLINE_FORCE=y.
> The result is an empty kernel command line, and mounting of the root file 
> system
> then fails with a kernel panic (not syncing: VFS: Unable to mount root fs).
>
> The early_init_dt_scan routine calls into early_init_dt_verify and then
> early_init_dt_scan_nodes.  The powerpc startup routine early_init_devtree
> currently has a call to early_init_dt_verify.  This change replaces that
> early_init_dt_verify call to a call to early_init_dt_scan.
>
> Signed-off-by: Geoff Levand 
> ---
>  arch/powerpc/kernel/prom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 4f1c920aa13e..82c9cd3bdbec 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -761,7 +761,7 @@ void __init early_init_devtree(void *params)
> DBG(" -> early_init_devtree(%px)\n", params);
>
> /* Too early to BUG_ON(), do it by hand */
> -   if (!early_init_dt_verify(params))
> +   if (!early_init_dt_scan(params))

It would be nice if this could be used instead, but it does other
things like memory setup which I think will not work for some PPC
platforms.

Rob