All of lore.kernel.org
 help / color / mirror / Atom feed
* NAND bad block table creation
@ 2010-06-10  9:13 Naveen Mamindlapalli
  0 siblings, 0 replies; only message in thread
From: Naveen Mamindlapalli @ 2010-06-10  9:13 UTC (permalink / raw)
  To: linux-mtd

Hi All,

I am going through mtd subsystem code for bad block management
information. The linux kernel version I am using is linux-2.6.34. In
the create_bbt( )  function in drivers/mtd/nand/nand_bbt.c, the for
loop which checks for whether a block is bad or not is incrementing by
2 (line 436) . That means alternate NAND blocks are checked to find
out whether that block is bad or not.

Is this correct?

Code is pasted below ( drivers/mtd/nand/nand_bbt.c ):

    417         for (i = startblock; i < numblocks;) {
    418                 int ret;
    419
    420                 if (bd->options & NAND_BBT_SCANALLPAGES)
    421                         ret = scan_block_full(mtd, bd, from,
buf, readlen,
    422                                               scanlen, len);
    423                 else
    424                         ret = scan_block_fast(mtd, bd, from, buf, len);
    425
    426                 if (ret < 0)
    427                         return ret;
    428
    429                 if (ret) {
    430                         this->bbt[i >> 3] |= 0x03 << (i & 0x6);
    431                         printk(KERN_WARNING "Bad eraseblock %d
at 0x%012llx\n",
    432                                i >> 1, (unsigned long long)from);
    433                         mtd->ecc_stats.badblocks++;
    434                 }
    435
    436                 i += 2;
    437                 from += (1 << this->bbt_erase_shift);
    438         }

Thanks and Regards,
Naveen

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-10  9:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-10  9:13 NAND bad block table creation Naveen Mamindlapalli

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.