Skip to contentSkip to conversation

strange bad block code

DISCUSSION Matthieu CASTET 1 participant 2 messages Apr 21, 2011 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

while looking at the bad block code, I saw that e0b58d0a introduced a "chip->badblockbits" for bad block detection in nand_block_bad[1]. That's great because to we can use it to handle bit flip in bad block marker.

But few commit latter c7b28e25cb9 removed "chip->badblockbits = 8;" from common code.
So now chip->badblockbits = 0.

How such code wan works ?

Adding NAND_SKIP_BBTSCAN in any driver, expose the problem.

[1]

    if (likely(chip->badblockbits == 8))
        res = bad != 0xFF;
    else
        res = hweight8(bad) < chip->badblockbits;
#1 lore raw
Quoted 6 lines · Matthieu CASTET

Hi,

while looking at the bad block code, I saw that e0b58d0a introduced a "chip->badblockbits" for bad block detection in nand_block_bad[1]. That's great because to we can use it to handle bit flip in bad block marker.

Quoted 8 lines

But few commit latter c7b28e25cb9 removed "chip->badblockbits = 8;" from common code.
So now chip->badblockbits = 0.

How such code wan works ?

Adding NAND_SKIP_BBTSCAN in any driver, expose the problem.

BTW nand_block_bad seems broken with the new NAND_BBT_SCAN2NDPAGE and NAND_BBT_SCANBYTE1AND6.