[0/2] of: Fix handling CONFIG_CMDLINE* even without /chosen node

Message ID 20230103-dt-cmdline-fix-v1-0-7038e88b18b6@kernel.org
Headers
Series of: Fix handling CONFIG_CMDLINE* even without /chosen node |

Message

Rob Herring Jan. 3, 2023, 6 p.m. UTC
  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).

Let's revert the above commit and redo the missing /chosen node handling 
within early_init_dt_scan_chosen().

Signed-off-by: Rob Herring <robh@kernel.org>
---
Rob Herring (2):
      Revert "of: fdt: Honor CONFIG_CMDLINE* even without /chosen node"
      of: fdt: Honor CONFIG_CMDLINE* even without /chosen node, take 2

 drivers/of/fdt.c | 54 ++++++++++++++++++++++++++++--------------------------
 1 file changed, 28 insertions(+), 26 deletions(-)
---
base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
change-id: 20230103-dt-cmdline-fix-e36eb7e39b75

Best regards,
  

Comments

Geoff Levand Jan. 4, 2023, 1:31 a.m. UTC | #1
Hi Rob,

On 1/3/23 10:00, Rob Herring wrote:
> 
> Let's revert the above commit and redo the missing /chosen node handling 
> within early_init_dt_scan_chosen().
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> Rob Herring (2):
>       Revert "of: fdt: Honor CONFIG_CMDLINE* even without /chosen node"
>       of: fdt: Honor CONFIG_CMDLINE* even without /chosen node, take 2
> 
>  drivers/of/fdt.c | 54 ++++++++++++++++++++++++++++--------------------------
>  1 file changed, 28 insertions(+), 26 deletions(-)

I applied these two patches to v6.2-rc2 and tested on PS3. I used a kernel
config file that had a CONFIG_CMDLINE, and CONFIG_CMDLINE_FORCE=y set.
Everything seemed to work OK.  

Tested-by: Geoff Levand <geoff@infradead.org>
  
Alexander Sverdlin Jan. 4, 2023, 9:48 a.m. UTC | #2
Hi Rob,

thanks for looking into it!

On Tue, 2023-01-03 at 12:00 -0600, Rob Herring 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).
> 
> Let's revert the above commit and redo the missing /chosen node handling 
> within early_init_dt_scan_chosen().
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

The series looks good to me,
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>