mtd: gpmi: fix ECC regression

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Oct 24 18:59:01 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=773d84d28e55fcc64bb1a4d96a85661a7571a83f
Commit:     773d84d28e55fcc64bb1a4d96a85661a7571a83f
Parent:     18a84e935ef3b283e86426827a2a1d524bb7eb8e
Author:     Huang Shijie <b32955 at freescale.com>
AuthorDate: Thu Oct 24 16:48:16 2013 +0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Oct 24 14:44:57 2013 -0700

    mtd: gpmi: fix ECC regression
    
    The legacy ECC layout uses all the OOB area by computing the ECC
    strength and ECC step size ourselves.
    
    The patch "2febcdf mtd: gpmi: set the BCHs geometry with the ecc info"
    makes the gpmi to use the ECC info (ECC strength and ECC step size)
    provided by the MTD code, and creates a different NAND ECC layout
    for the BCH, and use the new ECC layout. This causes a regression:
    
       We can not mount the ubifs which was created by the old NAND ECC layout.
    
    This patch fixes this issue by reverting to the legacy ECC layout
    firstly; if it fails, we try to use the new ECC layout.
    
    Signed-off-by: Huang Shijie <b32955 at freescale.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 59ab069..0241763 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -349,7 +349,8 @@ static int legacy_set_geometry(struct gpmi_nand_data *this)
 
 int common_nfc_set_geometry(struct gpmi_nand_data *this)
 {
-	return set_geometry_by_ecc_info(this) ? 0 : legacy_set_geometry(this);
+	return legacy_set_geometry(this) ?
+		(!set_geometry_by_ecc_info(this)) : 0;
 }
 
 struct dma_chan *get_dma_chan(struct gpmi_nand_data *this)



More information about the linux-mtd-cvs mailing list