Title: [8903] trunk/drivers/mtd/nand/bf5xx_nand.c: bug [#6049]fix wrong raw page write/read flow
Revision
8903
Author
bhsong
Date
2010-06-10 04:14:38 -0400 (Thu, 10 Jun 2010)

Log Message

bug [#6049]fix wrong raw page write/read flow
 
Our write_buf/read_buf entries always do ECC for HW ECC mode. That is not needed for raw mode.
In fact, write_buf/read_buf should be a pure function for data input/output, chip->ecc.hwctl
controls ECC. But unfortunately, we can't seperate ECC from data input/output in our NFC, so
our DMA write/read_buf entries couple with ECC operations closely.
 
Then we need provide read_page_raw/write_page_raw entried to stop bottom level write/read_buf
entries being called from nand base. In those functions, we call non-dma version without ECC.

Modified Paths

Diff

Modified: trunk/drivers/mtd/nand/bf5xx_nand.c (8902 => 8903)


--- trunk/drivers/mtd/nand/bf5xx_nand.c	2010-06-10 06:57:51 UTC (rev 8902)
+++ trunk/drivers/mtd/nand/bf5xx_nand.c	2010-06-10 08:14:38 UTC (rev 8903)
@@ -575,6 +575,22 @@
 		bf5xx_nand_write_buf(mtd, buf, len);
 }
 
+static int bf5xx_nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
+		uint8_t *buf, int page)
+{
+	bf5xx_nand_read_buf(mtd, buf, mtd->writesize);
+	bf5xx_nand_read_buf(mtd, chip->oob_poi, mtd->oobsize);
+
+	return 0;
+}
+
+static void bf5xx_nand_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
+		const uint8_t *buf)
+{
+	bf5xx_nand_write_buf(mtd, buf, mtd->writesize);
+	bf5xx_nand_write_buf(mtd, chip->oob_poi, mtd->oobsize);
+}
+
 /*
  * System initialization functions
  */
@@ -816,6 +832,8 @@
 		chip->ecc.correct   = bf5xx_nand_correct_data;
 		chip->ecc.mode	    = NAND_ECC_HW;
 		chip->ecc.hwctl	    = bf5xx_nand_enable_hwecc;
+		chip->ecc.read_page_raw = bf5xx_nand_read_page_raw;
+		chip->ecc.write_page_raw = bf5xx_nand_write_page_raw;
 	} else {
 		chip->ecc.mode	    = NAND_ECC_SOFT;
 	}
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to