Re: [PATCH] of: unittest: Statically apply overlays using fdtoverlay

Rob Herring
2021-01-12T14:06:07Z

On Mon, Jan 11, 2021 at 4:06 PM Frank Rowand <frowand.list@gmail.com> wrote:
>
> On 1/8/21 2:41 AM, Viresh Kumar wrote:
> > Now that fdtoverlay is part of the kernel build, start using it to test
> > the unitest overlays we have by applying them statically.
> >
> > The file overlay_base.dtb have symbols of its own and we need to apply
> > overlay.dtb to overlay_base.dtb alone first to make it work, which gives
> > us intermediate-overlay.dtb file.
> >
> > The intermediate-overlay.dtb file along with all other overlays is them
> > applied to testcases.dtb to generate the master.dtb file.
> >
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> NACK to this specific patch, in its current form.
>
> There are restrictions on applying an overlay at runtime that do not apply
> to applying an overlay to an FDT that will be loaded by the kernel during
> early boot. Thus the unittest overlays _must_ be applied using the kernel
> overlay loading methods to test the kernel runtime overlay loading feature.

This patch doesn't take away from any of that and it completely orthogonal.

> I agree that testing fdtoverlay is a good idea. I have not looked at the
> parent project to see how much testing of fdtoverlay occurs there, but I
> would prefer that fdtoverlay tests reside in the parent project if practical
> and reasonable. If there is some reason that some fdtoverlay tests are
> more practical in the Linux kernel repository then I am open to adding
> them to the Linux kernel tree.

If you (or more importantly someone else sending us patches) make
changes to the overlays, you can test that they apply at build time
rather than runtime. I'll take it! So please help on fixing the issue
because I want to apply this.

And yes, dtc has fdtoverlay tests. But this patch shows there's at
least 2 issues. fdtoverlay can't apply overlays to the root and using
an overlay as the base tree in UML is odd IMO.

Rob