]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: marvell: Fix read logic for layouts with ->nchunks > 2
authorBoris Brezillon <boris.brezillon@bootlin.com>
Wed, 9 May 2018 07:13:58 +0000 (09:13 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 14 May 2018 12:46:20 +0000 (14:46 +0200)
commite1993ec993f03f8f46a19865c69efcecb5e247d2
treebde32fbbe9bb2b937403158b9bad282396078fd3
parent12b086c1e9e7149735cb030b5c70eec6c8d89546
mtd: rawnand: marvell: Fix read logic for layouts with ->nchunks > 2

The code is doing monolithic reads for all chunks except the last one
which is wrong since a monolithic read will issue the
READ0+ADDRS+READ_START sequence. It not only takes longer because it
forces the NAND chip to reload the page content into its internal
cache, but by doing that we also reset the column pointer to 0, which
means we'll always read the first chunk instead of moving to the next
one.

Rework the code to do a monolithic read only for the first chunk,
then switch to naked reads for all intermediate chunks and finally
issue a last naked read for the last chunk.

Fixes: 8cfde04381f0 mtd: nand: add reworked Marvell NAND controller driver
Cc: stable@vger.kernel.org
Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/marvell_nand.c