Linux Documentation
 help / color / mirror / Atom feed
From: Orgad Shaneh <orgads@gmail.com>
To: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com,
	tsbogend@alpha.franken.de
Cc: linux-mtd@lists.infradead.org, linux-mips@vger.kernel.org,
	linux-kernel@vger.kernel.org, linusw@kernel.org,
	kaloz@kernel.org, ulli.kroll@googlemail.com, john@phrozen.org,
	nico@fluxnic.net, dwmw2@infradead.org, corbet@lwn.net,
	linux-doc@vger.kernel.org
Subject: [PATCH v4 0/4] mtd: point() for cfi_cmdset_0002, on simple maps only
Date: Tue, 17 Nov 2026 21:41:37 +0000	[thread overview]
Message-ID: <20261117214141.3826637-1-orgads@gmail.com> (raw)

jffs2 scans a flash in place through mtd_point() when the chip driver
offers it, and copies every used eraseblock otherwise. cfi_cmdset_0002
has no point(), so an Octeon CN6635 board with a 100 MB jffs2
partition on an 8-bit M29EW spends 15-30 s mounting it at every boot.

1/4 lets point() through only for maps read through the simple
accessors; cfi_cmdset_0001, lpddr, map_ram and map_rom point today at
maps whose own accessors swap bytes, switch pins or lock the bus.
2/4 adds point() to cfi_cmdset_0002 behind that gate.
3/4 gives each Octeon flash device its own map.
4/4 lets that map use the simple accessors when no eMMC shares the
boot bus. 3/4 and 4/4 build alone, but 4/4 only pays off with 1/4 and
2/4, so taking all four through mtd with an ack from Thomas seems
simplest.

Tested on that board with 7.3.4: the mount drops to 0.55-0.6 s, and
an 8 MB file written to the jffs2 partition keeps its md5 across a
reboot. v3 held its md5s across ten 8 MB write/delete rounds on 7.2.9.
The series applies to v7.4-rc1.

One question: a cramfs on AMD flash falls back to the block device
today. After 2/4 it keeps its image pointed while mounted, as it does
on Intel flash, so jffs2 writes to the same chip wait until cramfs is
unmounted. Is that acceptable, or should point() in cfi_cmdset_0002
be opt-in?

Changes in v4:
- 1/4 also gates lpddr, map_ram and map_rom (compile-tested only).
- New 3/4: the per-device map sashiko asked for on v2 and v3.
- Rebased onto v7.4-rc1; Assisted-by dropped (an LLM helped write
  this series).

Earlier changes, in v4 numbering:
- v3: in 2/4, an XIP erase no longer lets a point through either.
- v2: in 2/4, a point no longer suspends an erase in progress; 4/4
  checks the bank width before ioremap().

v3: https://lore.kernel.org/all/20261011062908.2365879-1-orgads@gmail.com/
v2: https://lore.kernel.org/all/20261010180840.2152492-1-orgads@gmail.com/
v1: https://lore.kernel.org/all/20261010172142.2138956-1-orgads@gmail.com/

Orgad Shaneh (4):
  mtd: maps: only point() maps read through the simple accessors
  mtd: cfi_cmdset_0002: implement point() for simple linear maps
  MIPS: Octeon: flash: allocate the map per device
  MIPS: Octeon: flash: use the simple map accessors without a shared eMMC

  Documentation/filesystems/cramfs.rst  |  11 ++-
  arch/mips/cavium-octeon/flash_setup.c |  73 +++++++++++----
  drivers/mtd/chips/cfi_cmdset_0001.c   |   2 +-
  drivers/mtd/chips/cfi_cmdset_0002.c   | 167 +++++++++++++++++++++++++++++++++-
  drivers/mtd/chips/map_ram.c           |   4 +-
  drivers/mtd/chips/map_rom.c           |   6 +-
  drivers/mtd/lpddr/lpddr_cmds.c        |   2 +-
  drivers/mtd/maps/map_funcs.c          |  12 +++
  include/linux/mtd/map.h               |   2 +
  9 files changed, 245 insertions(+), 34 deletions(-)

-- 
2.53.0


             reply	other threads:[~2026-11-17 21:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 21:41 Orgad Shaneh [this message]
2026-11-17 21:41 ` [PATCH v4 1/4] mtd: maps: only point() maps read through the simple accessors Orgad Shaneh
2026-11-17 21:41 ` [PATCH v4 2/4] mtd: cfi_cmdset_0002: implement point() for simple linear maps Orgad Shaneh
2026-11-17 21:41 ` [PATCH v4 3/4] MIPS: Octeon: flash: allocate the map per device Orgad Shaneh
2026-11-17 21:41 ` [PATCH v4 4/4] MIPS: Octeon: flash: use the simple map accessors without a shared eMMC Orgad Shaneh

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=20261117214141.3826637-1-orgads@gmail.com \
    --to=orgads@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dwmw2@infradead.org \
    --cc=john@phrozen.org \
    --cc=kaloz@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=nico@fluxnic.net \
    --cc=richard@nod.at \
    --cc=tsbogend@alpha.franken.de \
    --cc=ulli.kroll@googlemail.com \
    --cc=vigneshr@ti.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