tb_switch_resume(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ tb_switch_resume(9) β€” the "wake up bestie" page πŸ’€

okay so this is a page from the Kernel API Manual (that's the manual name, bestie, it's giving very much kernel-core) and it's all about tb_switch_resume. Buckle up πŸŽ€


✨ NAME ✨

tb_switch_resume β€” literally just resume a switch after sleep. that's it. that's the vibe πŸ’…


✨ SYNOPSIS ✨

int tb_switch_resume (struct tb_switch *sw , bool runtime );

yes the spacing is real, don't come for me, copy it exactly 🫢


✨ ARGUMENTS ✨

  • sw β€” the switch you're resuming. the main character of this whole operation πŸ‘‘
  • runtime β€” is this resume from runtime suspend or from system sleep? lowkey an important distinction, pick one, no cap.

✨ DESCRIPTION ✨

so what it does: it resumes and re-enumerates the router β€” and like, all of its children too β€” but only if it's still plugged after suspend. if you yanked it out mid-nap, this isn't happening, sorry bestie 😭

it does not enumerate a device router whose UID was changed during suspend. nope. not doing that. the UID changed, so it's a different situation now, we're not touching it πŸ™ˆ

if this is a resume from system sleep, it notifies the PM core about the wakes that occurred during suspend. like a little "hey, these things woke up while you were out" text thread πŸ’¬

and it disables all wakes, except the USB4 wake of the upstream port for USB4 routers β€” that one shall be always enabled. always. periodt. that's a hard rule, not a suggestion ⭐


✨ RETURN ✨

  • 0 on success β€” slay πŸ’–
  • negative errno otherwise β€” not slay, but at least it tells you what's up πŸ’€

✨ SEE ALSO ✨

this list is genuinely iconic in length, so here we go, all of them, none skipped, we do NOT leave anyone out 🫢

and if you're looking for the actual source, it lives in the kernel file ./drivers/thunderbolt/switch.c β€” that's the πŸ“ location, iykyk.

okay that's the page!! 🌈 this came out of ./drivers/thunderbolt and it's dated October 2026 β€” leaving you with that, mwah πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from