Skip to content

Commit 0739224

Browse files
Boris Brezillonambarus
authored andcommitted
mtd: nand: atmel: Fix get_sectorsize() function
get_sectorsize() was not using the appropriate macro to extract the ECC sector size from the config cache, which led to buggy ECC when using 1024 byte sectors. Fixes: f88fc12 ("mtd: nand: Cleanup/rework the atmel_nand driver") Cc: <stable@vger.kernel.org> Reported-by: Olivier Schonken <olivier.schonken@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Richard Weinberger <richard@nod.at> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Tested-by: Olivier Schonken <olivier.schonken@gmail.com> (cherry picked from commit 2b1b1b4)
1 parent e304f2d commit 0739224

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mtd/nand/atmel/pmecc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user)
426426

427427
static int get_sectorsize(struct atmel_pmecc_user *user)
428428
{
429-
return user->cache.cfg & PMECC_LOOKUP_TABLE_SIZE_1024 ? 1024 : 512;
429+
return user->cache.cfg & PMECC_CFG_SECTOR1024 ? 1024 : 512;
430430
}
431431

432432
static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int sector)

0 commit comments

Comments
 (0)