doc_erase_block(9)
π doc_erase_block(9) β the Kernel API Manual, but make it make sense β¨
okay bestie, so this is doc_erase_block(9) from the Kernel API Manual, section 9 (kernel developer vibes only, iykyk). it lives in the Kernel file ./drivers/mtd/devices/docg3.c and it does exactly one thing, but it does it twice, because of course it does. π
β¨ NAME β¨
doc_erase_block β Erase a couple of blocks π§
like, two blocks. a duo. a pair. besties, even.
πΈ SYNOPSIS πΈ
int doc_erase_block (struct docg3 *docg3 , int block0 , int block1 );
that's the whole signature, no cap. it returns an int, so prepare for a status check. π
π¦ ARGUMENTS π¦
docg3β the device. the actual DOCG3 chip you're talking to. main character energy, fr.block0β the first block to erase (leftmost plane). π«Άblock1β the second block to erase (rightmost plane). π«Ά
two blocks, two planes, one function call. we love efficiency. π₯
β DESCRIPTION β
Erase both blocks, and return operation status. that's it, that's the description β but the status part is the important part, so like, pay attention bestie π
the return value is giving drama because each one means something different:
- returns
0if erase successful β slay, we ate, everything is fine β¨ -EIOif erase issue β π uh oh, something went wrong with the I/O-ETIMEOUTif chip not ready for too long β the chip simply did not show up to the function, and we waited way too long π
ngl, check that return value.0is the dream,-EIOand-ETIMEOUTare the "we need to talk" texts. no skipping the vibe check on the status, okay? π
π SEE ALSO π
literally the whole extended universe, bestie. this function does not travel alone:
Kernel file ./drivers/mtd/devices/docg3.c
doc_delay(9), doc_read_data_area(9), doc_write_data_area(9), doc_set_reliable_mode(9), doc_set_asic_mode(9), doc_set_device_id(9), doc_set_extra_page_mode(9), doc_setup_addr_sector(9), doc_setup_writeaddr_sector(9), doc_read_seek(9), doc_write_seek(9), doc_read_page_ecc_init(9), doc_write_page_ecc_init(9), doc_ecc_disable(9), doc_hamming_ecc_init(9), doc_ecc_bch_fix_data(9), doc_read_page_prepare(9), doc_read_page_getbytes(9), doc_write_page_putbytes(9), doc_get_bch_hw_ecc(9), doc_page_finish(9), doc_read_page_finish(9), calc_block_sector(9), doc_read_oob(9), doc_block_isbad(9), doc_get_erase_count(9), doc_get_op_status(9), doc_write_erase_wait_status(9), doc_erase(9), doc_write_page(9), doc_guess_autoecc(9), doc_fill_autooob(9), doc_backup_oob(9), doc_write_oob(9), doc_set_driver_info(9), doc_probe_device(9), doc_release_device(9), docg3_resume(9), docg3_suspend(9), docg3_probe(9), docg3_release(9)
that's the group chat. read them all. π«Ά
and that's the page, bestie β brought to you by ./drivers/mtd/devices, dated October 2026, straight from the Kernel API Manual. go erase something (responsibly) πβ¨π
π¦ 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