linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Fenkart <afenkart@gmail.com>
To: devicetree@vger.kernel.org, linux-mtd@lists.infradead.org
Cc: alexandre.belloni@free-electrons.com, "Michonski,
	Krzysztof" <krzysztof.michonski@digitalstrom.com>
Subject: Re: regression: nand/spi flashes listed in reversed order after "ARM: dts: at91: Switch to the new NAND bindings"
Date: Thu, 27 Jun 2019 12:44:08 +0200	[thread overview]
Message-ID: <CALtMJEBEo8u0YSqqAbRY0YwnuzCByAuQ8YKt8FrPzhoJpW_YCg@mail.gmail.com> (raw)
In-Reply-To: <CALtMJEBpxc+oN1Uf03F0oG-smHZazeeptE=BRX7tPpixnAgFrw@mail.gmail.com>

fyi,

actually straight forward when also dumping the attributes:
udevadm info -a /dev/mtd0

here my rules
SUBSYSTEM=="mtd", ATTR{type}=="nand", ACTION=="add", SYMLINK+="mtd/%s{name}"
SUBSYSTEM=="mtd", ATTR{type}=="nor", ACTION=="add" SYMLINK+="mtd/spi"

/andi

Am Mi., 26. Juni 2019 um 11:36 Uhr schrieb Andreas Fenkart <afenkart@gmail.com>:
>
> After this patch, which is of course much appreciated:
>
> 1004a2977bdc7566bca87c565541c3232ed467c4
> Refs: v4.12-rc1-7-g1004a2977bdc
> Author:     Boris Brezillon <boris.brezillon@free-electrons.com>
> AuthorDate: Tue May 30 11:20:53 2017 +0200
> Commit:     Alexandre Belloni <alexandre.belloni@free-electrons.com>
> CommitDate: Wed May 31 11:55:41 2017 +0200
>
>     ARM: dts: at91: Switch to the new NAND bindings
>
>     Use the new EBI/NAND bindings to declare NAND chips and remove old NAND
>     nodes along the way.
>
>     Note that we keep using old bindings in at91rm9200.dtsi because this
>     SoC is not supported by the EBI driver.
>
> The listing and indexing of my mtd devices changed:
>
> root@after:~# cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00080000 00010000 "spi32766.0"
> ...
> mtd4: 32000000 00080000 "rootfs"
> mtd5: 0bc00000 00080000 "config"
>
> root@before:~# cat /proc/mtd
> dev:    size   erasesize  name
> ...
> mtd3: 32000000 00080000 "rootfs"
> mtd4: 0bc00000 00080000 "config"
> mtd5: 00080000 00010000 "spi32766.0"
>
>
> I assume sorting the mtd listing in a specific order is not supported
> nor desired by the mtd maintainers. So I'm not argueing about that.
>
> But since the index of rootfs device is hard-coded in the cmdline, the
> fw-utils config file and a custom script to backup/retrieve
> configuration, this is causing me some problems.
>
> The nand is partitioned, the spi is not:
> mtdparts=mtdparts=atmel_nand:2M(foo),2M(bar),32M(baz),800M(rootfs),-(config)
>
> While the bootargs can be fixed easily by using the human readable
> name (ubi.mtd=rootfs). I can't retrieve that human readable name from
> udev alone, nor can I build something from major/minor alone, since
> the major is the same for nand/spi flash.
>
> root@before:/etc/udev/rules.d# udevadm info /dev/mtd3
> P: /devices/platform/ahb/40000000.nand/mtd/mtd3
> N: mtd3
> E: DEVNAME=/dev/mtd3
> E: DEVPATH=/devices/platform/ahb/40000000.nand/mtd/mtd3
> E: DEVTYPE=mtd
> E: MAJOR=90
> E: MINOR=6
>
> root@dSS:/etc/udev/rules.d# udevadm info /dev/mtd5
> P: /devices/platform/ahb/ahb:apb/fffc8000.spi/spi_master/spi32766/spi32766.0/mtd/mtd5
> N: mtd5
> E: DEVNAME=/dev/mtd5
> E: DEVPATH=/devices/platform/ahb/ahb:apb/fffc8000.spi/spi_master/spi32766/spi32766.0/mtd/mtd5
> E: DEVTYPE=mtd
> E: MAJOR=90
> E: MINOR=10
> E: OF_COMPATIBLE_0=st,m25p40
> E: OF_COMPATIBLE_N=1
> E: OF_FULLNAME=/ahb/apb/spi@fffc8000/m25p40@0
> E: OF_NAME=m25p40
> E: SUBSYSTEM=mtd
>
> What is the preferred to make the rootfs agnostic of a particular mtd
> listing order

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2019-06-27 10:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26  9:36 regression: nand/spi flashes listed in reversed order after "ARM: dts: at91: Switch to the new NAND bindings" Andreas Fenkart
2019-06-27 10:44 ` Andreas Fenkart [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=CALtMJEBEo8u0YSqqAbRY0YwnuzCByAuQ8YKt8FrPzhoJpW_YCg@mail.gmail.com \
    --to=afenkart@gmail.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.michonski@digitalstrom.com \
    --cc=linux-mtd@lists.infradead.org \
    /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).