nand_scan_bbt(9)
π nand_scan_bbt(9) β the Kernel API Manual, bestie edition β¨
okay so this is nand_scan_bbt from the Kernel API Manual, and honestly? she's a whole main character in the NAND lore. let's get into it π«Ά
πΈ NAME πΈ
nand_scan_bbt β [NAND Interface] scan, find, read and maybe create bad block table(s)
like yes she scans, yes she finds, yes she reads, and yes she might create the bad block table(s). multi-talented fr fr π
β SYNOPSIS β
int nand_scan_bbt (struct nand_chip *this , struct nand_bbt_descr *bd );
copy it exactly bestie, spacing and all, no cap π
π ARGUMENTS π
thisβ the NAND device. the actual gadget itself, the star of the show πbdβ descriptor for the good/bad block search pattern. this is the little blueprint that tells her what a good block looks like vs a bad block, iykyk π
π¦ DESCRIPTION π¦
so first things first β the function checks, if a bad block table(s) is/are already available. like, is the table already sitting there? cool, we love a prepared queen β¨
if not? she scans the device for manufacturer marked good / bad blocks and writes the bad block table(s) to the selected place. literally going out there, hunting down every manufacturer-marked good block and bad block, and then writing the table(s) to wherever was selected. obsessed with the dedication ππ₯
β οΈ important lore drop: the bad block table memory is allocated here. it must be freed by calling the nand_free_bbt function. no leaks in this house, we free our memory, periodt π
π SEE ALSO π
the whole friend group, honestly β check them out in the kernel file ./drivers/mtd/nand/raw/nand_bbt.c:
check_pattern(9)check_short_pattern(9)add_marker_len(9)read_bbt(9)read_abs_bbt(9)scan_read_oob(9)read_abs_bbts(9)create_bbt(9)search_bbt(9)search_read_bbts(9)get_bbt_block(9)mark_bbt_block_bad(9)write_bbt(9)nand_memory_bbt(9)check_create(9)nand_update_bbt(9)mark_bbt_region(9)verify_bbt_descr(9)nand_create_badblock_pattern(9)nand_create_bbt(9)nand_isreserved_bbt(9)nand_isbad_bbt(9)nand_markbad_bbt(9)
all iconic, all linked, go read them π
and that's the whole page, bestie β brought to you by the fine folks over at ./drivers/mtd/nand/raw, dated October 2026. mwah, stay scanned ππ§ββοΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms