]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: spi-nor: core: avoid odd length/address reads on 8D-8D-8D mode
authorPratyush Yadav <p.yadav@ti.com>
Tue, 8 Jul 2025 09:16:45 +0000 (17:16 +0800)
committerPratyush Yadav <pratyush@kernel.org>
Mon, 1 Sep 2025 14:11:55 +0000 (16:11 +0200)
commitf156b23df6a84efb2f6686156be94d4988568954
tree7f708b0e822e0bd7b42b1900f30f4f6c56948a69
parent8f5ae30d69d7543eee0d70083daf4de8fe15d585
mtd: spi-nor: core: avoid odd length/address reads on 8D-8D-8D mode

On Octal DTR capable flashes like Micron Xcella reads cannot start or
end at an odd address in Octal DTR mode. Extra bytes need to be read at
the start or end to make sure both the start address and length remain
even.

To avoid allocating too much extra memory, thereby putting unnecessary
memory pressure on the system, the temporary buffer containing the extra
padding bytes is capped at PAGE_SIZE bytes. The rest of the 2-byte
aligned part should be read directly in the main buffer.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
Link: https://lore.kernel.org/r/20250708091646.292-1-ziniu.wang_1@nxp.com
drivers/mtd/spi-nor/core.c