Skip to content

Commit 00598d5

Browse files
vsbelgaumjnikula
authored andcommitted
drm/i915: Get PM ref before accessing HW register
Seeing these errors when GT is likely in suspend state- "RPM wakelock ref not held during HW access" Ensure GT is awake before trying to access HW registers. Avoid reading the register if that is not the case. Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> Fixes: 41e5c17 ("drm/i915/guc/slpc: Sysfs hooks for SLPC") Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210907232704.12982-1-vinay.belgaumkar@intel.com (cherry picked from commit f25e390) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent 0315366 commit 00598d5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/gpu/drm/i915/gt/intel_rps.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1973,8 +1973,14 @@ u32 intel_rps_read_actual_frequency(struct intel_rps *rps)
19731973
u32 intel_rps_read_punit_req(struct intel_rps *rps)
19741974
{
19751975
struct intel_uncore *uncore = rps_to_uncore(rps);
1976+
struct intel_runtime_pm *rpm = rps_to_uncore(rps)->rpm;
1977+
intel_wakeref_t wakeref;
1978+
u32 freq = 0;
19761979

1977-
return intel_uncore_read(uncore, GEN6_RPNSWREQ);
1980+
with_intel_runtime_pm_if_in_use(rpm, wakeref)
1981+
freq = intel_uncore_read(uncore, GEN6_RPNSWREQ);
1982+
1983+
return freq;
19781984
}
19791985

19801986
static u32 intel_rps_get_req(u32 pureq)

0 commit comments

Comments
 (0)