inftl and BBT question

Lal learner.kernel at gmail.com
Mon Aug 31 18:32:50 EDT 2009


In function write_bbt (in file nand_bbt.c), the 'to' address is
this->bbt_erase_shift aligned if NAND_BBT_SAVECONTENT is enabled,
while it is this->page_shift aligned for all other cases.

 to = ((loff_t) page) << this->page_shift;

                /* Must we save the block contents ? */
                if (td->options & NAND_BBT_SAVECONTENT) {
                        /* Make it block aligned */
                        to &= ~((loff_t) ((1 << this->bbt_erase_shift) - 1));

Later in function nand_erase_nand (in file nand_base.c), erase
operation is aborted if 'to' address is not block aligned.

        /* Start address must align on block boundary */
        if (instr->addr & ((1 << chip->phys_erase_shift) - 1)) {
                DEBUG(MTD_DEBUG_LEVEL0, "nand_erase: Unaligned address\n");
                return -EINVAL;
        }

The NAND_BBT_SAVECONTENT is enabled only in nftl_scan_bbt function,
while it is not enabled in inftl_scan_bbt function.

Can someone explain why this option is not enabled for inftl case?
Does inftl not support bad block table?

Thanks
Lal



More information about the linux-mtd mailing list