[PATCH v2] mtd: parsers: ofpart: add workaround for #size-cells 0

Francesco Dolcini francesco at dolcini.it
Mon Jan 23 11:35:37 CET 2023


On Mon, Jan 23, 2023 at 11:28:08AM +0100, Miquel Raynal wrote:
> francesco at dolcini.it wrote on Fri, 13 Jan 2023 19:45:56 +0100:
> 
> > From: Francesco Dolcini <francesco.dolcini at toradex.com>
> > 
> > Add a mechanism to handle the case in which partitions are present as
> > direct child of the nand controller node and #size-cells is set to <0>.
> > 
> > This could happen if the nand-controller node in the DTS is supposed to
> > have #size-cells set to 0, but for some historical reason/bug it was set
> > to 1 in the past, and the firmware (e.g. U-Boot) is adding the partition
> > as direct children of the nand-controller defaulting to #size-cells
> > being to 1.
> > 
> > This prevents a real boot failure on colibri-imx7 that happened during v6.1
> > development cycles.
> > 
> > Link: https://lore.kernel.org/all/Y4dgBTGNWpM6SQXI@francesco-nb.int.toradex.com/
> > Link: https://lore.kernel.org/all/20221202071900.1143950-1-francesco@dolcini.it/
> > Signed-off-by: Francesco Dolcini <francesco.dolcini at toradex.com>
> > Reviewed-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
> > ---
> > 
> > Miquel, Marek: I do not expect this patch to be backported to stable, however
> > I would expect that we do not backport nand-controller dts cleanups neither.
> 
> Okay.

[snip]

> > +			pr_warn("%s: ofpart partition %pOF (%pOF) #size-cells is wrongly set to <0>, assuming <1> for parsing partitions.\n",
> > +				 master->name, pp,
> > +				 mtd_node);
> 
> Why mtd_node on a new line?

For some historical reason most of this file is like that, so I did the
same for consistency (to be honest when I did it I though it was _all_
like that).

> Otherwise looks good to me.
I can send a v2 with this changed.

Francesco



More information about the U-Boot mailing list