tb_ring_stop(9)
π 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:
tb_ring_poll(9)tb_ring_poll_complete(9)tb_ring_alloc_tx(9)tb_ring_alloc_rx(9)tb_ring_start(9)tb_ring_flush(9)tb_ring_throttling(9)nhi_mailbox_cmd(9)nhi_mailbox_mode(9)
π Friendly reminder before you go: callback = not allowed. Only calltb_ring_stopfrom somewhere that isn't a callback, and remember the ring is disabled and every enqueued frame getsframe->canceled = trueon 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms