intel_gt_mcr_wait_for_reg(9)
β¨ intel_gt_mcr_wait_for_reg β¨
okay so this one is straight out of the Kernel API Manual, section 9, and it's genuinely one of those little functions that just sits there waiting β literally, that's the whole job. bestie, let me tell you everything π
π NAME π
intel_gt_mcr_wait_for_reg β no cap, this is the "wait until the MCR register matches the expected state" function. that's it. that's the vibe check. β³
π¦ SYNOPSIS π¦
int intel_gt_mcr_wait_for_reg (struct intel_gt *gt , i915_mcr_reg_t reg
, u32 mask , u32 value , unsigned int fast_timeout_us , unsigned int
slow_timeout_ms );
πΈ ARGUMENTS πΈ
gtβ the GT structure π«Ά she's the context, she's the main characterregβ the register we're gonna readmaskβ the mask we apply to the register value (yes, we masking, we cute)valueβ the value we're waiting for, the whole point of the operation honestlyfast_timeout_usβ fast timeout, in microseconds, for the atomic/tight wait π₯slow_timeout_msβ slow timeout, in milliseconds π’
π DESCRIPTION π
so this routine just waits until the target register reg contains the expected value after applying the mask. i.e. it waits until:
(intel_gt_mcr_read_any_fw(gt, reg) & mask) == value
and if that never happens? the wait will timeout after slow_timeout_ms milliseconds. periodt. π
for atomic context, slow_timeout_ms must be zero and fast_timeout_us must be not larger than 20,0000 microseconds β yeah, that's the number, not me, write it down bestie π«Ά
this function is basically an MCR-friendly version of __intel_wait_for_register_fw. generally it'll only be used on GAM registers, which are a bit special β not me being dramatic, that's the doc's words π β because although they're MCR registers, reads (e.g., waiting for status updates) are always directed to the primary instance.
β οΈ note that this routine assumes the caller holds forcewake asserted. it is not suitable for very long waits. so likeβ¦ don't camp out here, it's a short-stay situation π
π§ CONTEXT π§
calls a function that takes and releases gt->mcr_lock. so she's locking, she's unlocking, she's doing the whole routine β iconic behavior π
π RETURN π
0 if the register matches the desired condition, or -ETIMEDOUT. that's the whole personality: yes or time's-up β
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/i915/gt/intel_gt_mcr.c - GT Multicast/Replicated (MCR) Register Support(9)
intel_gt_mcr_lock(9)intel_gt_mcr_unlock(9)intel_gt_mcr_lock_sanitize(9)intel_gt_mcr_read(9)intel_gt_mcr_unicast_write(9)intel_gt_mcr_multicast_write(9)intel_gt_mcr_multicast_write_fw(9)intel_gt_mcr_multicast_rmw(9)intel_gt_mcr_get_nonterminated_steering(9)intel_gt_mcr_read_any_fw(9)intel_gt_mcr_read_any(9)intel_gt_mcr_get_ss_steering(9)
like, the whole MCR friend group, honestly β go say hi to all of them π¦
and that's the page, bestie π this lil gem lives at ./drivers/gpu/drm/i915/gt, stamped October 2026 β mwah, go wait on some registers, love u ππΈ
π¦ 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