From: Bernhard Priewasser <priewasser@gmail.com>
To: kyungmin.park@samsung.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] OneNAND: Simple Bad Block handling support
Date: Wed, 24 Aug 2005 12:49:55 +0200 [thread overview]
Message-ID: <430C50D3.5080808@gmail.com> (raw)
In-Reply-To: <0ILP000HJ8JG7E@mmp1.samsung.com>
[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]
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
[-- Attachment #2: onenand_base.c.rej --]
[-- Type: text/plain, Size: 1413 bytes --]
*************** static int onenand_wait(struct mtd_info
*** 311,329 ****
ctrl = this->read_word(this->base + ONENAND_REG_CTRL_STATUS);
if (ctrl & ONENAND_CTRL_ERROR) {
- DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: controller error = 0x%04x", ctrl);
- return -EAGAIN;
}
if (ctrl & ONENAND_CTRL_LOCK) {
- DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: it's locked error = 0x%04x", ctrl);
- return -EIO;
}
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", ecc);
return -EBADMSG;
}
}
--- 311,331 ----
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;
}
}
next prev parent reply other threads:[~2005-08-24 10:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-18 8:16 [PATCH] OneNAND: Simple Bad Block handling support Kyungmin Park
2005-08-23 13:56 ` Bernhard Priewasser
2005-08-23 23:42 ` Kyungmin Park
2005-08-24 9:24 ` Bernhard Priewasser
2005-08-24 10:49 ` Bernhard Priewasser [this message]
2005-08-24 23:36 ` Kyungmin Park
2005-08-25 7:56 ` Bernhard Priewasser
2005-09-01 9:30 ` Bernhard Priewasser
2005-09-01 10:03 ` Kyungmin Park
2005-09-01 10:09 ` Bernhard Priewasser
2005-09-07 8:09 ` Bernhard Priewasser
2005-09-07 11:44 ` Kyungmin Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=430C50D3.5080808@gmail.com \
--to=priewasser@gmail.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.