[U-Boot] [PATCH] mtd: nand: omap_gpmc: Fix update of read_ecc in oob

We need to flip only one bit not assign.
Signed-off-by: Marek Belisko marek.belisko@gmail.com --- drivers/mtd/nand/omap_gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c index 881a636..bf99b8e 100644 --- a/drivers/mtd/nand/omap_gpmc.c +++ b/drivers/mtd/nand/omap_gpmc.c @@ -403,7 +403,7 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat, dat[byte_pos] ^= 1 << bit_pos; printf("nand: bit-flip corrected @data=%d\n", byte_pos); } else if (byte_pos < error_max) { - read_ecc[byte_pos - SECTOR_BYTES] = 1 << bit_pos; + read_ecc[byte_pos - SECTOR_BYTES] ^= 1 << bit_pos; printf("nand: bit-flip corrected @oob=%d\n", byte_pos - SECTOR_BYTES); } else {

From: Marek Belisko [mailto:marek.belisko@gmail.com]
We need to flip only one bit not assign.
Signed-off-by: Marek Belisko marek.belisko@gmail.com
drivers/mtd/nand/omap_gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c index 881a636..bf99b8e 100644 --- a/drivers/mtd/nand/omap_gpmc.c +++ b/drivers/mtd/nand/omap_gpmc.c @@ -403,7 +403,7 @@ static int omap_correct_data_bch(struct mtd_info *mtd, uint8_t *dat, dat[byte_pos] ^= 1 << bit_pos; printf("nand: bit-flip corrected @data=%d\n", byte_pos); } else if (byte_pos < error_max) {
read_ecc[byte_pos - SECTOR_BYTES] = 1 << bit_pos;
} else {read_ecc[byte_pos - SECTOR_BYTES] ^= 1 << bit_pos; printf("nand: bit-flip corrected @oob=%d\n", byte_pos - SECTOR_BYTES);
-- 1.7.9.5
Thanks for catching this.
Acked-by: Pekon Gupta pekon@ti.com
with regards, pekon

On Fri, Apr 25, 2014 at 12:00:07PM +0200, Belisko Marek wrote:
We need to flip only one bit not assign.
Signed-off-by: Marek Belisko marek.belisko@gmail.com Acked-by: Pekon Gupta pekon@ti.com
Applied to u-boot-ti/master, thanks!
participants (3)
-
Gupta, Pekon
-
Marek Belisko
-
Tom Rini