* [RFC] write bad block marker even with BBT
@ 2010-10-22 14:55 Matthieu CASTET
2010-10-25 8:05 ` Artem Bityutskiy
0 siblings, 1 reply; 2+ messages in thread
From: Matthieu CASTET @ 2010-10-22 14:55 UTC (permalink / raw)
To: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 201 bytes --]
Hi,
do you think a patch like that make sense ?
This allow to solve problem where bootloader don't support reading BBT.
We could also add a new flag and do this only if this flag is set.
Matthieu
[-- Attachment #2: btt.diff --]
[-- Type: text/x-diff, Size: 630 bytes --]
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ddffe76..71052d0 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -409,7 +409,10 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
/* Do we have a flash based bad block table ? */
if (chip->options & NAND_USE_FLASH_BBT)
ret = nand_update_bbt(mtd, ofs);
- else {
+ /* put also the bad block marker in case we loose BBT or
+ the bootloader doesn't support reading it
+ */
+ {
nand_get_device(chip, mtd, FL_WRITING);
/* Write to first two pages and to byte 1 and 6 if necessary.
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [RFC] write bad block marker even with BBT
2010-10-22 14:55 [RFC] write bad block marker even with BBT Matthieu CASTET
@ 2010-10-25 8:05 ` Artem Bityutskiy
0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2010-10-25 8:05 UTC (permalink / raw)
To: Matthieu CASTET; +Cc: linux-mtd
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index ddffe76..71052d0 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -409,7 +409,10 @@ static int nand_default_block_markbad(struct mtd_info *mtd, loff_t ofs)
> /* Do we have a flash based bad block table ? */
> if (chip->options & NAND_USE_FLASH_BBT)
> ret = nand_update_bbt(mtd, ofs);
> - else {
> + /* put also the bad block marker in case we loose BBT or
> + the bootloader doesn't support reading it
> + */
Nitpick: please, use kernel commenting style:
/*
* Multi-line
* comment
*/
> + {
> nand_get_device(chip, mtd, FL_WRITING);
I think this makes sense, but this may break some setups, so this should
be yet another chip->option.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-25 8:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 14:55 [RFC] write bad block marker even with BBT Matthieu CASTET
2010-10-25 8:05 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).