atcrtc_check_write_done(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… atcrtc_check_write_done β€” in the (9) kernel API manual, bestie

okay so real talk, this one's about the ATC RTC driver and specifically waiting for the RTC registers to finish syncing. it's giving "patience is a virtue" but make it kernel code ✨


🌸 NAME 🌸

atcrtc_check_write_done β€” literally just wait for the RTC registers to be synchronized, no cap πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

int atcrtc_check_write_done (struct atcrtc_dev *rtc );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • rtc β€” a pointer to the atcrtc_dev structure. that's the one, that's the whole argument, she's simple and she knows it πŸ™ˆ

✨ DESCRIPTION ✨

okay bestie so picture this: there's a WriteDone bit in the status register, right? and that bit is basically the vibe check for whether RTC register updates have finished synchronizing πŸ‘‘

the way it works: that bit gets cleared to zero whenever any RTC control register is written β€” and yes, that means Counter, Alarm, Control, etc., all of them, the whole squad πŸ’…

then it comes back to one only after all the previous updates have been fully synchronized to the RTC clock domain. so like, not before, not kinda-sorta, fully. periodt 🌈

this function polls the WriteDone bit with a timeout, so you can be sure the device is actually ready for the next operation instead of just assuming and making a whole mess 😭


πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” slay, we're synced πŸ’–
  • -EBUSY on timeout β€” she waited and she waited and it did NOT happen, so, yeah πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./drivers/rtc/rtc-atcrtc100.c β€” go read the source, iykyk 🫢

ngl if you get -EBUSY back, that's your sign the hardware's still cooking. do not skip the check, bestie, the check is the whole point 🧚

that's the whole page, mwah πŸ’‹ β€” this little gem lives in ./drivers/rtc, dropped October 2026, straight from the Kernel API Manual. go forth and sync responsibly, queen πŸŽ€βœ¨

πŸ“¦ where this page comes from