spinand_wait(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the spinand device 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 boundary
  • s β€” the pointer to the variable where the value of REG_STATUS gets 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_READY goes 0, or time runs out. either way, you're getting a return πŸ’…

⭐ RETURN ⭐

  • 0 on success πŸŽ‰
  • a negative error code otherwise 😭 (so like, check it, bestie)

🌈 SEE ALSO 🌈

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