tb_ring_stop(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tb_ring_stop β€” like, the Kernel API Manual page, bestie

Okay so this is tb_ring_stop(9) from the Kernel API Manual and I'm literally obsessed with how clean it is. It's a tiny little function that shuts a ring down, and no cap, the details matter here, so let's get into it 🫢


✨ NAME ✨

tb_ring_stop β€” shutdown a ring πŸ’€

Like. That's it. That's the whole job. It stops the ring. Iconic behavior, honestly.


🌸 SYNOPSIS 🌸

void tb_ring_stop (struct tb_ring *ring );

Note the void β€” it doesn't hand you back a status code, it just does the thing and returns. Main character energy, no receipts πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • ring β€” the ring you want to stop. That's the one. The ring in question. Give it here ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

Bestie, read this part twice, because there's a rule:

Must not be invoked from a callback. 🚫

Do not call this from inside a callback. Just don't. That's a hard no.

This method will disable the ring. Once it's disabled, further calls to tb_ring_tx/tb_ring_rx will return -ESHUTDOWN until ring_stop has been called. So like, the ring is off and everyone trying to use it gets told -ESHUTDOWN. Noted, periodt.

All enqueued frames will be canceled, and their callbacks will be executed with frame->canceled set to true β€” and yes, that happens on the callback thread. 🌈

And the part that lowkey matters the most: this method returns only after all callback invocations have finished. So when it comes back to you, everyone's done, nobody's still running, it's all wrapped up. Clean. 🧚


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/thunderbolt/nhi.c, plus all these sibling functions that are also invited to the group chat:


πŸ“ Friendly reminder before you go: callback = not allowed. Only call tb_ring_stop from somewhere that isn't a callback, and remember the ring is disabled and every enqueued frame gets frame->canceled = true on the callback thread, and it won't return until all of those callbacks are finished. That's the whole vibe check πŸ’–

Okay that's the page!! Signing off from ./drivers/thunderbolt, dated October 2026 β€” yeah the footer said that, slay, love that for us. Byeee πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from