]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
mtd: vf610_nfc: mark page as dirty on block erase
authorStefan Agner <stefan@agner.ch>
Tue, 24 Mar 2015 16:54:19 +0000 (17:54 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:38:12 +0000 (14:38 +0200)
commitb65875b6caddec108e7e0b4e0d376e8b94c173ba
tree95c3eba226fe6d99df5dd918e073f38aef8454b6
parentb9d3ee31aa550b8a1985b6978f49d2e664d68d51
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>
drivers/mtd/nand/vf610_nfc.c