regmap_field...poll_timeout(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… regmap_field_read_poll_timeout β€” Kernel API Manual ✨

okay so bestie, this is a kernel API page, and the function we're obsessing over is literally regmap_field_read_poll_timeout. Yeah that's a mouthful, she ate though. πŸŽ€


✨ NAME ✨

regmap_field_read_poll_timeout β€” poll until a condition is met or timeout. that's it, that's the vibe check πŸ¦‹


🌸 SYNOPSIS 🌸

regmap_field_read_poll_timeout (field , val , cond , sleep_us , timeout_us );

πŸ’– ARGUMENTS πŸ’–

  • field β€” the regmap field you're reading from. your main character. πŸ‘‘
  • val β€” an unsigned integer variable, and the value gets read into it. she's the destination, no cap.
  • cond β€” the break condition, and yeah it usually involves val. like, that's the whole point bestie 😭
  • sleep_us β€” maximum time to sleep between reads, in us. 0 means tight-loops, which, ok, no rest for the wicked πŸ’€. ngl please go read the usleep_range function description for the details and limitations β€” fr fr, don't skip it.
  • timeout_us β€” timeout in us. 0 means never timeout, she waits forever 🫢

🌈 DESCRIPTION 🌈

This one is modelled after the readx_poll_timeout macros over in linux/iopoll.h. that's the lore 🧚


⭐ RETURN ⭐

  • 0 on success β€” slay πŸ’…
  • -ETIMEDOUT upon a timeout
  • or the regmap_field_read error return value in case of an error read πŸ™ˆ

and in the two former cases (timeout and error read), the last read value at addr is stored in val. iconic behaviour honestly.

⚠️ must not be called from atomic context if sleep_us or timeout_us are used. like seriously, do not, that's the danger zone πŸ’€πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/regmap.h β€” and the whole friend group:


okay that's the whole page, you're welcome πŸ’–βœ¨

signed off with love from ./include/linux, dated October 2026 β€” iykyk πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from