mtd: nand: sunxi: Fix OOB bytes retrieval in read_chunks_dma()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Aug 1 18:59:06 PDT 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=252173c69eec6998ecf1be7b11d31cd39ce92c9c
Commit:     252173c69eec6998ecf1be7b11d31cd39ce92c9c
Parent:     1d6b1e4649500c170fb6e243c0b92f40bb8a0185
Author:     Boris Brezillon <boris.brezillon at free-electrons.com>
AuthorDate: Wed Jun 15 11:22:12 2016 +0200
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Mon Jul 11 08:39:59 2016 +0200

    mtd: nand: sunxi: Fix OOB bytes retrieval in read_chunks_dma()
    
    The column address passed to the RNDOUT operation was missing the page
    size offset.
    
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
    Fixes: 614049a8d904 ("mtd: nand: sunxi: add support for DMA assisted operations")
---
 drivers/mtd/nand/sunxi_nand.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c
index 653cb3a..b9a2e5d 100644
--- a/drivers/mtd/nand/sunxi_nand.c
+++ b/drivers/mtd/nand/sunxi_nand.c
@@ -1094,7 +1094,8 @@ static int sunxi_nfc_hw_ecc_read_chunks_dma(struct mtd_info *mtd, uint8_t *buf,
 
 		if (oob_required && !erased) {
 			/* TODO: use DMA to retrieve OOB */
-			nand->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_off, -1);
+			nand->cmdfunc(mtd, NAND_CMD_RNDOUT,
+				      mtd->writesize + oob_off, -1);
 			nand->read_buf(mtd, oob, ecc->bytes + 4);
 
 			sunxi_nfc_hw_ecc_get_prot_oob_bytes(mtd, oob, i,
@@ -1129,7 +1130,8 @@ static int sunxi_nfc_hw_ecc_read_chunks_dma(struct mtd_info *mtd, uint8_t *buf,
 			}
 
 			/* TODO: use DMA to retrieve OOB */
-			nand->cmdfunc(mtd, NAND_CMD_RNDOUT, oob_off, -1);
+			nand->cmdfunc(mtd, NAND_CMD_RNDOUT,
+				      mtd->writesize + oob_off, -1);
 			nand->read_buf(mtd, oob, ecc->bytes + 4);
 
 			ret = nand_check_erased_ecc_chunk(data,	ecc->size,



More information about the linux-mtd-cvs mailing list