summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2015-03-24 17:54:19 +0100
committerScott Wood <scottwood@freescale.com>2015-03-30 23:33:42 -0500
commit7653fc288a964ce5bb0cff9176444260731d0f90 (patch)
tree131f8a26377dacc182e83f8789ea6a7883244892 /drivers/mtd
parent004a1fdb45fb06ee2faf6e50945ceb79d43a2f41 (diff)
downloadu-boot-imx-7653fc288a964ce5bb0cff9176444260731d0f90.zip
u-boot-imx-7653fc288a964ce5bb0cff9176444260731d0f90.tar.gz
u-boot-imx-7653fc288a964ce5bb0cff9176444260731d0f90.tar.bz2
mtd: vf610_nfc: mark page as dirty on block erase
The driver tries to re-use the page buffer by storing the page number of the current page in the buffer. The page is only read if the requested page number is not currently in the buffer. When a block is erased, the page number is marked as invalid if the erased page equals the one currently in the cache. However, since a erase block consists of multiple pages, also other page numbers could be affected. The commands to reproduce this issue (on a written page): > nand dump 0x800 > nand erase 0x0 0x20000 > nand dump 0x800 The second nand dump command returns the data from the buffer, while in fact the page is erased (0xff). Avoid the hassle to calculate whether the page is affected or not, but set the page buffer unconditionally to invalid instead. Signed-off-by: Stefan Agner <stefan@agner.ch>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/vf610_nfc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 928d58b..9de971c 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -369,8 +369,7 @@ static void vf610_nfc_command(struct mtd_info *mtd, unsigned command,
break;
case NAND_CMD_ERASE1:
- if (nfc->page == page)
- nfc->page = -1;
+ nfc->page = -1;
vf610_nfc_send_commands(nfc->regs, command,
NAND_CMD_ERASE2, ERASE_CMD_CODE);
vf610_nfc_addr_cycle(mtd, column, page);