STRUCT RSC_DRV(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… struct rsc_drv(9) โ€” from the Kernel API Manual, bestie

okay so picture this: it's a page from the Kernel API Manual, the headline act is struct rsc_drv(9), and it's literally the whole personality of the Direct Resource Voter (DRV) โ€” that's the DRV of the Resource State Coordinator controller (RSC). yes the acronyms are unhinged, no we're not changing them, they're iconic ๐Ÿ’…


โœจ SYNOPSIS โœจ

here's the whole glow-up, copied exactly, no notes:

       struct rsc_drv {
           const char *name;
           void __iomem *base;
           void __iomem *tcs_base;
           int id;
           int num_tcs;
           struct notifier_block rsc_pm;
           struct notifier_block genpd_nb;
           atomic_t cpus_in_pm;
           struct tcs_group tcs[TCS_TYPE_NR];
           unsigned long tcs_in_use[BITS_TO_LONGS( MAX_TCS_NR)];
           spinlock_t lock;
           wait_queue_head_t tcs_wait;
           struct rpmh_ctrlr client;
           struct device *dev;
           struct rsc_ver ver;
           u32 *regs;
        };

she's got range, she's got fields, she's got BITS_TO_LONGS( MAX_TCS_NR) with that little space in there โ€” we keep the space, that's canon ๐ŸŽ€


๐Ÿซถ Members (the cast, in order, no skips)

  • name โ€” the controller's identifier. her name, her whole identity, main character energy.
  • base โ€” start address of the DRV registers in this controller. where the DRV stuff lives โœจ
  • tcs_base โ€” start address of the TCS registers in this controller. same vibe, TCS edition.
  • id โ€” instance id in the controller (Direct Resource Voter). yes it's the id and the DRV, both at once, we contain multitudes.
  • num_tcs โ€” how many TCSes are in this DRV. headcount ๐Ÿงฎ
  • rsc_pm โ€” CPU PM notifier for controller. used when solver mode is not present. so it's the fallback bestie ๐Ÿฅบ
  • genpd_nb โ€” PM Domain notifier for cluster genpd notifications. she's on the notify list, literally.
  • cpus_in_pm โ€” number of CPUs not in idle power collapse. used when solver mode and "power-domains" are not present. lowkey the "nobody showed up to the party" counter ๐Ÿ™ˆ
  • tcs โ€” TCS groups. plural, a whole friend group.
  • tcs_in_use โ€” the S/W state of the TCS ๐Ÿฆ‹ only set for ACTIVE_ONLY transfers โ€” but heads up, it might show a sleep/wake TCS in use if it was borrowed for an active_only transfer. and the big rule:
you must hold the lock in this struct (AKA drv->lock) in order to update this. not optional, no cap, do not touch it without the lock ๐Ÿ’€
  • lock โ€” synchronizes the state of the controller. and here's the lock-ordering tea: if RPMH's cache lock will also be held, the order is: drv->lock then cache_lock. get the order wrong and that's not slay, that's a deadlock ๐Ÿ‘‘
  • tcs_wait โ€” wait queue used to wait for tcs_in_use to free up a slot. she's the queue where you sit patiently until a slot opens, like waiting for your friend to finally text back ๐Ÿ˜ญ
  • client โ€” handle to the DRV's client. the plus-one ๐Ÿซถ
  • dev โ€” the RSC device. the actual hardware boo.

so quick thing: ver and regs are right there in the struct, but this page gives them no blurb of their own. not me making up lore for them โ€” we simply do not invent facts on this account ๐Ÿ™ˆ they're in the struct, that's what we're saying, periodt.


๐ŸŒˆ SEE ALSO

  • Kernel file ./drivers/soc/qcom/rpmh-internal.h โ€” struct tcs_group(9), struct rpmh_request(9), struct rpmh_ctrlr(9)

go read those next, iykyk ๐Ÿ”ฅ


๐ŸŒธ okay that's the page!! big kiss to ./drivers/soc/qcom for shipping it with an October 2026 date, and the whole thing is filed under struct rsc_drv(9) in the Kernel API Manual โ€” the way that footer ate, honestly. byeee ๐Ÿ’œ๐ŸŽ€

๐Ÿ“ฆ where this page comes from