mtd: nand: pxa3xx: fix raw read when last_chunk_size == 0
Subsystems (2)
PATCH 1/1 mtd: nand: pxa3xx: fix raw read when last_chunk_size == 0
Commit 6293b0361d9 ("mtd: nand: pxa3xx: add raw read support") added the local data_len variable in handle_data_pio() to track read size, but forgot to update the condition of drain_fifo() call. That happens to work when the layout last_chunk_size != 0. But when last_chunk_size == 0, drain_fifo() is not called to read the last chunk, which leads to "Wait timeout!!!" error. Fix this.
--- drivers/mtd/nand/raw/pxa3xx_nand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/pxa3xx_nand.c +1 -1
@@ -639,7 +639,7 @@ static void handle_data_pio(struct pxa3xx_nand_info *info) DIV_ROUND_UP(info->step_spare_size, 4));break ;case STATE_PIO_READING : -if (info->step_chunk_size) +if (data_len)drain_fifo (info, info->data_buff + info->data_buff_pos,DIV_ROUND_UP (data_len,4 ));
Signature · 1 line
2.25.1
PATCH 1/1 mtd: nand: pxa3xx: fix raw read when last_chunk_size == 0
Quoted 10 lines · Baruch Siach
Commit
6293b0361d9("mtd: nand: pxa3xx: add raw read support") added the localdata_lenvariable inhandle_data_pio()to track read size, but forgot to update the condition ofdrain_fifo()call. That happens to work when the layoutlast_chunk_size!= 0. But whenlast_chunk_size== 0,drain_fifo()is not called to read the last chunk, which leads to "Wait timeout!!!" error. Fix this.Fixes 6293b0361d9 ("mtd: nand: pxa3xx: add raw read support")Cc Miquel Raynal <[email protected]>Signed-off-by Baruch Siach <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200426/2be4fb03/attachment.sig>