Skip to contentSkip to conversation

mtd: mxc_nand: Fix crash after MTD resync

PATCH Superseded Marek Vasut 2 participants 4 messages Jul 3, 2013 – Jul 12, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mtd: mxc_nand: Fix crash after MTD resync

The driver triggered a BUG() in nand_base.c:3214/nand_scan_tail() because the ecc.strength was not set in NAND_ECC_HW_SYNDROME ECC mode.

Cc Benoit Thebaudeau <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Scott Wood <[email protected]>
Cc Stefano Babic <[email protected]>
---
 drivers/mtd/nand/mxc_nand.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

V2: Set ecc.strength for both NAND_ECC_HW and NAND_ECC_HW_SYNDROME mode

drivers/mtd/nand/mxc_nand.c +4 -6
index ac435f2..40b0741 100644
@@ -1242,12 +1242,10 @@ int board_nand_init(struct nand_chip *this)
 		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;
-	}
+	if (is_mxc_nfc_1())
+		this->ecc.strength = 1;
+	else
+		this->ecc.strength = 4;
 
 	host->pagesize_2k = 0;
 
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH v2 1/1 mtd: mxc_nand: Fix crash after MTD resync

Hi,

Tom/Stefano, can you pick this for .07? Otherwise all mxc with NAND are broken.

Thanks

Quoted 25 lines

The driver triggered a BUG() in nand_base.c:3214/nand_scan_tail() because the ecc.strength was not set in NAND_ECC_HW_SYNDROME ECC mode.

Cc Benoit Thebaudeau <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Scott Wood <[email protected]>
Cc Stefano Babic <[email protected]>
---
 drivers/mtd/nand/mxc_nand.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

V2: Set ecc.strength for both NAND_ECC_HW and NAND_ECC_HW_SYNDROME mode

drivers/mtd/nand/mxc_nand.c +0 -2
index ac435f2..40b0741 100644
@@ -1242,12 +1242,10 @@ int board_nand_init(struct nand_chip *this)
 		this->ecc.mode = NAND_ECC_HW;
 	}
 
-	if (this->ecc.mode == NAND_ECC_HW) {
-		if (is_mxc_nfc_1())

drivers/mtd/nand/mxc_nand.c int board_nand_init(struct nand_chip *this) · line 1250

Quoted 10 lines
drivers/mtd/nand/mxc_nand.c +4 -4
-			this->ecc.strength = 1;
-		else
-			this->ecc.strength = 4;
-	}
+	if (is_mxc_nfc_1())
+		this->ecc.strength = 1;
+	else
+		this->ecc.strength = 4;
 
 	host->pagesize_2k = 0;

Best regards,
Marek Vasut

#2 lore raw

PATCH v2 1/1 mtd: mxc_nand: Fix crash after MTD resync

Oh, sorry... didn't realize the release was in three days. :-(

I'll send a pull request.

-Scott

Quoted 50 lines · Marek Vasut

Hi,

Tom/Stefano, can you pick this for .07? Otherwise all mxc with NAND are broken.

Thanks

Quoted 9 lines

The driver triggered a BUG() in nand_base.c:3214/nand_scan_tail() because the ecc.strength was not set in NAND_ECC_HW_SYNDROME ECC mode.

Cc Benoit Thebaudeau <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Scott Wood <[email protected]>
Cc Stefano Babic <[email protected]>
Quoted 5 lines
---
 drivers/mtd/nand/mxc_nand.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

V2: Set ecc.strength for both NAND_ECC_HW and NAND_ECC_HW_SYNDROME

mode

Review

Quoted 2 lines
(quoted diff) +0 -0

b/drivers/mtd/nand/mxc_nand.c

Quoted 9 lines

index ac435f2..40b0741 100644

drivers/mtd/nand/mxc_nand.c +0 -2
@@ -1242,12 +1242,10 @@ int board_nand_init(struct nand_chip *this)
 		this->ecc.mode = NAND_ECC_HW;
 	}
 
-	if (this->ecc.mode == NAND_ECC_HW) {
-		if (is_mxc_nfc_1())

drivers/mtd/nand/mxc_nand.c int board_nand_init(struct nand_chip *this) · line 1250

Quoted 10 lines
drivers/mtd/nand/mxc_nand.c +4 -4
-			this->ecc.strength = 1;
-		else
-			this->ecc.strength = 4;
-	}
+	if (is_mxc_nfc_1())
+		this->ecc.strength = 1;
+	else
+		this->ecc.strength = 4;
 
 	host->pagesize_2k = 0;

Best regards,
Marek Vasut

#3 lore raw

PATCH v2 1/1 mtd: mxc_nand: Fix crash after MTD resync

Dear Scott Wood,

Quoted 5 lines

Oh, sorry... didn't realize the release was in three days. :-(

I'll send a pull request.

-Scott

Thanks ;-)

Best regards,
Marek Vasut