From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Joern Engel <joern@lazybastard.org>,
Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Saravana Kannan <saravanak@google.com>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Florian Fainelli <f.fainelli@gmail.com>,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nvme@lists.infradead.org
Subject: Re: [PATCH v4 0/7] mtd: improve block2mtd + airoha parser
Date: Mon, 12 Aug 2024 15:17:55 +0200 [thread overview]
Message-ID: <20240812151755.0feab4b2@xps-13> (raw)
In-Reply-To: <66b9df7c.050a0220.3574aa.d5bb@mx.google.com>
Hi Christian,
ansuelsmth@gmail.com wrote on Mon, 12 Aug 2024 12:10:03 +0200:
> On Mon, Aug 12, 2024 at 10:49:54AM +0200, Miquel Raynal wrote:
> > Hi Christian,
> >
> > ansuelsmth@gmail.com wrote on Fri, 9 Aug 2024 19:20:58 +0200:
> >
> > > This small series handle 2 problems.
> > >
> > > It does try to ""standardize"" the usage of block2mtd module with
> > > MTD OF nodes.
> > >
> > > It is very easy to add support for MTD parser by just adding an
> > > OF node to the mtd created for block2mtd.
> > >
> > > This apply only if the root block is used for block2mtd to allow
> > > scenario where the full eMMC or an NVME is used for MTD and it doesn't
> > > have any partition table.
> > >
> > > To also support NVME, similar to how it's done with eMMC, we introduce
> > > a subnode to the NVME controller that needs to have the "nvme-card"
> > > compatible where a dev can define fixed-paritions for MTD parser usage.
> > >
> > > This series also add support for the Airoha partition table where
> > > the last partition is always ART and is placed at the end of the flash.
> > >
> > > This require dynamic calculation of the offset as some dedicated
> > > driver for bad block management might be used that reserve some space
> > > at the end of the flash for block accounting.
> >
> > Who is reserving this space? And this is not reflected anywhere in the
> > partition table?
> >
>
> To be more precise Mediatek use a custom way to handle bad blocks called
> BMT where they reserve and store data at the end of the nand. This is
> loaded before the flash driver controller so when MTD is init, the size
> is already reduced. The reserved space can change and it really depends
> on the tuned values hence it may change.
Is this supported in mainline Linux? MTD handles the bad blocks and the
bad block tables, so I don't understand how this hardware feature can
live together with MTD.
Anyway, you are talking about MMCs, I don't understand why there are
bad blocks, nor what is checking them and when. This is all still very
fuzzy to me, I'm sorry.
> > > New aarch64 Airoha SoC make use of this partition table and use block2mtd
> > > for eMMC to treat them as MTD with custom bad block management and block
> > > tracking.
> >
> > I am sorry, I am not used to such use cases, and I really fail getting
> > why you would like to use mtd with an eMMC. Can you explain a little
> > bit more what is not available in the block world that you really need
> > from mtd?
>
> Since vendor needs more space and doesn't want to adapt to block world,
> they are starting to use eMMC or block devices in general unpartitioned
> and raw
Okay, why not, it's easier for ROMs to access it I guess.
> and using block2mtd to simulate it.
This is what I don't understand. You can very well access your block
device by offset, why do you need the mtd interface at all?
> They don't care about the
> performance penalities as it's something read at boot time and only new
> firmware or some config files are written.
>
> Is it more clear now?
I still don't understand the need for going through MTD tbh.
> > Also, did you consider nvmem layouts instead to detect and define the
> > ART area? (just asking).
> >
>
> They still need a MTD partition
Why?
> and most of the time userspace tool are
> used on the ART partition. Using block2mtd and DT support will permit
> the use of nvmem cell as a side effect (and that is a missive bonus
> point of this honestly)
MTD also registers into NVMEM, so this is nice if you need both, but if
what you need is some NVMEM area derived dynamically and you register
into MTD for that, then no, I'm sorry, that's not the correct approach.
Thanks,
Miquèl
next prev parent reply other threads:[~2024-08-12 13:17 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 17:20 [PATCH v4 0/7] mtd: improve block2mtd + airoha parser Christian Marangi
2024-08-09 17:20 ` [PATCH v4 1/7] dt-bindings: nvme: Document nvme-card compatible Christian Marangi
2024-08-09 17:21 ` [PATCH v4 2/7] nvme: assign of_node to nvme device Christian Marangi
2024-08-12 11:12 ` Christoph Hellwig
2024-08-12 12:10 ` Christian Marangi
2024-08-12 13:31 ` Christoph Hellwig
2024-08-13 20:04 ` Rob Herring
2024-08-13 9:15 ` Markus Elfring
2024-08-09 17:21 ` [PATCH v4 3/7] dt-bindings: mmc: add property for partitions node in mmc-card node Christian Marangi
2024-08-13 20:07 ` Rob Herring
2024-08-20 20:20 ` Christian Marangi
2024-08-21 13:12 ` Miquel Raynal
2024-08-20 21:55 ` Christian Marangi
2024-08-21 13:14 ` Ulf Hansson
2024-08-20 22:06 ` Christian Marangi
2024-08-21 21:53 ` Ulf Hansson
2024-08-09 17:21 ` [PATCH v4 4/7] block2mtd: attach device OF node to MTD device Christian Marangi
2024-08-09 17:21 ` [PATCH v4 5/7] of: also export of_update_property Christian Marangi
2024-08-09 17:21 ` [PATCH v4 6/7] dt-bindings: mtd: Add Documentation for Airoha fixed-partitions Christian Marangi
2024-08-09 17:21 ` [PATCH v4 7/7] mtd: parser: add support for Airoha parser Christian Marangi
2024-08-12 8:49 ` [PATCH v4 0/7] mtd: improve block2mtd + airoha parser Miquel Raynal
2024-08-12 10:10 ` Christian Marangi
2024-08-12 13:17 ` Miquel Raynal [this message]
2024-08-12 13:25 ` Christoph Hellwig
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=20240812151755.0feab4b2@xps-13 \
--to=miquel.raynal@bootlin.com \
--cc=ansuelsmth@gmail.com \
--cc=axboe@kernel.dk \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=hch@lst.de \
--cc=joern@lazybastard.org \
--cc=kbusch@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-nvme@lists.infradead.org \
--cc=richard@nod.at \
--cc=robh@kernel.org \
--cc=sagi@grimberg.me \
--cc=saravanak@google.com \
--cc=tsbogend@alpha.franken.de \
--cc=ulf.hansson@linaro.org \
--cc=vigneshr@ti.com \
--cc=wsa+renesas@sang-engineering.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