Commit 2b1b1b4a authored by Boris Brezillon's avatar Boris Brezillon

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: f88fc122 ("mtd: nand: Cleanup/rework the atmel_nand driver")
Cc: <stable@vger.kernel.org>
Reported-by: default avatarOlivier Schonken <olivier.schonken@gmail.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: default avatarRichard Weinberger <richard@nod.at>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Tested-by: default avatarOlivier Schonken <olivier.schonken@gmail.com>
parent 3eb2ce82
...@@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user) ...@@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user)
static int get_sectorsize(struct atmel_pmecc_user *user) static int get_sectorsize(struct atmel_pmecc_user *user)
{ {
return user->cache.cfg & PMECC_LOOKUP_TABLE_SIZE_1024 ? 1024 : 512; return user->cache.cfg & PMECC_CFG_SECTOR1024 ? 1024 : 512;
} }
static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int sector) static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int sector)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment