mtd: spinand: Handle the case where PROGRAM LOAD does not reset the cache
authorBoris Brezillon <bbrezillon@kernel.org>
Thu, 24 Jan 2019 14:20:07 +0000 (15:20 +0100)
committerBoris Brezillon <bbrezillon@kernel.org>
Thu, 31 Jan 2019 11:30:51 +0000 (12:30 +0100)
commit13c15e07eedf26092054c8c71f2f47edb8388310
tree99efe0fc738c899b0faca0df61350969c63fa314
parent49a57857aeea06ca831043acbb0fa5e0f50602fd
mtd: spinand: Handle the case where PROGRAM LOAD does not reset the cache

Looks like PROGRAM LOAD (AKA write cache) does not necessarily reset
the cache content to 0xFF (depends on vendor implementation), so we
must fill the page cache entirely even if we only want to program the
data portion of the page, otherwise we might corrupt the BBM or user
data previously programmed in OOB area.

Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Reported-by: Stefan Roese <sr@denx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
Tested-by: Stefan Roese <sr@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/spi/core.c