claim_tcs_for_req(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– claim_tcs_for_req(9) β€” the Kernel API Manual page, but make it make sense πŸ’–

okay so bestie, welcome to the glow-up of claim_tcs_for_req, straight out of the Kernel API Manual. this one's a function, it lives in the kernel, and it's about to claim a tcs for you. let's get into it πŸŽ€


✨ NAME ✨

claim_tcs_for_req β€” claim a tcs in the given tcs_group; only for active. that's the whole vibe. no cap. πŸ’…


🌸 SYNOPSIS 🌸

int claim_tcs_for_req (struct rsc_drv *drv , struct tcs_group *tcs ,
const struct tcs_request *msg );

she takes three things and gives you back an int. iconic signature, honestly 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • drv β€” the controller. that's the main character in this whole situation πŸ‘‘
  • tcs β€” the tcs_group used for ACTIVE_ONLY transfers. note the ACTIVE_ONLY, it's literally the whole point πŸ”₯
  • msg β€” the data to be sent. the payload. the moment. the reason we're all here πŸ“

πŸ’œ DESCRIPTION πŸ’œ

so what does she actually do? she claims a tcs in the given tcs_group, and while she's at it she makes sure that no existing cmd is already in flight that would conflict with the one in msg. like, she's not just grabbing a spot β€” she's doing a whole vibe check on the in-flight traffic first. considerate queen behaviour, fr fr ✨


⭐ CONTEXT ⭐

okay this part is important, do not skip it πŸ™ˆ:

must be called with the drv->lock held, since that's what protects tcs_in_use.

so like, hold the lock. or else. 😭


🌈 RETURN 🌈

she returns the id of the claimed tcs πŸŽ‰ β€” or -EBUSY if a matching msg is in flight, or if the tcs_group is full. busy girl, full house, either way you get -EBUSY πŸ’€


🧚 SEE ALSO 🧚

kernel file ./drivers/soc/qcom/rpmh-rsc.c, plus the whole friend group:

go read them, they're all lowkey obsessed with each other iykyk πŸ¦‹


and that's the page!! πŸ’– this little beauty lives in ./drivers/soc/qcom and the manual's dated October 2026 β€” so like, future-proof and slaying. mwah, bye bestie πŸ’…πŸŽ€

πŸ“¦ where this page comes from