mbox series

[v2,0/9] mtd: spi-nand: Continuous read support

Message ID 20240826101412.20644-1-miquel.raynal@bootlin.com
Headers show
Series mtd: spi-nand: Continuous read support | expand

Message

Miquel Raynal Aug. 26, 2024, 10:14 a.m. UTC
Hello,

After the raw NAND series, here is an equivalent series bringing
continuous/sequential read support to spi-nand. The goal is to optimize
the reads when several consecutive pages are read. More explanations
about the "physics" in the patch 4 adding continuous read to the core.

The feature stops at the block boundary for two reasons:
* some vendors did not implement more
* NANDs are accessed through UBI these days, and there is absolutely no
guarantee (quite the opposite) two consecutive LEBs will end-up into two
consecutive PEBs.

The feature was tested using Macronix NANDs, and thus the vendor driver
is updated to expose this new feature.

Benchmarks are available in the last commit, but the overall the speed
gains are impressive: up to 45% when reading a block in 1-1-4 mode,
where a substantial time is lost waiting for the chip to be ready.

Modified userspace tools are also available for testing:
* https://lore.kernel.org/linux-mtd/20240826094629.19065-1-miquel.raynal@bootlin.com/T/#t
* https://github.com/miquelraynal/mtd-utils branch: cont-read

Cheers,
Miquèl

Changes in v2:
* A Reviewed-by from Pratyush.
* Dropped the static key optimization and turned the logic per-chip
  instead of global. 

Miquel Raynal (9):
  mtd: nand: Rename the NAND IO iteration helper
  mtd: nand: Introduce a block iterator
  mtd: spi-nand: Isolate the MTD read logic in a helper
  mtd: spi-nand: Add continuous read support
  mtd: spi-nand: Expose spinand_write_reg_op()
  mtd: spi-nand: macronix: Fix helper name
  mtd: spi-nand: macronix: Extract the bitflip retrieval logic
  mtd: spi-nand: macronix: Add a possible bitflip status flag
  mtd: spi-nand: macronix: Continuous read support

 drivers/mtd/nand/spi/core.c     | 216 ++++++++++++++++++++++++++++----
 drivers/mtd/nand/spi/macronix.c | 122 +++++++++++++-----
 include/linux/mtd/nand.h        |  90 +++++++++++--
 include/linux/mtd/spinand.h     |  17 +++
 4 files changed, 385 insertions(+), 60 deletions(-)