mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
mtd: nand: atmel: Fix get_sectorsize() function
commit2b1b1b4ac7upstream. 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:f88fc122cc("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e9eddb7056
commit
be0fdc4886
@@ -426,7 +426,7 @@ static int get_strength(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)
|
||||
|
||||
Reference in New Issue
Block a user