mtd: spinand: try a regular dirmap if creating a dirmap for continuous reading fails
authorMikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Tue, 30 Sep 2025 00:21:08 +0000 (03:21 +0300)
committerMichael Trimarchi <michael@amarulasolutions.com>
Sun, 5 Oct 2025 18:26:35 +0000 (20:26 +0200)
commit5ded13d1e2805b82b563224ec106fa6ad6a4b4db
tree0c49215446a42b63741192dfdb52fffa4c8d6af4
parente74f706334e8f559c2f8de8b58612a1df645f806
mtd: spinand: try a regular dirmap if creating a dirmap for continuous reading fails

Continuous reading may result in multiple flash pages reading in one
operation. Typically only one flash page has read/written (a little bit
more than 2-4 Kb), but continuous reading requires the spi controller
to read up to 512 Kb in one operation without toggling CS in beetween.

Roughly speaking spi controllers can be divided on 2 categories:
 * spi controllers without dirmap acceleration support
 * spi controllers with dirmap acceleration support

Firt of them will have issues with continuous reading if restriction on
the transfer length is implemented in the adjust_op_size() handler.
Second group often supports acceleration of single page only reading.
Thus enabling of continuous reading can break flash reading.

This patch tries to create dirmap for continuous reading first and
fallback to regular reading if spi controller refuses to create it.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
drivers/mtd/nand/spi/core.c