imx27: Unsupported ECC algorithm

Miquel Raynal miquel.raynal at bootlin.com
Fri Oct 16 03:53:18 EDT 2020


Hello,

Sascha Hauer <s.hauer at pengutronix.de> wrote on Fri, 16 Oct 2020
08:39:10 +0200:

> Hi Miquel,
> 
> On Wed, Oct 14, 2020 at 03:26:59PM +0200, Miquel Raynal wrote:
> > Hi Fabio, Sascha, Lucas,
> > 
> > > 
> > > The ECC issues are still present on imx27-phytec-phycard-s-rdk:
> > > https://storage.kernelci.org/next/master/next-20201013/arm/imx_v4_v5_defconfig/gcc-8/lab-pengutronix/baseline-imx27-phytec-phycard-s-rdk.html
> > > 
> > > BTW, ECC errors are also reported on a Freescale Layerscape 2088A RDB Board:
> > > https://www.spinics.net/lists/iommu/msg49772.html
> > > 
> > 
> > I supposed the failing division is this one:
> > 
> >         /*
> >          * Set the number of read / write steps for one page depending on ECC
> >          * mode.
> >          */
> >         ecc->steps = mtd->writesize / ecc->size;
> >         if (ecc->steps * ecc->size != mtd->writesize) {
> >                 WARN(1, "Invalid ECC parameters\n");
> >                 ret = -EINVAL;
> >                 goto err_nand_manuf_cleanup;
> >         }
> > 
> > Which produces the warning right after. This would mean that
> > 
> > 	ecc->size == 0
> > 
> > But this entry is set before calling nand_scan() in mxcnd_probe() to
> > 512, and that does not make sense.
> > 
> > I guess we should be able to reproduce this error with any board using
> > the mxc NAND driver with hardware correction (now also called "on
> > host"). Do you have such a board available to at least verify that the
> > beginning of my logic is right?
> 
> We have a board, I'll give it a test

Thanks to Han's analysis I may have found the issue. Please have a look
at [1].

Sascha, if you reproduce the error you may also want to test this patch.

[1] https://patchwork.ozlabs.org/project/linux-mtd/patch/20201016074942.29650-1-miquel.raynal@bootlin.com/

Thanks,
Miquèl



More information about the linux-mtd mailing list