Skip to content

Commit 98d1fb9

Browse files
zmlin1998ambarus
authored andcommitted
mtd: spi-nor: core: replace dummy buswidth from addr to data
The default dummy cycle for Macronix SPI NOR flash in Octal Output Read Mode(1-1-8) is 20. Currently, the dummy buswidth is set according to the address bus width. In the 1-1-8 mode, this means the dummy buswidth is 1. When converting dummy cycles to bytes, this results in 20 x 1 / 8 = 2 bytes, causing the host to read data 4 cycles too early. Since the protocol data buswidth is always greater than or equal to the address buswidth. Setting the dummy buswidth to match the data buswidth increases the likelihood that the dummy cycle-to-byte conversion will be divisible, preventing the host from reading data prematurely. Fixes: 0e30f47 ("mtd: spi-nor: add support for DTR protocol") Cc: [email protected] Reviewed-by: Pratyush Yadav <[email protected]> Signed-off-by: Cheng Ming Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tudor Ambarus <[email protected]>
1 parent f8f6224 commit 98d1fb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/spi-nor/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void spi_nor_spimem_setup_op(const struct spi_nor *nor,
8989
op->addr.buswidth = spi_nor_get_protocol_addr_nbits(proto);
9090

9191
if (op->dummy.nbytes)
92-
op->dummy.buswidth = spi_nor_get_protocol_addr_nbits(proto);
92+
op->dummy.buswidth = spi_nor_get_protocol_data_nbits(proto);
9393

9494
if (op->data.nbytes)
9595
op->data.buswidth = spi_nor_get_protocol_data_nbits(proto);

0 commit comments

Comments
 (0)