archive mirror
 help / color / mirror / Atom feed
From: "Thibaut VARÈNE" <>
	"Thibaut VARÈNE" <>
Subject: [PATCH v3 0/3] mtd: write support for minor-aligned partitions
Date: Fri, 29 Jul 2022 11:16:33 +0200	[thread overview]
Message-ID: <> (raw)

This patch series enable write support for minor-aligned mtd partitions
on devices that support multiple erasesizes.

On supporting hardware, they enable RW operations on mtd partitions that
break "major" (largest) erasesize boundary (e.g. too small or not
correctly aligned) without sacrificing performance (i.e. forcing
everything to use 4K sectors). Finally, they address an historical FIXME
in mtdpart.c.

The following performance numbers were measured with v5.10 kernel on OpenWrt:
(CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y forces the use of the new code path)

OpenWrt 5.10 ramips MT7621 w25q128jv 0xfc0000 firmware partition length
time mtd erase firmware

Without this patch:
real    0m 50.86s		|2m 11.66s
user    0m 0.00s		|0m 0.00s
sys     0m 50.80s		|1m 56.20s
can write minor-aligned parts? N|Y

With this patch:
real    0m 51.68s		|0m 50.85s	|2m 12.89s
user    0m 0.00s		|0m 0.00s	|0m 0.01s
sys     0m 46.94s		|0m 50.38s	|2m 12.46s
can write minor-aligned parts? N|Y		|Y

NB: This patchset was previously submitted as a monolithic patch (RFC[0],
v1[1]). While not submitted upstream v2 was however reviewed, tested and
accepted in OpenWrt, and backported into the upcoming 22.03 stable branch:


Changes v2 -> v3:
  - Split patch into incremental, functionally-separate changes.
  - Adjusted erasesize_minor assignment check in spi-nor/core.c
  - Addressed checkpatch warning on "printk(KERN_WARNING..."
  - Documented new sysfs attribute

Changes v1 -> v2:
  - Added mtdcore sysfs attribute for erasesize_minor
  - Removed finding minor erasesize for variable erase regions device,
    (untested and no response to RFC).
  - Moved IF_ENABLED() to guard setting erasesize_minor in spi-nor/core.c
  - Removed setting major erasesize to minor where partition boundaries
    require minor erase to be writable
  - Simplified minor boundary check by relying on minor being a factor
    of major

Changes RFC -> v1:
  - Fixed uninitialized variable smatch warning

Thibaut VARÈNE (3):
  mtd: mtdpart: write support for minor-aligned partitions
  mtd: spi-nor: set erasesize_minor in spi_nor_select_erase()
  mtd: spi-nor: allow overriding uniform erase

 Documentation/ABI/testing/sysfs-class-mtd |  8 ++++++
 drivers/mtd/mtdcore.c                     | 10 +++++++
 drivers/mtd/mtdpart.c                     | 35 ++++++++++++++++-------
 drivers/mtd/spi-nor/Kconfig               | 10 +++++++
 drivers/mtd/spi-nor/core.c                | 13 +++++++--
 include/linux/mtd/mtd.h                   |  2 ++
 6 files changed, 65 insertions(+), 13 deletions(-)

base-commit: e0dccc3b76fb35bb257b4118367a883073d7390e

Linux MTD discussion mailing list

             reply	other threads:[~2022-07-29  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29  9:16 Thibaut VARÈNE [this message]
2022-07-29  9:16 ` [PATCH v3 1/3] mtd: mtdpart: write support for minor-aligned partitions Thibaut VARÈNE
2022-07-29  9:16 ` [PATCH v3 2/3] mtd: spi-nor: set erasesize_minor for non-uniform erase Thibaut VARÈNE
2022-07-29  9:16 ` [PATCH v3 3/3] mtd: spi-nor: allow overriding uniform erase Thibaut VARÈNE
2022-08-09  9:23 ` [PATCH v3 0/3] mtd: write support for minor-aligned partitions Thibaut VARÈNE
2022-08-09 15:45   ` Tudor.Ambarus

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \

* 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).