Skip to content

Commit

Permalink
mtd: nand: atmel: Fix get_sectorsize() function
Browse files Browse the repository at this point in the history
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: <[email protected]>
Reported-by: Olivier Schonken <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Richard Weinberger <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Tested-by: Olivier Schonken <[email protected]>
  • Loading branch information
Boris Brezillon committed Mar 29, 2018
1 parent 3eb2ce8 commit 2b1b1b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/nand/atmel/pmecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2b1b1b4

Please sign in to comment.