From: Daniel Golle <daniel@makrotopia.org>
To: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Richard Weinberger" <richard@nod.at>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Zhihao Cheng" <chengzhihao1@huawei.com>,
"Rafał Miłecki" <zajec5@gmail.com>
Subject: [PATCH 0/4] mtd: ubi: behave like a good MTD citizen
Date: Tue, 2 May 2023 17:47:48 +0100 [thread overview]
Message-ID: <cover.1683043928.git.daniel@makrotopia.org> (raw)
As of now one can easily trigger the existence of "ghost" UBI devices
or even worse by removing e.g. the SPI bus driver which previously
provided access to an SPI-NAND chip.
Make UBI behave more like other MTD users and create/remove UBI devices
based on MTD notifications. As removing could previously fail in case
of an ubiblock device still being in use, make sure there are no
excuses preventing release of an already gone MTD partition.
This makes it possible to attach UBI devices immediately after the MTD
partition becomes available, which will allow using UBI volumes as
nvmem-cells provider in the future [1]. Introduce new device tree
compatible "linux,ubi" to be used on MTD partitions which should be
attached.
In order to make sure ubiblock devices are still created according to
the module or kernel parameters, let ubiblock creation from parameters
be triggered by UBI_VOLUME_ADDED notifications instead of trying only
once during boot.
[1]: https://forum.openwrt.org/t/asus-tuf-ax4200-support/155738/44?u=daniel
Daniel Golle (4):
mtd: ubi: block: don't return on error when removing
mtd: ubi: block: use notifier to create ubiblock from parameter
dt-bindings: mtd: partitions: add linux,ubi
mtd: ubi: attach MTD partition from device-tree
.../bindings/mtd/partitions/ubi.yaml | 49 +++++
drivers/mtd/ubi/block.c | 158 ++++++++-------
drivers/mtd/ubi/build.c | 189 ++++++++++++------
drivers/mtd/ubi/cdev.c | 4 +-
drivers/mtd/ubi/ubi.h | 6 +-
5 files changed, 271 insertions(+), 135 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mtd/partitions/ubi.yaml
base-commit: b5fda08ef213352ac2df7447611eb4d383cce929
--
2.40.1
next reply other threads:[~2023-05-02 16:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-02 16:47 Daniel Golle [this message]
2023-05-02 16:48 ` [PATCH 1/4] mtd: ubi: block: don't return on error when removing Daniel Golle
2023-05-03 13:09 ` Zhihao Cheng
2023-05-24 9:41 ` Daniel Golle
2023-05-26 10:15 ` Zhihao Cheng
2023-05-02 16:48 ` [PATCH 2/4] mtd: ubi: block: use notifier to create ubiblock from parameter Daniel Golle
2023-05-02 16:48 ` [PATCH 3/4] dt-bindings: mtd: partitions: add linux,ubi compatible Daniel Golle
2023-05-05 21:56 ` Rob Herring
2023-05-02 16:48 ` [PATCH 4/4] mtd: ubi: attach MTD partition from device-tree Daniel Golle
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=cover.1683043928.git.daniel@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=chengzhihao1@huawei.com \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
--cc=robh+dt@kernel.org \
--cc=vigneshr@ti.com \
--cc=zajec5@gmail.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