]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: sunxi: fix OOB handling in ->write_xxx() functions
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Mon, 14 Sep 2015 08:41:03 +0000 (10:41 +0200)
committerBrian Norris <computersforpeace@gmail.com>
Mon, 21 Sep 2015 20:36:42 +0000 (13:36 -0700)
commit2bcf7dc8a93e8d54655036baa282c1fbefd52b57
treee48836e5e4d1fb71522b52aa2d9f4df3d101334d
parent48fdd7874f07dfb3a661edca7ea1d4807bb4ccb0
mtd: nand: sunxi: fix OOB handling in ->write_xxx() functions

The USER_DATA register cannot be accessed using byte accessors on A13
SoCs, thus triggering a bug when using memcpy_toio on this register.
Declare an helper macros to convert an OOB buffer into a suitable
USER_DATA value and vice-versa.

This patch also fixes an error in the oob_required logic (some OOB data
are not written even if the user required it) by removing the
oob_required condition, which is perfectly valid since the core already
fill ->oob_poi with FFs when oob_required is false.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: <stable@vger.kernel.org> # 3.19+
Fixes: 26986f99510e ("mtd: nand: add sunxi NAND flash controller support")
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/sunxi_nand.c