[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL_JsqLbpbWavxs6ifO_RRSMreOjj1ToSSDS11P2wuVDeBj_7A@mail.gmail.com>
Date: Tue, 6 Sep 2022 09:39:31 -0500
From: Rob Herring <robh+dt@...nel.org>
To: Marek Bykowski <marek.bykowski@...il.com>
Cc: Frank Rowand <frowand.list@...il.com>, devicetree@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] of/fdt: Don't calculate initrd_start from the DT if
'linux,initrd-end' is 0
On Tue, Aug 30, 2022 at 10:35 AM Marek Bykowski
<marek.bykowski@...il.com> wrote:
>
> On Sun, 28 Aug 2022 20:12:41 -0500
> Rob Herring <robh+dt@...nel.org> wrote:
>
> >
> > Shouldn't we just check that start < end?
> >
> > Can we check this somewhere not DT specific (and also not arch
> > specific)? Then we don't have to worry if any other method of setting
> > initrd could have the same error.
>
> Yes, we can switch from checking on the end being 0 to that proposed:
> - if (!end)
> - return;
> + if (start >= end)
> + return;
>
> Then the check would even go further as would also catch cases where
> end < start.
>
> My taking is early_init_dt_scan_chosen() that sets initrd size
> incorrectly is DT specific but generic/arch agnostic. So that if
> the error got introduced by a bootloader/U-Boot through the DT
> chosen node, we should catch it in DT and react.
>
> ARM64, for example, before going down for mapping for the incorrect
> address (some extra large address resulting from the negative to
> positive value conversion), has a check after DT parsing if
> phys_initrd_size is other than 0 to proceed, and it is so that it
> passes or in other words it doesn't catch the error.
Okay.
Please send an updated patch.
Rob
Powered by blists - more mailing lists