From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 2 Jul 2013 14:13:50 -0500 Subject: [U-Boot] [PATCH] mtd: mxc_nand: Fix crash after MTD resync In-Reply-To: <1372777915-12390-1-git-send-email-marex@denx.de> (from marex@denx.de on Tue Jul 2 10:11:55 2013) Message-ID: <1372792430.8183.117@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Cc: Beno?t Th?baudeau > Cc: Fabio Estevam > Cc: Scott Wood > --- > 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