On Wed, 13 May 2020 15:10:29 +0200 Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote: > This is done by default in the raw NAND core (nand_base.c) but was > missing in the SPI-NAND core. Without these two lines the ecc_strength > and ecc_step_size values are not exported to the user through sysfs. > > This fix depends on recent changes and should not be backported as-is. > > Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs") > Cc: stable@xxxxxxxxxxxxxxx > Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> > --- > > This patch is extracted from a bigger series and needs to be merged > now as a fix. I haven't changed anything from it's original > submission. > > drivers/mtd/nand/spi/core.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c > index b6bb358b96ce..248c4d7a0cf4 100644 > --- a/drivers/mtd/nand/spi/core.c > +++ b/drivers/mtd/nand/spi/core.c > @@ -1089,6 +1089,10 @@ static int spinand_init(struct spinand_device *spinand) > > mtd->oobavail = ret; > > + /* Propagate ECC information to mtd_info */ > + mtd->ecc_strength = nand->ecc.ctx.conf.strength; > + mtd->ecc_step_size = nand->ecc.ctx.conf.step_size; > + > return 0; > > err_cleanup_nanddev: