[PATCH] OneNAND: Simple Bad Block handling support

Bernhard Priewasser priewasser at gmail.com
Wed Aug 24 06:49:55 EDT 2005


OK, sync read patch seems to work when applied directly to the kernel 
tree, e.g.
 > /usr/src/linux> patch -p1 < onenand-syncread_20050813.patch

BBM patch, e.g.
 > /usr/src/linux> patch -p1 < onenand-bbm_20050818.patch
runs through nearly successful. I get a rej in onenand_base.c, line 311 
(see attached file).
On line 315 you are looking for "return -EAGAIN;", but there's a "return 
-EIO;" -> patch fails.
I don't know what's wrong with line 319/320, the patch fails anyway... 
Same thing for line 326.


Is the following code valid (assuming patch has been run)?
 > ctrl = this->read_word(this->base + ONENAND_REG_CTRL_STATUS);

 > if (ctrl & ONENAND_CTRL_ERROR) {
 > 	/* It maybe occur at initial bad block */
 > 	DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: controller error = 0x%04x\n", 
ctrl);
 > 	/* Clear other interrupt bits for preventing ECC error */
 > 	interrupt &= ONENAND_INT_MASTER;
 > }

 > if (ctrl & ONENAND_CTRL_LOCK) {
 > 	DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: it's locked error = 
0x%04x\n", ctrl);
 > 	return -EACCES;
 > }

 > if (interrupt & ONENAND_INT_READ) {
 > 	ecc = this->read_word(this->base + ONENAND_REG_ECC_STATUS);
 > 	if (ecc & ONENAND_ECC_2BIT_ALL) {
 > 		DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: ECC error = 0x%04x\n", ecc);
 > 		return -EBADMSG;
 > 	}
 > }

1) interrupt &= ONENAND_INT_MASTER instead of return?
2) return -EACCES instead of return -EIO?

Bernhard
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: onenand_base.c.rej
Url: http://lists.infradead.org/pipermail/linux-mtd/attachments/20050824/761f8d64/attachment.pl 


More information about the linux-mtd mailing list