* [PATCH] mtd: fsl_elbc_nand: set NAND_NO_SUBPAGE_WRITE flag if using hardware ECC
@ 2014-05-06 9:14 Nikita Yushchenko
2014-05-06 9:57 ` Gupta, Pekon
0 siblings, 1 reply; 2+ messages in thread
From: Nikita Yushchenko @ 2014-05-06 9:14 UTC (permalink / raw)
To: David Woodhouse, Brian Norris, Paul Gortmaker, Jingoo Han,
Grant Likely, Rob Herring, Prabhakar Kushwaha
Cc: linux-mtd, linux-kernel, lugovskoy, Nikita Yushchenko
Per MPC8572E manual, sec 14.4.3.1.3: "Transfers shorter than a full page,
however, require software to prepare the appropriate ECC in the spare
region"
Need to set NAND_NO_SUBPAGE_WRITE flag. If this is not done, then
generic nand_write_subpage_hwecc() is called instead of driver's
write routine, which results into OOPS dereferencing NULL chip->ecc.hwctl
pointer.
Signed-off-by: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
---
drivers/mtd/nand/fsl_elbc_nand.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index ec549cd..bb146a0 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -766,6 +766,8 @@ static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)
if ((in_be32(&lbc->bank[priv->bank].br) & BR_DECC) ==
BR_DECC_CHK_GEN) {
chip->ecc.mode = NAND_ECC_HW;
+ /* hardware can't calculate ECC for subpages */
+ chip->options |= NAND_NO_SUBPAGE_WRITE;
/* put in small page settings and adjust later if needed */
chip->ecc.layout = (priv->fmr & FMR_ECCM) ?
&fsl_elbc_oob_sp_eccm1 : &fsl_elbc_oob_sp_eccm0;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* RE: [PATCH] mtd: fsl_elbc_nand: set NAND_NO_SUBPAGE_WRITE flag if using hardware ECC
2014-05-06 9:14 [PATCH] mtd: fsl_elbc_nand: set NAND_NO_SUBPAGE_WRITE flag if using hardware ECC Nikita Yushchenko
@ 2014-05-06 9:57 ` Gupta, Pekon
0 siblings, 0 replies; 2+ messages in thread
From: Gupta, Pekon @ 2014-05-06 9:57 UTC (permalink / raw)
To: Nikita Yushchenko, David Woodhouse, Brian Norris, Paul Gortmaker,
Jingoo Han, Grant Likely, Rob Herring, Prabhakar Kushwaha
Cc: lugovskoy@dev.rtsoft.ru, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org
Hi Nikita,
>From: Nikita Yushchenko
>
>Per MPC8572E manual, sec 14.4.3.1.3: "Transfers shorter than a full page,
>however, require software to prepare the appropriate ECC in the spare
>region"
>
>Need to set NAND_NO_SUBPAGE_WRITE flag. If this is not done, then
>generic nand_write_subpage_hwecc() is called instead of driver's
>write routine, which results into OOPS dereferencing NULL chip->ecc.hwctl
>pointer.
>
>Signed-off-by: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
>---
This one is already solved.
Please refer below discussion and its previous thread on
why NAND_NO_SUBPAGE_WRITE should _not_ be set,
because it breaks compatibility with older UBIFS images.
http://lists.infradead.org/pipermail/linux-mtd/2014-April/053262.html
Also below is the appropriate fix without breaking backward compatibility.
http://lists.infradead.org/pipermail/linux-mtd/2014-May/053745.html
with regards, pekon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-06 9:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-06 9:14 [PATCH] mtd: fsl_elbc_nand: set NAND_NO_SUBPAGE_WRITE flag if using hardware ECC Nikita Yushchenko
2014-05-06 9:57 ` Gupta, Pekon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox