virtio_mark_txdone(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

virtio_mark_txdone β€” Mark transmission done. This is the virtio_mark_txdone(9) page from the Kernel API Manual, bestie, and it's literally about marking transmission done. Slay. ✨

✨ SYNOPSIS

Okay so the exact signature is right here, no cap:

void virtio_mark_txdone (struct scmi_chan_info *cinfo , int ret , struct
       scmi_xfer *xfer );

🌸 ARGUMENTS

  • cinfo β€” SCMI channel info. It's the channel info, periodt. πŸŽ€
  • ret β€” Transmission return code. The little code that says how the transmission went. πŸ’«
  • xfer β€” Transfer descriptor. The descriptor for the transfer. πŸ¦‹

πŸ’« DESCRIPTION

Bestie, the whole assignment is: free only completed polling transfer messages. That's the vibe. πŸ’–

Quick lore drop: in the SCMI VirtIO transport we never explicitly release still outstanding but timed-out messages by forcibly re-adding them to the free-list inside the TX code path. Nope. Instead we let IRQ/RX callbacks, or the TX deferred worker, eventually clean up such messages once, finally, a late reply is received and discarded (if ever). It's giving patience. 🧚

This approach was deemed preferable, and honestly? Valid. Those pending timed-out buffers are still effectively owned by the SCMI platform VirtIO device even after timeout expiration. So forcibly freeing and reusing them before they had been returned explicitly by the SCMI platform could lead to subtle bugs due to message corruption. 🫠 An SCMI platform VirtIO device which never returns message buffers is anyway broken, and it will quickly lead to exhaustion of available messages. No buffer return? Broken behavior, exhausted messages, bye. πŸ’€

For this same reason, here we take care to free only the polled messages that had been somehow replied β€” only if not by chance already processed on the IRQ path, because the initial scmi_vio_msg_release takes care of this β€” and also any timed-out polled message if that indeed appears to have been at least dequeued from the virtqueues (VIO_MSG_POLL_DONE): this is needed since such messages won't be freed elsewhere. Any other polled message is marked as VIO_MSG_POLL_TIMEOUT. πŸ“Œ

Possible late replies to timed-out polled messages will be eventually freed by RX callbacks if delivered on the IRQ path or by the deferred TX worker if dequeued on some other polling path. Late replies get cleaned up eventually β€” not by us being messy. πŸ’…

πŸ¦‹ SEE ALSO

  • Kernel file ./drivers/firmware/arm_scmi/transports/virtio.c β€” the kernel file reference, iykyk. 🌈
  • Theory of Operation(9) β€” the theory-of-operation reference, bestie. 🌸
  • struct scmi_vio_channel(9) β€” the channel struct reference. πŸ’œ
  • struct scmi_vio_msg(9) β€” the message struct reference. πŸŽ€
  • virtio_poll_done(9) β€” the poll-done reference. ⭐

Cute sign-off: that's the whole page, bestie πŸ’– source/version: ./drivers/firmware/arm_scmi/tr...; date: October 2026; and it's the virtio_mark_txdone(9) manual page. Mwah πŸ’‹

πŸ“¦ where this page comes from