aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/docg4.c
diff options
context:
space:
mode:
authorMike Dunn <mikedunn@newsguy.com>2012-04-25 15:06:09 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-05-14 00:12:06 -0400
commit3f91e94f7f511de74c0d2abe08672ccdbdd1961c (patch)
treed33e95596bbebc824a1331c83951a25d2118fd36 /drivers/mtd/nand/docg4.c
parentd062d4ede877fcd2ecc4c6262abad09a6f32950a (diff)
mtd: nand: read_page() returns max_bitflips
The ecc.read_page() method for nand drivers is changed to return the maximum number of bitflips that were corrected on any one region covering an ecc step, This patch doesn't change what the nand code returns to mtd. This v2 includes the change to the fsl_ifc_nand driver requested by Scott¹. ¹ http://lists.infradead.org/pipermail/linux-mtd/2012-April/040883.html Signed-off-by: Mike Dunn <mikedunn@newsguy.com> Acked-by (freescale changes): Scott Wood <scottwood@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/docg4.c')
-rw-r--r--drivers/mtd/nand/docg4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c
index b08202664543..8e7da0170a2b 100644
--- a/drivers/mtd/nand/docg4.c
+++ b/drivers/mtd/nand/docg4.c
@@ -720,6 +720,7 @@ static int read_page(struct mtd_info *mtd, struct nand_chip *nand,
720 struct docg4_priv *doc = nand->priv; 720 struct docg4_priv *doc = nand->priv;
721 void __iomem *docptr = doc->virtadr; 721 void __iomem *docptr = doc->virtadr;
722 uint16_t status, edc_err, *buf16; 722 uint16_t status, edc_err, *buf16;
723 int bits_corrected = 0;
723 724
724 dev_dbg(doc->dev, "%s: page %08x\n", __func__, page); 725 dev_dbg(doc->dev, "%s: page %08x\n", __func__, page);
725 726
@@ -772,7 +773,7 @@ static int read_page(struct mtd_info *mtd, struct nand_chip *nand,
772 773
773 /* If bitflips are reported, attempt to correct with ecc */ 774 /* If bitflips are reported, attempt to correct with ecc */
774 if (edc_err & DOC_ECCCONF1_BCH_SYNDROM_ERR) { 775 if (edc_err & DOC_ECCCONF1_BCH_SYNDROM_ERR) {
775 int bits_corrected = correct_data(mtd, buf, page); 776 bits_corrected = correct_data(mtd, buf, page);
776 if (bits_corrected == -EBADMSG) 777 if (bits_corrected == -EBADMSG)
777 mtd->ecc_stats.failed++; 778 mtd->ecc_stats.failed++;
778 else 779 else
@@ -781,7 +782,7 @@ static int read_page(struct mtd_info *mtd, struct nand_chip *nand,
781 } 782 }
782 783
783 writew(0, docptr + DOC_DATAEND); 784 writew(0, docptr + DOC_DATAEND);
784 return 0; 785 return bits_corrected;
785} 786}
786 787
787 788