diff mbox

[v2,fix] mtd: gpmi: fix the ecc regression

Message ID 1382604496-28118-1-git-send-email-b32955@freescale.com
State New, archived
Headers show

Commit Message

Huang Shijie Oct. 24, 2013, 8:48 a.m. UTC
The legacy ecc layout is to use 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 brings a regression to us:
   We can not mount the ubifs which was created by the old NAND ecc layout.

This patch fixes this issue by use the legacy ecc layout firstly, if it fails
we try to use the new ecc layout.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Cc: stable@vger.kernel.org
---
 revert the return value of set_geometry_by_ecc_info().

---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Brian Norris Oct. 24, 2013, 10:19 p.m. UTC | #1
On Thu, Oct 24, 2013 at 04:48:16PM +0800, Huang Shijie wrote:
> The legacy ecc layout is to use 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 brings a regression to us:
>    We can not mount the ubifs which was created by the old NAND ecc layout.
> 
> This patch fixes this issue by use the legacy ecc layout firstly, if it fails
> we try to use the new ecc layout.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> Cc: stable@vger.kernel.org

I fixed up the language a little, dropped the 'stable', and pushed to
linux-mtd.git (in hopes of sending another pull request for 3.12). I'll
see if David wants to weigh in first.

Feel free to send your updated DT binding patch(es).

Brian
David Woodhouse Oct. 25, 2013, 1:36 p.m. UTC | #2
On Thu, 2013-10-24 at 15:19 -0700, Brian Norris wrote:
> I fixed up the language a little, dropped the 'stable', and pushed to
> linux-mtd.git (in hopes of sending another pull request for 3.12). I'll
> see if David wants to weigh in first.

You're fine. Go ahead and send the request if you're happy to do so.

Thanks.
diff mbox

Patch

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 6807d7c..43a62e8 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -352,7 +352,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)