find_free_tcs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 find_free_tcs(9) 🌸

okay so bestie, welcome to the Kernel API Manual β€” today's main character is find_free_tcs(9) and honestly? she's a little legend. let's get into it πŸ’…


✨ NAME ✨

find_free_tcs β€” literally just finds free tcs in the given tcs_group. and like, only for active. that part matters, don't @ me πŸŽ€


✨ SYNOPSIS ✨

int find_free_tcs (struct tcs_group *tcs );

that's it. that's the whole vibe check. one arg, one int coming back at you πŸ¦‹


✨ ARGUMENTS ✨

  • tcs β€” a pointer to the active-only tcs_group (or, plot twist, the wake tcs_group if we borrowed it because there are literally zero active-only ones β€” like when your bestie has no charger so you lend her yours, no cap πŸ”₯)

✨ DESCRIPTION ✨

so here's the tea: you must call this with the drv->lock held, because that lock is what protects tcs_in_use. don't skip the lock bestie, that's the whole safety girlie of this operation πŸ˜­πŸ”’


✨ RETURN ✨

it hands you back the first tcs that's free β€” or, if every single one is in use, -EBUSY. that's it, that's the answer πŸ’€


✨ SEE ALSO ✨

kernel file ./drivers/soc/qcom/rpmh-rsc.c β€” and the whole friend group, because nobody does it alone 🫢:


ok that's the whole page, go be iconic with your tcs πŸ’–

sign-off era: this slay little page lives at ./drivers/soc/qcom, dated October 2026, and yes β€” it's find_free_tcs(9) again, because we always come back to her πŸ‘‘βœ¨

πŸ“¦ where this page comes from