[PATCH] OneNAND: Simple Bad Block handling support
Kyungmin Park
kyungmin.park at samsung.com
Tue Aug 23 19:42:53 EDT 2005
Hi
Which directory are you patch? MTD-CVS or kernel?
In MTD-CVS I also have similar message
$ patch --dry-run -p1 < ../onenand-bbm.patch
patching file drivers/mtd/onenand/Makefile
Hunk #1 FAILED at 3.
1 out of 1 hunk FAILED -- saving rejects to file
drivers/mtd/onenand/Makefile.rej
patching file drivers/mtd/onenand/onenand_base.c
Hunk #1 FAILED at 311.
Hunk #2 succeeded at 1033 (offset -29 lines).
Hunk #4 succeeded at 1158 (offset -29 lines).
Hunk #6 succeeded at 1504 (offset -35 lines).
1 out of 6 hunks FAILED -- saving rejects to file
drivers/mtd/onenand/onenand_base.c.rej
patching file drivers/mtd/onenand/onenand_bbt.c
patching file include/linux/mtd/bbm.h
patching file include/linux/mtd/onenand.h
Hunk #3 FAILED at 101.
Hunk #4 succeeded at 109 (offset -1 lines).
1 out of 4 hunks FAILED -- saving rejects to file
include/linux/mtd/onenand.h.rej
I think the patch scenario is following
1. patching onenand-syncread.patch (check previous e-mail)
2. onenand-bbm.patch
3. omap-onenand.patch
Try again and If you have same problem. please let me know
In my test there's two .rej file
./drivers/mtd/onenand/Makefile.rej
./drivers/mtd/onenand/onenand_base.c.rej
***************
*** 3,9 ****
#
# Core functionality.
- obj-$(CONFIG_MTD_ONENAND) += onenand_base.o
# Board specific.
obj-$(CONFIG_MTD_ONENAND_OMAP) += omap-onenand.o
--- 3,11 ----
#
# Core functionality.
+ obj-$(CONFIG_MTD_ONENAND) += onenand.o
# Board specific.
obj-$(CONFIG_MTD_ONENAND_OMAP) += omap-onenand.o
+
+ onenand-objs = onenand_base.o onenand_bbt.o
***************
*** 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;
}
}
I tried to solve this problem
Thank you
Kyungmin Park
> -----Original Message-----
> From: Bernhard Priewasser [mailto:priewasser at gmail.com]
> Sent: Tuesday, August 23, 2005 10:57 PM
> To: kyungmin.park at samsung.com
> Cc: linux-mtd at lists.infradead.org
> Subject: Re: [PATCH] OneNAND: Simple Bad Block handling support
>
> Hi,
>
> trying patching a today's snapshot I get:
>
> patch -p1 < onenand-bbm.patch
> patching file drivers/mtd/onenand/Makefile
> Hunk #1 FAILED at 3.
> 1 out of 1 hunk FAILED -- saving rejects to file
> drivers/mtd/onenand/Makefile.rej
> patching file drivers/mtd/onenand/onenand_base.c
> Hunk #1 FAILED at 311.
> Hunk #2 succeeded at 1033 (offset -29 lines).
> Hunk #3 succeeded at 1101 (offset -29 lines).
> Hunk #4 succeeded at 1158 (offset -29 lines).
> Hunk #5 succeeded at 1444 (offset -29 lines).
> Hunk #6 succeeded at 1504 (offset -35 lines).
> 1 out of 6 hunks FAILED -- saving rejects to file
> drivers/mtd/onenand/onenand_base.c.rej
> patching file drivers/mtd/onenand/onenand_bbt.c
> patching file include/linux/mtd/bbm.h
> patching file include/linux/mtd/onenand.h
> Hunk #3 FAILED at 101.
> Hunk #4 succeeded at 109 (offset -1 lines).
> 1 out of 4 hunks FAILED -- saving rejects to file
> include/linux/mtd/onenand.h.rej
>
> .rej files are available.
> Perhaps it's a silly fault... I'm new to diff/patch, sorry.
>
> Regards,
> Bernhard
>
>
More information about the linux-mtd
mailing list