]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: omap: Fix 1-bit Hamming code scheme, omap_calculate_ecc()
authorRoger Quadros <rogerq@ti.com>
Mon, 25 Aug 2014 23:15:33 +0000 (16:15 -0700)
committerTony Lindgren <tony@atomide.com>
Mon, 25 Aug 2014 23:15:33 +0000 (16:15 -0700)
commitc95d1afa066955ae1e661c4048ecfd924b5a4ec0
tree4316c38668586dc606e189c3102cbb1bd3fb202a
parent36b6a86d207d1cae1811b9f834b09ae1b976c770
mtd: nand: omap: Fix 1-bit Hamming code scheme, omap_calculate_ecc()

commit 01d431a4bb67 introduced in v3.7 caused a regression
by using a reversed CS_MASK thus causing omap_calculate_ecc to
always fail. As the NAND base driver never checks for .calculate()'s
return value, the zeroed ECC values are used as is without showing
any error to the user. However, this won't work and the NAND device
won't be guarded by any error code.

Fix the issue by using the correct mask.

Code was tested on omap3beagle using the following procedure
- flash the primary bootloader (MLO) from the kernel to the first
NAND partition using nandwrite.
- boot the board from NAND. This utilizes OMAP ROM loader that
relies on 1-bit Hamming code ECC.

Fixes: 01d431a4bb67 (mtd: nand: omap2: handle nand on gpmc)
Cc: <stable@vger.kernel.org> [3.7+]
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mtd/nand/omap2.c