From: Gabor Juhos Date: Mon, 17 Sep 2012 20:30:51 +0000 (+0000) Subject: ar71xx: ar934x_nfc: fix RNDOUT operation X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=96dde2e591fd952ba4dc471e55ed88f21c2683d6;p=openwrt%2Fstaging%2Fthess.git ar71xx: ar934x_nfc: fix RNDOUT operation SVN-Revision: 33451 --- diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c b/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c index 86899fd720..d889c70b02 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/ar934x_nfc.c @@ -643,10 +643,14 @@ ar934x_nfc_cmdfunc(struct mtd_info *mtd, unsigned int command, int column, break; case NAND_CMD_RNDOUT: + if (WARN_ON(nfc->small_page)) + break; + /* emulate subpage read */ - ar934x_nfc_send_read(nfc, nfc->rndout_read_cmd, column, + ar934x_nfc_send_read(nfc, nfc->rndout_read_cmd, 0, nfc->rndout_page_addr, - mtd->writesize, false); + mtd->writesize + mtd->oobsize, false); + nfc->buf_index = column; break; case NAND_CMD_ERASE1: