check_for_req_inflight(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– check_for_req_inflight(9) β€” the "is anyone else using that address rn??" check πŸ’–

okay bestie, so this one's a kernel API manual page for check_for_req_inflight(9) and it's genuinely so important, like it's the vibe-check function for RSC/TCS traffic. let's get into it ✨


🌸 SYNOPSIS 🌸

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

like yes, that's the whole signature, no cap 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • drv β€” the controller. literally the main character of this whole operation πŸ‘‘
  • tcs β€” a pointer to the tcs_group used for ACTIVE_ONLY transfers. she's the group we're snooping through πŸ’…
  • msg β€” the message we wanna send. it's giving "several addr/data pairs to program" energy, but like… few enough that they all fit in one TCS. cozy. 🧚

πŸ¦‹ DESCRIPTION πŸ¦‹

so what this does is it walks through the TCSes in the group and checks if any of them appear to be sending to addresses referenced in the message. like it's doing a little background check on everyone's addresses, very detective of her πŸ”βœ¨

if it finds one? it'll return -EBUSY. boom. not today. πŸ’€

Only for use for active-only transfers. β€” pls respect this, it's not a suggestion πŸ™ˆ

⚠️ Must be called with the drv->lock held since that protects tcs_in_use. like fr fr, do not skip the lock, that's the whole safety vibe πŸ’–

⭐ RETURN ⭐

  • 0 if nothing is in flight β€” slay, you're clear, go off πŸ‘‘
  • -EBUSY if we should try again later β€” she's busy bestie, come back 😭

and listen: the caller must re-enable interrupts between tries since that's the only way tcs_in_use will ever be updated and the only way RSC_DRV_CMD_ENABLE will ever be cleared. like that's not optional, that's the whole mechanism, iykyk πŸ”₯


🌈 SEE ALSO 🌈

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

tcs_invalidate(9), rpmh_rsc_invalidate(9), get_tcs_for_msg(9), get_req_from_tcs(9), __tcs_set_trigger(9), enable_tcs_irq(9), tcs_tx_done(9), __tcs_buffer_write(9), find_free_tcs(9), claim_tcs_for_req(9), rpmh_rsc_send_data(9), find_slots(9), rpmh_rsc_write_ctrl_data(9), rpmh_rsc_ctrlr_is_busy(9), rpmh_rsc_write_next_wakeup(9), rpmh_rsc_cpu_pm_callback(9), rpmh_rsc_pd_callback(9)

like that's the whole squad, go read them too, they all ate πŸ’…βœ¨


and that's the page bestie!! πŸŽ€ source/version vibes live at ./drivers/soc/qcom and this lil icon was dated October 2026 β€” mwah, love u, go hold that lock properly πŸ«ΆπŸ’–

πŸ“¦ where this page comes from