doc_read_page_prepare(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– doc_read_page_prepare(9) β€” Kernel API Manual πŸ’–

okay so bestie, this is the Kernel API Manual page for doc_read_page_prepare(9), and it is literally the β€œget the flash page ready to be read” era. no cap, it’s giving setup-function main character energy ✨


🌸 NAME 🌸

doc_read_page_prepare β€” prepares reading data from a flash page πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

int doc_read_page_prepare (struct docg3 *docg3 , int block0 , int block1
, int page , int offset );

πŸ’… ARGUMENTS πŸ’…

  • docg3 β€” the device, aka the flash bestie we’re talking to 🫢
  • block0 β€” the first plane block index on flash memory
  • block1 β€” the second plane block index on flash memory
  • page β€” the page index in the block
  • offset β€” the offset in the page. warning: it must be a multiple of 4 ⚠️

✨ DESCRIPTION ✨

so basically this prepares the page to be read in the flash memory. iconic. it does these two things:

  • tell ASIC to map the flash pages πŸ—ΊοΈ
  • tell ASIC to be in read mode πŸ“–
after a call to this method, a call to doc_read_page_finish is mandatory, to end the read cycle of the flash. do not ghost the read cycle, bestie 😭

read data from a flash page. the length to be read must be between 0 and (page_size + oob_size + wear_size), ie. 532, and a multiple of 4 (because the extra bytes reading is not implemented). periodt. πŸ’€

as pages are grouped by 2 (in 2 planes), reading from a page must be done in two steps:

  • one read of 512 bytes at offset 0
  • one read of 512 bytes at offset 512 + 16

returns 0 if successful, -EIO if a read error occurred. slay when it works, sad little signal when it doesn’t πŸ’”


πŸ”₯ SEE ALSO πŸ”₯

the whole Kernel file is ./drivers/mtd/devices/docg3.c, and the squad is:


and that’s the whole page, bestie 🫢 source/version: ./drivers/mtd/devices, dated October 2026 β€” bye babe, go read some flash pages responsibly πŸ’…πŸŽ€

πŸ“¦ where this page comes from