Skip to contentSkip to conversation

OneNAND: Check first or second pages for bad block information

PATCH Kyungmin Park 3 participants 3 messages Jan 22, 2007 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

I'm not sure we have to check 2nd page. Yes, Spec. says we will check 1st and 2nd ones.

It increase the boot time even though it's smaller one than others.

Let me think, when we check 2nd page case.
In initial bad, no need to check 2nd page.
In runtime bad, it is only happend when first page write failed. But during write it has non-0xFF value. so next time it will be detected as invalid.

How do you think about it?

Thank you,
Kyungmin Park

------- Original Message -------
Sender : Adrian Hunter<[email protected]>
Date : Jan 19, 2007 23:37
Title : [PATCH] [MTD] OneNAND: Check first or second pages for bad block
information

OneNAND records bad block information in the out-of-band area of either the first or second page of a block. Due to a logic error, only the first page was being checked.

---
 drivers/mtd/onenand/onenand_bbt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/mtd/onenand/onenand_bbt.c +1 -1
index 90db8f5..aa46b7f 100644
@@ -68,7 +68,7 @@ static int create_bbt(struct mtd_info *m
 
 	printk(KERN_INFO "Scanning device for bad blocks\n");
 
-	len = 1;
+	len = 2;
 
 	/* We need only read few bytes from the OOB area */
 	scanlen = ooblen = 0;
Signature · 1 line
1.4.3
#1 lore raw
Quoted 3 lines · ext Kyungmin Park

I'm not sure we have to check 2nd page. Yes, Spec. says we will check 1st and 2nd ones.

It increase the boot time even though it's smaller one than others.

My experience is that the OneNAND bad block scanning time is very small (i.e. insignicant) compared with overall boot time. For example:
2048 blocks x 2 pages x 30 microseconds per page = 0.12 seconds

Quoted 5 lines

Let me think, when we check 2nd page case.
In initial bad, no need to check 2nd page.
In runtime bad, it is only happend when first page write failed. But during write it has non-0xFF value. so next time it will be detected as invalid.

How do you think about it?

I cannot comment on how OneNAND actually works. Also I do not have any experience of encountering bad blocks. So I would follow the specification.

The specification says:

Check "FFFFh" at the 1st word of sector 0
of spare area in 1st and 2nd page

Based on the specification, I would presume that if a bad block goes un-noticed, it could be erased and written without error and only produce errors when the data is read back, by which time it is too late.

If you can guarantee that we never need to read the 2nd page to detect bad blocks, then the specification should be changed accordingly.

#2 lore raw
In reply to Kyungmin Park

Hi,

Quoted 3 lines · Kyungmin Park

Hi,

I'm not sure we have to check 2nd page. Yes, Spec. says we will check

1st and 2nd ones.

Quoted 3 lines

It increase the boot time even though it's smaller one than others.

Actually, if one is very concerned about BB scanning time, he should use on-flash BBT instead of in-memory BBT.

Quoted 3 lines

Let me think, when we check 2nd page case.
In initial bad, no need to check 2nd page.
In runtime bad, it is only happend when first page write failed. But

during write it has non-0xFF value. so next time it will be detected as invalid.

Quoted 1 line

My understanding is that the second page is used only when the first one could not be written to due to some reasons - dunno which reasons.

So I wonder, how sane is it to read 1st page's OOB, and if no read errors detected - avoid reading the second one.