linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] mtd: write support for minor-aligned partitions
@ 2022-07-29  9:16 Thibaut VARÈNE
  2022-07-29  9:16 ` [PATCH v3 1/3] mtd: mtdpart: " Thibaut VARÈNE
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Thibaut VARÈNE @ 2022-07-29  9:16 UTC (permalink / raw)
  To: linux-mtd
  Cc: miquel.raynal, richard, vigneshr, tudor.ambarus, p.yadav,
	michael, git, Thibaut VARÈNE

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:
MTD_SPI_NOR_USE_4K_SECTORS=n	|y
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:
MTD_SPI_NOR_USE_VARIABLE_ERASE=n|y		|4K_SECTORS=y
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:
https://github.com/openwrt/openwrt/pull/3271

[0] 20210104122853.18428-1-git@johnthomson.fastmail.com.au
[1] 20210608040719.14431-1-git@johnthomson.fastmail.com.au

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
-- 
2.30.2


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-09 15:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-29  9:16 [PATCH v3 0/3] mtd: write support for minor-aligned partitions Thibaut VARÈNE
2022-07-29  9:16 ` [PATCH v3 1/3] mtd: mtdpart: " 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

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