From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lilium.sigma-star.at ([109.75.188.150]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0tYu-0001O3-F4 for linux-mtd@lists.infradead.org; Tue, 27 Mar 2018 18:43:14 +0000 From: Richard Weinberger To: Boris Brezillon Cc: Nicolas Ferre , Alexandre Belloni , Miquel Raynal , linux-mtd@lists.infradead.org, David Woodhouse , Brian Norris , Marek Vasut , Cyrille Pitchen , Olivier Schonken , stable@vger.kernel.org Subject: Re: [PATCH] mtd: nand: atmel: Fix get_sectorsize() function Date: Tue, 27 Mar 2018 20:42:57 +0200 Message-ID: <8243180.0gKHKBdRfY@blindfold> In-Reply-To: <20180327170158.3351-1-boris.brezillon@bootlin.com> References: <20180327170158.3351-1-boris.brezillon@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Am Dienstag, 27. M=E4rz 2018, 19:01:58 CEST schrieb Boris Brezillon: > 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. >=20 > Fixes: f88fc122cc34 ("mtd: nand: Cleanup/rework the atmel_nand driver") > Cc: > Reported-by: Olivier Schonken > Signed-off-by: Boris Brezillon > --- > drivers/mtd/nand/atmel/pmecc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/mtd/nand/atmel/pmecc.c b/drivers/mtd/nand/atmel/pmec= c.c > index 8268636675ef..4124bf91bee6 100644 > --- a/drivers/mtd/nand/atmel/pmecc.c > +++ b/drivers/mtd/nand/atmel/pmecc.c > @@ -426,7 +426,7 @@ static int get_strength(struct atmel_pmecc_user *user) >=20 > 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; > } >=20 > static void atmel_pmecc_gen_syndrome(struct atmel_pmecc_user *user, int > sector) Reviewed-by: Richard Weinberger Thanks, //richard