From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from down.free-electrons.com ([37.187.137.238] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bExlM-0000Ma-Dk for linux-mtd@lists.infradead.org; Mon, 20 Jun 2016 11:53:09 +0000 Date: Mon, 20 Jun 2016 13:52:46 +0200 From: Boris Brezillon To: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org, Boris Brezillon , Richard Weinberger Cc: Maxime Ripard , Chen-Yu Tsai , linux-sunxi@googlegroups.com Subject: Re: [PATCH] mtd: nand: sunxi: Fix OOB bytes retrieval in read_chunks_dma() Message-ID: <20160620135246.55b1abd0@bbrezillon> In-Reply-To: <1465982532-30174-1-git-send-email-boris.brezillon@free-electrons.com> References: <1465982532-30174-1-git-send-email-boris.brezillon@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 15 Jun 2016 11:22:12 +0200 Boris Brezillon wrote: > The column address passed to the RNDOUT operation was missing the page > size offset. > Applied. > Signed-off-by: Boris Brezillon > 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 ea74827..bcdd015 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,