regmap_read...meout_atomic(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

hiii bestie πŸ’– okay so this is the Kernel API Manual glow-up for regmap_read_poll_timeout_atomic. It’s giving kernel polling, but make it cute. Buckle up. πŸŽ€

πŸ’– NAME πŸ’–

regmap_read_poll_timeout_atomic β€” poll until a condition is met or a timeout occurs. periodt. ✨

✨ SYNOPSIS ✨

the signature, verbatim:

regmap_read_poll_timeout_atomic (map , addr , val , cond , delay_us ,
       timeout_us );

πŸŽ€ ARGUMENTS πŸŽ€

the cast, in order:

  • map β€” the regmap to read from. 🫢
  • addr β€” address to poll. πŸ‘€
  • val β€” unsigned integer variable to read the value into. πŸ“
  • cond β€” break condition (usually involving val). πŸ’…
  • delay_us β€” time to udelay between reads in us (0 tight-loops). Please read the udelay function description for details and limitations, fr fr. 😭
  • timeout_us β€” timeout in us, 0 means never timeout. ⏰

🌸 DESCRIPTION 🌸

This macro is modelled after the readx_poll_timeout_atomic macros in linux/iopoll.h. literally that’s the blueprint, bestie. πŸ¦‹

πŸ’€ NOTE πŸ’€

real talk: in general regmap cannot be used in atomic context. If you want to use this macro then first setup your regmap for atomic use (flat or no cache and MMIO regmap). iykyk πŸ’…

πŸ’œ RETURN πŸ’œ

here’s the tea:

  • 0 β€” success, slay. βœ…
  • -ETIMEDOUT β€” a timeout happened. ⏰
  • the regmap_read error return value β€” in case of a error read. 😬

In the two former cases (timeout and error read), the last read value at addr is stored in val. that’s the important bit. 🫢

🌈 SEE ALSO 🌈

the whole squad, all of it β€” no skips:

xoxo, your kernel bestie πŸ’‹ β€” source/version: ./include/linux; date: October 2026. πŸŽ€βœ¨

πŸ“¦ where this page comes from