mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/2] mtd: rawnand: serialize OTP and BBT recovery operations
@ 2026-12-04 22:28 James Hilliard
  2026-12-04 22:28 ` [PATCH v4 1/2] mtd: rawnand: serialize OTP operations in the core James Hilliard
  2026-12-04 22:28 ` [PATCH v4 2/2] mtd: rawnand: serialize bad-block marker writes during BBT recovery James Hilliard
  0 siblings, 2 replies; 3+ messages in thread
From: James Hilliard @ 2026-12-04 22:28 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Arseniy Krasnov, Kyle Roeschley, Boris Brezillon
  Cc: linux-mtd, linux-kernel, James Hilliard, stable

Macronix OTP reads and writes switch the chip into a special mode.
Another NAND operation can reach the chip before it leaves that mode.
Run OTP callbacks under the same chip and controller locks as normal
I/O, including the wait for a suspended chip to resume.

Bad-block table recovery also issues NAND commands outside the normal
read/write wrappers. Take the same locks when writing a bad-block marker
after a table write or erase fails.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>

---
Changes in v4:
- Rebase on the accepted Macronix OTP error fix and drop the external
  prerequisite.
- Link to v3: https://patch.msgid.link/20261126-submit-rawnand-operation-locking-v1-v3-0-cd3794332f23@gmail.com

Changes in v3:
- Run raw NAND OTP callbacks under core-managed chip/controller locking
  and resume handling; keep target selection in the device-specific
  callbacks.
- Keep helper visibility changes with the BBT recovery patch that uses
  them.
- Link to v2: https://patch.msgid.link/20261122-submit-rawnand-operation-locking-v1-v2-0-030bc867f0c7@gmail.com

Changes in v2:
- Rebase on nand/next after the BBT logging change.
- Apply the Macronix locking change on top of the posted OTP error
  propagation fix; both touch the OTP cleanup path.
- Link to v1: https://patch.msgid.link/20261108-submit-rawnand-operation-locking-v1-v1-0-565010fc5f8b@gmail.com

---
James Hilliard (2):
      mtd: rawnand: serialize OTP operations in the core
      mtd: rawnand: serialize bad-block marker writes during BBT recovery

 drivers/mtd/nand/raw/internals.h     |   2 +
 drivers/mtd/nand/raw/nand_base.c     | 110 ++++++++++++++++++++++++++++++++++-
 drivers/mtd/nand/raw/nand_bbt.c      |   2 +
 drivers/mtd/nand/raw/nand_macronix.c |  32 +++++-----
 include/linux/mtd/rawnand.h          |  24 ++++++++
 5 files changed, 151 insertions(+), 19 deletions(-)
---
base-commit: dab547f4666f6649360053a95104b8c4480f46a8
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next
change-id: 20261108-submit-rawnand-operation-locking-v1-1a0b8fe786d4

Best regards,
--  
James Hilliard <james.hilliard1@gmail.com>


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

end of thread, other threads:[~2026-12-04 22:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-04 22:28 [PATCH v4 0/2] mtd: rawnand: serialize OTP and BBT recovery operations James Hilliard
2026-12-04 22:28 ` [PATCH v4 1/2] mtd: rawnand: serialize OTP operations in the core James Hilliard
2026-12-04 22:28 ` [PATCH v4 2/2] mtd: rawnand: serialize bad-block marker writes during BBT recovery James Hilliard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®