[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <bc3d7b6b-3f08-410f-bd43-b7157419d5a7@app.fastmail.com>
Date: Mon, 12 Dec 2022 08:29:55 +0100
From: "Arnd Bergmann" <arnd@...nel.org>
To: "Alexander Sverdlin" <alexander.sverdlin@...il.com>,
devicetree@...r.kernel.org
Cc: "Rob Herring" <robh+dt@...nel.org>,
"Frank Rowand" <frowand.list@...il.com>,
linux-kernel@...r.kernel.org,
"Nikita Shubin" <nikita.shubin@...uefel.me>,
"Hartley Sweeten" <hsweeten@...ionengravers.com>,
"Lukasz Majewski" <lukma@...x.de>,
"Linus Walleij" <linusw@...nel.org>
Subject: Re: [PATCH] of: fdt: Honor CONFIG_CMDLINE* even without /chosen node
On Mon, Dec 12, 2022, at 00:58, Alexander Sverdlin wrote:
> I do not read a strict requirement on /chosen node in either ePAPR or in
> Documentation/devicetree. Help text for CONFIG_CMDLINE and
> CONFIG_CMDLINE_EXTEND doesn't make their behavior explicitly dependent on
> the presence of /chosen or the presense of /chosen/bootargs.
>
> However the early check for /chosen and bailing out in
> early_init_dt_scan_chosen() skips CONFIG_CMDLINE handling which is not
> really related to /chosen node or the particular method of passing cmdline
> from bootloader.
>
> This leads to counterintuitive combinations (assuming
> CONFIG_CMDLINE_EXTEND=y):
>
> a) bootargs="foo", CONFIG_CMDLINE="bar" => cmdline=="foo bar"
> b) /chosen missing, CONFIG_CMDLINE="bar" => cmdline==""
> c) bootargs="", CONFIG_CMDLINE="bar" => cmdline==" bar"
>
> Move CONFIG_CMDLINE handling outside of early_init_dt_scan_chosen() so that
> cases b and c above result in the same cmdline.
>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@...il.com>
Thanks for debugging this and coming up with a fix. We probably want
to have an empty /chosen node in most dts files to stay compatible with
existing kernels, but fixing the kernel is a good idea regardless.
Acked-by: Arnd Bergmann <arnd@...db.de>
and probably
Cc: stable@...r.kernel.org
Powered by blists - more mailing lists