u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: "Marek Behún" <marek.behun@nic.cz>, "Tom Rini" <trini@konsulko.com>
Cc: "Patrick DELAUNAY" <patrick.delaunay@foss.st.com>,
	u-boot@lists.denx.de, "Pali Rohár" <pali@kernel.org>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Christophe KERELLO" <christophe.kerello@foss.st.com>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Priyanka Jain" <priyanka.jain@nxp.com>,
	"Patrice Chotard" <patrice.chotard@foss.st.com>,
	"Heiko Schocher" <hs@denx.de>, "Simon Glass" <sjg@chromium.org>,
	"Vignesh R" <vigneshr@ti.com>,
	"U-Boot STM32" <uboot-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH v4 0/2] mtd: spi: nor: force mtd name to "nor%d"
Date: Sat, 25 Sep 2021 05:06:27 +0200	[thread overview]
Message-ID: <afcc3c67-221e-5f01-7d2d-872866878bda@denx.de> (raw)
In-Reply-To: <20210925021200.7d5b62e2@thinkpad>

On 9/25/21 2:12 AM, Marek Behún wrote:
> On Fri, 24 Sep 2021 22:09:15 +0200
> Marek Vasut <marex@denx.de> wrote:
> 
>> I have a feeling the discussion is again banking toward "mtdparts" and
>> "DT", which really is a solved problem, or at least we agreed upon the
>> solution.
> 
> I was trying to explain to Patrick how he can convert the ST board so
> that the mtd partitions will be defined in DT and board code won't need
> mtdids if he also converts to distro boot correctly.
> 
>> The patch is trying to fix MTDIDS and their look up in
>> get_mtd_device_nm(). This is all U-Boot stuff, it has nothing to do with
>> passing mtd partitions to Linux at all.
> 
> The solution here is to get rid of MTDIDS also. But I guess this will
> take some time, so it does make sense for get_mtd_device_nm() to
> return the same device as previously when given argument "norN".

I'd say MTDIDS is user ABI, so we shouldn't break it until there is 
clear way forward. (yes, I agree with pretty much all you are saying, I 
just want to make this clear)

> The reason why I put SPI NOR name into mtd->name was because otherwise
> the `mtd list` command did not print that name anywhere (since it
> doesn't know how, because that SPI-NOR data are private for the
> jedec_spi_nor driver).
> 
> Since
> - every mtd device has mtd->type, for NOR flash this is MTD_NORFLASH
> - we can iterate mtd devices in order they were registered
>    (mtd_for_each_device does this)
> we can easily implement a function
>    get_mtd_device_by_type_and_id()

No, we cannot. We have to make sure the Parallel NORs go first, SPI NORs 
second, otherwise we break the old ABI. That's what Patrick is valiantly 
battling here.

> that, when given string "norN" will find the N-th mtd device of type
> MTD_NORFLASH.
> 
> This function could than be called from get_mtd_device_nm() if
> everything failed, or in some other way.
> 
> Tom, Marek, Patrick, what do you think?

Maybe we should go with a simpler counting approach first (at least for 
this release) and then improve on that ? That would give us some time to 
think the solution through ... at which point I wouldn't even be opposed 
to passing full DT path to ubi part, something like:

ubi part /soc/controller@0x1234/flash@0/partition@1

or something like that. The above is always stable and unique because it 
is hardware path, it does get flushed right down to get_mtd_device_nm(), 
and it basically skips MTDIDS. With DT aliases you can probably write 
some shorthand for a long HW path.

      reply	other threads:[~2021-09-25  3:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 16:29 [PATCH v4 0/2] mtd: spi: nor: force mtd name to "nor%d" Patrick Delaunay
2021-09-22 16:29 ` [PATCH v4 1/2] mtd: cfi_flash: use cfi_flash_num_flash_banks only when supported Patrick Delaunay
2021-09-28 18:45   ` Tom Rini
2021-09-22 16:29 ` [PATCH v4 2/2] mtd: spi: nor: force mtd name to "nor%d" Patrick Delaunay
2021-09-28 18:45   ` Tom Rini
2021-09-22 17:29 ` [PATCH v4 0/2] " Marek Behún
2021-09-22 18:24   ` Marek Vasut
2021-09-22 18:42     ` Tom Rini
2021-09-22 19:08       ` Marek Behún
2021-09-22 19:12       ` Marek Vasut
2021-09-22 19:05     ` Marek Behún
2021-09-22 19:23       ` Tom Rini
2021-09-22 19:39         ` Marek Vasut
2021-09-22 19:24       ` Marek Vasut
2021-09-22 19:41         ` Tom Rini
2021-09-22 19:42         ` Tom Rini
2021-09-22 19:46         ` Tom Rini
2021-09-22 19:56           ` Marek Vasut
2021-09-22 20:00             ` Tom Rini
2021-09-23  1:32               ` Marek Vasut
2021-09-23  9:04                 ` Patrick DELAUNAY
2021-09-24 18:22                   ` Tom Rini
2021-09-24 19:25                     ` Marek Behún
2021-09-24 20:09                       ` Marek Vasut
2021-09-25  0:12                         ` Marek Behún
2021-09-25  3:06                           ` Marek Vasut [this message]

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=afcc3c67-221e-5f01-7d2d-872866878bda@denx.de \
    --to=marex@denx.de \
    --cc=christophe.kerello@foss.st.com \
    --cc=hs@denx.de \
    --cc=jagan@amarulasolutions.com \
    --cc=marek.behun@nic.cz \
    --cc=miquel.raynal@bootlin.com \
    --cc=pali@kernel.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=priyanka.jain@nxp.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-stm32@st-md-mailman.stormreply.com \
    --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).