u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Francesco Dolcini <francesco@dolcini.it>
Cc: "Simon Glass" <sjg@chromium.org>,
	u-boot@lists.denx.de,
	"Marcel Ziswiler" <marcel.ziswiler@toradex.com>,
	"Francesco Dolcini" <francesco.dolcini@toradex.com>,
	"Marek Vasut" <marex@denx.de>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Nikita Kiryanov" <nikita@compulab.co.il>,
	"Tim Harvey" <tharvey@gateworks.com>,
	"Javier Martínez Canillas" <javier@dowhile0.org>,
	"Enric Balletbo i Serra" <eballetbo@gmail.com>,
	"Niel Fourie" <lusus@denx.de>,
	"Parthiban Nallathambi" <parthiban@linumiz.com>,
	"Patrick Delaunay" <patrick.delaunay@foss.st.com>,
	"Patrice Chotard" <patrice.chotard@foss.st.com>,
	uboot-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH v2 1/3] fdt: validate/fix cells count on mtdpart fixup
Date: Mon, 6 Feb 2023 18:17:31 -0500	[thread overview]
Message-ID: <Y+GKi9MlruCvNZLZ@bill-the-cat> (raw)
In-Reply-To: <20230206224838.75963-2-francesco@dolcini.it>

[-- Attachment #1: Type: text/plain, Size: 2426 bytes --]

On Mon, Feb 06, 2023 at 11:48:36PM +0100, Francesco Dolcini wrote:

> From: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> Fixup #size-cells value when updating the MTD partitions, this is
> required to prevent issues in case the MTD parent set #size-cells to
> zero.
> This could happen for example in the legacy case in which the partitions
> are created as direct child of the mtd node and that specific node has
> no children. Recent clean-up on Linux device tree files created a boot
> regression on colibri-imx7 [0].
> 
> This fixup has the limitation to assume 32-bit (#size-cells=1)
> addressing, therefore it will not work with device bigger than 4GiB.
> 
> This change also enforce #address-cells to be the same as #size-cells,
> this was already silently enforced by fdt_node_set_part_info(), now this
> is checked explicitly and partition fixup will just fail in such case.
> 
> When the partition list is static the preferred way to pass the mtd
> partition list to the kernel is to either define those in the source DTS
> file or use mtdparts= in the command line.
> Tweaking the DT from U-Boot should be avoided, unless some dynamic
> changes are required, since it proved to be problematic when not
> following the evolution of the "standard".
> 
> Link: https://lore.kernel.org/all/Y4dgBTGNWpM6SQXI@francesco-nb.int.toradex.com/
> Link: https://lore.kernel.org/all/20221202071900.1143950-1-francesco@dolcini.it/
> Cc: Marek Vasut <marex@denx.de>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
> v2: improved commit message
> ---
>  common/fdt_support.c | 45 ++++++++++++++++++++++++++++++++++----------
>  1 file changed, 35 insertions(+), 10 deletions(-)

I'm dropping the linux-mtd list here and adding a bunch more platform
maintainers. In general, calling fdt_fixup_mtdparts is the wrong choice.
I see we do have a few cases in U-Boot where we're clearly doing
something dynamic to the partition table, but it looks like at first
glance most callers are using this hook when they should either be
having the partition map in the device tree properly (and using one of
the appropriate bindings) or passing the map in via the kernel command
line. I would like to ask everyone I've added to the list here to
please audit your platform and update it as needed. Thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2023-02-06 23:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06 22:48 [PATCH v2 0/3] fdt: Fix mtparts fixup Francesco Dolcini
2023-02-06 22:48 ` [PATCH v2 1/3] fdt: validate/fix cells count on mtdpart fixup Francesco Dolcini
2023-02-06 23:17   ` Tom Rini [this message]
2023-04-04 16:18     ` Francesco Dolcini
2023-04-06 15:25       ` Tom Rini
2023-04-14  6:29         ` Francesco Dolcini
2023-02-06 22:48 ` [PATCH v2 2/3] colibri-imx7: specify MTD partitions on command line Francesco Dolcini
2023-04-14  6:34   ` Francesco Dolcini
2023-02-06 22:48 ` [PATCH v2 3/3] colibri-imx6ull: " Francesco Dolcini
2023-04-17  9:21   ` [PATCH v2 2/3] colibri-imx7: " Dario Binacchi
2023-04-17  9:26   ` [PATCH v2 3/3] colibri-imx6ull: " Dario Binacchi

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=Y+GKi9MlruCvNZLZ@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=eballetbo@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=francesco@dolcini.it \
    --cc=javier@dowhile0.org \
    --cc=lusus@denx.de \
    --cc=marcel.ziswiler@toradex.com \
    --cc=marex@denx.de \
    --cc=miquel.raynal@bootlin.com \
    --cc=nikita@compulab.co.il \
    --cc=parthiban@linumiz.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=sjg@chromium.org \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-stm32@st-md-mailman.stormreply.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).