* [U-Boot] [PATCH] mtd: mxc_nand: Fix crash after MTD resync
@ 2013-07-02 15:11 Marek Vasut
2013-07-02 19:13 ` Scott Wood
0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2013-07-02 15:11 UTC (permalink / raw)
To: u-boot
The driver triggered a BUG() in nand_base.c:3214/nand_scan_tail()
because the ecc.strength was incorrectly set in case of NAND_ECC_HW
instead of NAND_ECC_HW_SYNDROME ECC mode.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Scott Wood <scottwood@freescale.com>
---
drivers/mtd/nand/mxc_nand.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index ac435f2..08c7b8b 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -1238,15 +1238,12 @@ int board_nand_init(struct nand_chip *this)
this->ecc.write_oob = mxc_nand_write_oob_syndrome;
this->ecc.bytes = 9;
this->ecc.prepad = 7;
- } else {
- this->ecc.mode = NAND_ECC_HW;
- }
-
- if (this->ecc.mode == NAND_ECC_HW) {
if (is_mxc_nfc_1())
this->ecc.strength = 1;
else
this->ecc.strength = 4;
+ } else {
+ this->ecc.mode = NAND_ECC_HW;
}
host->pagesize_2k = 0;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] mtd: mxc_nand: Fix crash after MTD resync
2013-07-02 15:11 [U-Boot] [PATCH] mtd: mxc_nand: Fix crash after MTD resync Marek Vasut
@ 2013-07-02 19:13 ` Scott Wood
2013-07-02 20:57 ` Marek Vasut
0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2013-07-02 19:13 UTC (permalink / raw)
To: u-boot
On 07/02/2013 10:11:55 AM, Marek Vasut wrote:
> The driver triggered a BUG() in nand_base.c:3214/nand_scan_tail()
> because the ecc.strength was incorrectly set in case of NAND_ECC_HW
> instead of NAND_ECC_HW_SYNDROME ECC mode.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> Cc: Scott Wood <scottwood@freescale.com>
> ---
> drivers/mtd/nand/mxc_nand.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index ac435f2..08c7b8b 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -1238,15 +1238,12 @@ int board_nand_init(struct nand_chip *this)
> this->ecc.write_oob = mxc_nand_write_oob_syndrome;
> this->ecc.bytes = 9;
> this->ecc.prepad = 7;
> - } else {
> - this->ecc.mode = NAND_ECC_HW;
> - }
> -
> - if (this->ecc.mode == NAND_ECC_HW) {
> if (is_mxc_nfc_1())
> this->ecc.strength = 1;
> else
> this->ecc.strength = 4;
> + } else {
> + this->ecc.mode = NAND_ECC_HW;
> }
Where does ecc.strength now get set for the non-SYNDROME case?
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] mtd: mxc_nand: Fix crash after MTD resync
2013-07-02 19:13 ` Scott Wood
@ 2013-07-02 20:57 ` Marek Vasut
2013-07-02 21:02 ` Scott Wood
0 siblings, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2013-07-02 20:57 UTC (permalink / raw)
To: u-boot
Dear Scott Wood,
> On 07/02/2013 10:11:55 AM, Marek Vasut wrote:
> > The driver triggered a BUG() in nand_base.c:3214/nand_scan_tail()
> > because the ecc.strength was incorrectly set in case of NAND_ECC_HW
> > instead of NAND_ECC_HW_SYNDROME ECC mode.
> >
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> > Cc: Scott Wood <scottwood@freescale.com>
> > ---
> >
> > drivers/mtd/nand/mxc_nand.c | 7 ++-----
> > 1 file changed, 2 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> > index ac435f2..08c7b8b 100644
> > --- a/drivers/mtd/nand/mxc_nand.c
> > +++ b/drivers/mtd/nand/mxc_nand.c
> > @@ -1238,15 +1238,12 @@ int board_nand_init(struct nand_chip *this)
> >
> > this->ecc.write_oob = mxc_nand_write_oob_syndrome;
> > this->ecc.bytes = 9;
> > this->ecc.prepad = 7;
> >
> > - } else {
> > - this->ecc.mode = NAND_ECC_HW;
> > - }
> > -
> > - if (this->ecc.mode == NAND_ECC_HW) {
> >
> > if (is_mxc_nfc_1())
> >
> > this->ecc.strength = 1;
> >
> > else
> >
> > this->ecc.strength = 4;
> >
> > + } else {
> > + this->ecc.mode = NAND_ECC_HW;
> >
> > }
>
> Where does ecc.strength now get set for the non-SYNDROME case?
Gone ;-) The strength only needs to be set for the SYNDROME case according to
the code in nand_base.c .
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] mtd: mxc_nand: Fix crash after MTD resync
2013-07-02 20:57 ` Marek Vasut
@ 2013-07-02 21:02 ` Scott Wood
2013-07-02 21:11 ` Marek Vasut
0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2013-07-02 21:02 UTC (permalink / raw)
To: u-boot
On 07/02/2013 03:57:58 PM, Marek Vasut wrote:
> Dear Scott Wood,
>
> > On 07/02/2013 10:11:55 AM, Marek Vasut wrote:
> > > The driver triggered a BUG() in nand_base.c:3214/nand_scan_tail()
> > > because the ecc.strength was incorrectly set in case of
> NAND_ECC_HW
> > > instead of NAND_ECC_HW_SYNDROME ECC mode.
> > >
> > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > Cc: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> > > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> > > Cc: Scott Wood <scottwood@freescale.com>
> > > ---
> > >
> > > drivers/mtd/nand/mxc_nand.c | 7 ++-----
> > > 1 file changed, 2 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/mtd/nand/mxc_nand.c
> b/drivers/mtd/nand/mxc_nand.c
> > > index ac435f2..08c7b8b 100644
> > > --- a/drivers/mtd/nand/mxc_nand.c
> > > +++ b/drivers/mtd/nand/mxc_nand.c
> > > @@ -1238,15 +1238,12 @@ int board_nand_init(struct nand_chip
> *this)
> > >
> > > this->ecc.write_oob = mxc_nand_write_oob_syndrome;
> > > this->ecc.bytes = 9;
> > > this->ecc.prepad = 7;
> > >
> > > - } else {
> > > - this->ecc.mode = NAND_ECC_HW;
> > > - }
> > > -
> > > - if (this->ecc.mode == NAND_ECC_HW) {
> > >
> > > if (is_mxc_nfc_1())
> > >
> > > this->ecc.strength = 1;
> > >
> > > else
> > >
> > > this->ecc.strength = 4;
> > >
> > > + } else {
> > > + this->ecc.mode = NAND_ECC_HW;
> > >
> > > }
> >
> > Where does ecc.strength now get set for the non-SYNDROME case?
>
> Gone ;-) The strength only needs to be set for the SYNDROME case
> according to
> the code in nand_base.c .
Read it again. Note the lack of a "break;" before "case
NAND_ECC_HW_SYNDROME:".
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] mtd: mxc_nand: Fix crash after MTD resync
2013-07-02 21:02 ` Scott Wood
@ 2013-07-02 21:11 ` Marek Vasut
0 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2013-07-02 21:11 UTC (permalink / raw)
To: u-boot
Dear Scott Wood,
> On 07/02/2013 03:57:58 PM, Marek Vasut wrote:
> > Dear Scott Wood,
> >
> > > On 07/02/2013 10:11:55 AM, Marek Vasut wrote:
> > > > The driver triggered a BUG() in nand_base.c:3214/nand_scan_tail()
> > > > because the ecc.strength was incorrectly set in case of
> >
> > NAND_ECC_HW
> >
> > > > instead of NAND_ECC_HW_SYNDROME ECC mode.
> > > >
> > > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > > Cc: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> > > > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> > > > Cc: Scott Wood <scottwood@freescale.com>
> > > > ---
> > > >
> > > > drivers/mtd/nand/mxc_nand.c | 7 ++-----
> > > > 1 file changed, 2 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/drivers/mtd/nand/mxc_nand.c
> >
> > b/drivers/mtd/nand/mxc_nand.c
> >
> > > > index ac435f2..08c7b8b 100644
> > > > --- a/drivers/mtd/nand/mxc_nand.c
> > > > +++ b/drivers/mtd/nand/mxc_nand.c
> > > > @@ -1238,15 +1238,12 @@ int board_nand_init(struct nand_chip
> >
> > *this)
> >
> > > > this->ecc.write_oob = mxc_nand_write_oob_syndrome;
> > > > this->ecc.bytes = 9;
> > > > this->ecc.prepad = 7;
> > > >
> > > > - } else {
> > > > - this->ecc.mode = NAND_ECC_HW;
> > > > - }
> > > > -
> > > > - if (this->ecc.mode == NAND_ECC_HW) {
> > > >
> > > > if (is_mxc_nfc_1())
> > > >
> > > > this->ecc.strength = 1;
> > > >
> > > > else
> > > >
> > > > this->ecc.strength = 4;
> > > >
> > > > + } else {
> > > > + this->ecc.mode = NAND_ECC_HW;
> > > >
> > > > }
> > >
> > > Where does ecc.strength now get set for the non-SYNDROME case?
> >
> > Gone ;-) The strength only needs to be set for the SYNDROME case
> > according to
> > the code in nand_base.c .
>
> Read it again. Note the lack of a "break;" before "case
> NAND_ECC_HW_SYNDROME:".
Blargh. V2-time.
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-07-02 21:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-02 15:11 [U-Boot] [PATCH] mtd: mxc_nand: Fix crash after MTD resync Marek Vasut
2013-07-02 19:13 ` Scott Wood
2013-07-02 20:57 ` Marek Vasut
2013-07-02 21:02 ` Scott Wood
2013-07-02 21:11 ` Marek Vasut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.