linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Francesco Dolcini <francesco@dolcini.it>
Cc: Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, Marek Vasut <marex@denx.de>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Shawn Guo <shawnguo@kernel.org>,
	linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org
Subject: Re: [PATCH v1] mtd: parsers: ofpart: Fix parsing when size-cells is 0
Date: Fri, 2 Dec 2022 11:53:27 +0100	[thread overview]
Message-ID: <20221202115327.4475d3a2@xps-13> (raw)
In-Reply-To: <Y4nSXQirO2N5IRfu@francesco-nb.int.toradex.com>

Hi Francesco,

francesco@dolcini.it wrote on Fri, 2 Dec 2022 11:24:29 +0100:

> On Fri, Dec 02, 2022 at 11:12:43AM +0100, Francesco Dolcini wrote:
> > Hello Miquel,
> > 
> > On Fri, Dec 02, 2022 at 10:14:18AM +0100, Miquel Raynal wrote:  
> > > francesco@dolcini.it wrote on Fri,  2 Dec 2022 08:19:00 +0100:  
> > > > From: Francesco Dolcini <francesco.dolcini@toradex.com>
> > > > 
> > > > Add a fallback mechanism to handle the case in which #size-cells is set
> > > > to <0>. According to the DT binding the nand controller node should have
> > > > set it to 0 and this is not compatible with the legacy way of
> > > > specifying partitions directly as child nodes of the nand-controller node.  
> > > 
> > > I understand the problem, I understand the fix, but I have to say, I
> > > strongly dislike it :) Touching an mtd core driver to fix a single
> > > broken use case like that is... problematic, for the least.  
> > I just noticed it 2 days after this patch was backported to a stable
> > kernel, I am just the first one to notice, we are not talking about a single
> > use case.
> >   
> > > I am sorry but if a 6.0 kernel breaks because:  
> > Not only kernel 6.0 is currently broken. This patch is going to be
> > backported to any stable kernel given the fixes tag it has.
> >   
> > > If you really want to workaround U-Boot, either you revert that patch
> > > or you just fix the DT description instead. The parent/child/partitions
> > > scheme has been enforced for maybe 5 years now and for a good reason: a
> > > NAND controller with partitions does not make _any_ sense. There are
> > > plenty of examples out there, imx7-colibri.dtsi has received many
> > > updates since its introduction (for the best), so why not this one?  
> > 
> > I can and I will update imx7-colibri.dtsi (patch coming),

:thumb_up:

> > but is this
> > good enough given the kind of boot failure regression this introduce? We
> > are going to have old u-boot around that will not work with it, and the  
> 
> Just another piece of information, support for the partitions node in
> U-Boot was added in version v2022.04 [1], we are not talking about ancient
> old legacy stuff.

If it is so recent, then this is what needs to be fixed, and it should
not bother "many" people because 2022.04 is not so old.

So I am a bit lost, IIUC what is currently broken is:
- U-Boot > 2022.04 and any version of Linux with the backport?

> If I add the partitions node as a child of my nand controller, as I was
> planning to do and I wrote 10 lines above, I will create a new flavor of
> non-booting system with U-Boot older than v2022.04 :-/

I think there is a little confusion here. You are referring to the NAND
controller node, the commit refers to the NAND chip node. What this
commit does looks fine because it just tries to use the partitions {}
node rather than the NAND chip node and if the partitions {} node
already exist, I expect #address-cells and #size-cells to be defined
and be != 0 already.

Here is a proper description:

nand-controller {
	#address-cells = <1>;
	#size-cells = <0>;
	nand-chip {
		partitions {
			#address-cells = <1 or 2>;
			#size-cells = <1 or 2>;
			partition@x { };
			partition@y { };
		};
	};

	/* Here you can very well have another nand-chip node with
	 * another reg property which represents its own CS and another
	 * set of partitions.
	 */
};

> U-Boot older than v2022.04 will update the nand controller node never
> the less, the partition node will still be there and Linux will use it,
> but it will be empty since nobody populate it.
> 
> Francesco
> 
> [1] commit 36fee2f7621e ("common: fdt_support: add support for "partitions" subnode to fdt_fixup_mtdparts()")


Thanks,
Miquèl

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-12-02 10:54 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02  7:19 [PATCH v1] mtd: parsers: ofpart: Fix parsing when size-cells is 0 Francesco Dolcini
2022-12-02  9:14 ` Miquel Raynal
2022-12-02 10:12   ` Francesco Dolcini
2022-12-02 10:24     ` Francesco Dolcini
2022-12-02 10:53       ` Miquel Raynal [this message]
2022-12-02 11:23         ` Francesco Dolcini
2022-12-02 14:05           ` Miquel Raynal
2022-12-02 14:31             ` Marek Vasut
2022-12-02 15:00               ` Miquel Raynal
2022-12-02 15:23                 ` Marek Vasut
2022-12-02 15:49                   ` Miquel Raynal
2022-12-02 16:01                     ` Miquel Raynal
2022-12-02 16:17                     ` Marek Vasut
2022-12-02 16:42                       ` Miquel Raynal
2022-12-02 16:52                         ` Marek Vasut
2022-12-02 16:57                           ` Miquel Raynal
2022-12-02 17:08                             ` Marek Vasut
2022-12-05 11:26                               ` Francesco Dolcini
2022-12-05 13:49                                 ` Miquel Raynal
2022-12-05 16:25                                   ` Marek Vasut
2022-12-15  7:16                                     ` Miquel Raynal
2022-12-15  7:45                                       ` Marek Vasut
2022-12-15  8:04                                         ` Miquel Raynal
2022-12-16  0:36                                           ` Marek Vasut
2022-12-16  7:52                                             ` Francesco Dolcini
2022-12-16  7:45                                       ` Francesco Dolcini
2022-12-16 10:46                                         ` Marek Vasut
2022-12-16 11:01                                           ` Miquel Raynal
2022-12-16 12:37                                             ` Francesco Dolcini
2022-12-16 13:37                                               ` Miquel Raynal
2022-12-16 14:32                                                 ` Marek Vasut
2022-12-16 15:35                                                   ` Miquel Raynal
2022-12-16 16:30                                                     ` Francesco Dolcini
2023-01-02  9:40                                                       ` Miquel Raynal
2023-01-05 11:33                                                         ` Miquel Raynal
2023-01-05 12:47                                                           ` Francesco Dolcini
2023-01-05 14:51                                                             ` Marek Vasut
2023-01-05 15:03                                                               ` Miquel Raynal
2022-12-02 17:20                         ` Francesco Dolcini
2022-12-05 11:30                           ` Francesco Dolcini
2022-12-05 15:28                             ` Miquel Raynal
2022-12-02 16:45                       ` Francesco Dolcini
2022-12-02 17:05                         ` Miquel Raynal
2022-12-02 15:56               ` Thorsten Leemhuis
2022-12-04 12:50                 ` Marek Vasut
2022-12-04 12:59                   ` Thorsten Leemhuis
2022-12-04 15:50                     ` Marek Vasut
2022-12-02 12:43 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221202115327.4475d3a2@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=francesco@dolcini.it \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marex@denx.de \
    --cc=richard@nod.at \
    --cc=shawnguo@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).