* [PATCH resend] mtd: spinand: Propagate ECC information to the MTD structure
@ 2020-05-13 13:10 Miquel Raynal
2020-05-13 16:09 ` Boris Brezillon
0 siblings, 1 reply; 3+ messages in thread
From: Miquel Raynal @ 2020-05-13 13:10 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus, linux-mtd
Cc: Boris Brezillon, stable, Miquel Raynal
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@vger.kernel.org
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
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:
--
2.20.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH resend] mtd: spinand: Propagate ECC information to the MTD structure
2020-05-13 13:10 [PATCH resend] mtd: spinand: Propagate ECC information to the MTD structure Miquel Raynal
@ 2020-05-13 16:09 ` Boris Brezillon
2020-05-17 21:28 ` Richard Weinberger
0 siblings, 1 reply; 3+ messages in thread
From: Boris Brezillon @ 2020-05-13 16:09 UTC (permalink / raw)
To: Miquel Raynal
Cc: Richard Weinberger, linux-mtd, Vignesh Raghavendra, stable,
Tudor Ambarus
On Wed, 13 May 2020 15:10:29 +0200
Miquel Raynal <miquel.raynal@bootlin.com> 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@vger.kernel.org
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>
> 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:
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH resend] mtd: spinand: Propagate ECC information to the MTD structure
2020-05-13 16:09 ` Boris Brezillon
@ 2020-05-17 21:28 ` Richard Weinberger
0 siblings, 0 replies; 3+ messages in thread
From: Richard Weinberger @ 2020-05-17 21:28 UTC (permalink / raw)
To: Boris Brezillon
Cc: Vignesh Raghavendra, Tudor Ambarus, Richard Weinberger, stable,
linux-mtd, Miquel Raynal
On Wed, May 13, 2020 at 6:09 PM Boris Brezillon
<boris.brezillon@collabora.com> wrote:
>
> On Wed, 13 May 2020 15:10:29 +0200
> Miquel Raynal <miquel.raynal@bootlin.com> 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@vger.kernel.org
> > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
>
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Applied, thanks!
--
Thanks,
//richard
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-17 21:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 13:10 [PATCH resend] mtd: spinand: Propagate ECC information to the MTD structure Miquel Raynal
2020-05-13 16:09 ` Boris Brezillon
2020-05-17 21:28 ` Richard Weinberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).