mtd/drivers/mtd/nand nand_base.c,1.154,1.155

Vitaly Wool vwool at ru.mvista.com
Mon Nov 14 01:45:29 EST 2005


Update of /home/cvs/mtd/drivers/mtd/nand
In directory phoenix.infradead.org:/tmp/cvs-serv7167/drivers/mtd/nand

Modified Files:
	nand_base.c 
Log Message:
Fixing the problem with HW ECC/layouts w/o SYNDROME
Even if SYNDROME is not set, it's more proper to let the device driver know
we're gonna read ECC otherwise it'll need to issue a positioning command
before the next read.


Index: nand_base.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_base.c,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -r1.154 -r1.155
--- nand_base.c	7 Nov 2005 11:14:30 -0000	1.154
+++ nand_base.c	14 Nov 2005 06:45:25 -0000	1.155
@@ -937,7 +937,7 @@
 					datidx += this->layout[j].length;
 					break;
 				case ITEM_TYPE_ECC:
-					this->enable_hwecc(mtd, NAND_ECC_WRITESYN); /* XXX: only for syndrome? */
+					this->enable_hwecc(mtd, NAND_ECC_WRITESYN);
 					this->calculate_ecc(mtd, &this->data_poi[last_datidx], &ecc_code[i]);
 					for (; i < last_i + this->layout[j].length; i++, eccidx++)
 						oob_buf[oob_config[eccidx]] = ecc_code[i];
@@ -1282,11 +1282,10 @@
 
 					case ITEM_TYPE_ECC:
 						DEBUG (MTD_DEBUG_LEVEL3, "%s: reading %d ecc bytes\n", __FUNCTION__, this->layout[j].length);
-						/* HW ecc with syndrome calculation must read the
-						 * syndrome from flash immidiately after the data */
+						/* let the particular driver decide whether to read ECC */
+						this->enable_hwecc(mtd, NAND_ECC_READSYN);
+						this->read_buf(mtd, &oob_data[i], this->layout[j].length);
 						if (!compareecc) {
-							this->enable_hwecc(mtd, NAND_ECC_READSYN);
-							this->read_buf(mtd, &oob_data[i], this->layout[j].length);
 
 							/* We calc error correction directly, it checks the hw
 							 * generator for an error, reads back the syndrome and





More information about the linux-mtd-cvs mailing list