tb_switch_alloc_safe_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tb_switch_alloc_safe_mode β€” Kernel API Manual, section 9 πŸŽ€

okay bestie, story time: this is a page from the Kernel API Manual (section 9) about one very specific little function, and honestly it's giving "baby switch before its glow-up" energy. let's get into it ✨


✨ NAME ✨

tb_switch_alloc_safe_mode β€” allocate a switch that is in safe mode πŸ¦‹


🌸 SYNOPSIS 🌸

struct tb_switch * tb_switch_alloc_safe_mode (struct tb *tb , struct
device *parent , u64 route );

πŸŽ€ ARGUMENTS πŸŽ€

  • tb β€” pointer to the owning domain πŸ‘‘
  • parent β€” the parent device for this switch 🫢
  • route β€” the route string for this switch 🌈

πŸ’– DESCRIPTION πŸ’–

so this function creates a switch in safe mode, and ngl "safe mode" is doing a lot of heavy lifting here 😭 it literally means the switch pretty much lacks all capabilities except the DMA configuration port β€” and that's before it gets flashed with a valid NVM firmware. like, it's a switch that hasn't found itself yet, periodt. πŸ’€

the returned switch must be released by calling tb_switch_put 🚨 don't just ghost it, bestie β€” that's a leak.

⭐ RETURN ⭐

a pointer to struct tb_switch, or ERR_PTR in case of failure πŸ™ˆ (iykyk β€” always check your pointers)


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./drivers/thunderbolt/switch.c and honestly the whole friend group:


and that's the whole page, bestie β€” no cap, every single reference is there πŸ’œ

this iconic little manual page comes to you from ./drivers/thunderbolt, dated October 2026, and it's tb_switch_alloc_safe_mode(9) signing off 🧚✨ mwah πŸ’‹

πŸ“¦ where this page comes from