提交 2b1b1b4a 编写于 作者: B 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: NOlivier Schonken <olivier.schonken@gmail.com>
Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: NRichard Weinberger <richard@nod.at>
Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com>
Tested-by: NOlivier Schonken <olivier.schonken@gmail.com>
上级 3eb2ce82
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册