spinand_wait(9)
π spinand_wait(9) β or, how to stalk a memory device until it's ready
okay so bestie, welcome to the Kernel API Manual π and today's main character is spinand_wait(9). yes it's a function, yes it's in the kernel, yes we're gonna understand it. no cap.
β¨ NAME β¨
spinand_wait β the little function that polls a memory device's status until it's done vibing. it's giving "are we there yet" but make it kernel-space π¦
πΈ SYNOPSIS πΈ
int spinand_wait(struct spinand_device *spinand, unsigned long
initial_delay_us, unsigned long poll_delay_us, u8 *s);
four args, one int coming back, let's go π
π«Ά ARGUMENTS π«Ά
spinandβ thespinanddevice in question. the star of the show πinitial_delay_usβ delay in us before it even starts polling. like a little warm-up nap first π΄poll_delay_usβ how long it sleeps between reads, in us. yes it naps between checks, we love a healthy boundarysβ the pointer to the variable where the value ofREG_STATUSgets stored. hold my data π₯
π DESCRIPTION π
so what does it actually do? it polls a status register (REG_STATUS) and returns when the STATUS_READY bit is 0 β or when the timeout has expired. that's it. that's the whole vibe check π§
fr fr, it bounces on two conditions:STATUS_READYgoes0, or time runs out. either way, you're getting a return π
β RETURN β
0on success π- a negative error code otherwise π (so like, check it, bestie)
π SEE ALSO π
- Kernel file
./drivers/mtd/nand/spi/core.c spinand_upd_cfg(9)spinand_select_target(9)spinand_read_page(9)spinand_write_page(9)spinand_match_and_init(9)
go read those too, they're all connected, iykyk π₯
and that's the page, bestie π this icon was brought to you by ./drivers/mtd/nand/spi, October 2026, and spinand_wait(9) β periodt β¨ππ¦
π¦ 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