STRUCT RSC_DRV(9)
๐ 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 forACTIVE_ONLYtransfers โ but heads up, it might show a sleep/wake TCS in use if it was borrowed for anactive_onlytransfer. 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->lockthencache_lock. get the order wrong and that's not slay, that's a deadlock ๐tcs_waitโ wait queue used to wait fortcs_in_useto 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
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms