doc_erase_block(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 0 if erase successful β€” slay, we ate, everything is fine ✨
  • -EIO if erase issue β€” πŸ’€ uh oh, something went wrong with the I/O
  • -ETIMEOUT if 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. 0 is the dream, -EIO and -ETIMEOUT are 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