If we skip RC6 init, residency registers do not get initialized,
leading to incorrect drpc debug output. Also release the wakeref
since we skip intel_rc6_enable() entirely when rc6_supported is false.

Fixes: 78d0b4552c37 ("drm/i915/gt: Use RC6 residency types as arguments to 
residency functions")
Suggested-by: Alan Previn <[email protected]>
Signed-off-by: Vinay Belgaumkar <[email protected]>
---
 drivers/gpu/drm/i915/gt/intel_rc6.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_rc6.c 
b/drivers/gpu/drm/i915/gt/intel_rc6.c
index 7090e4be29cb..58dc0dab9b64 100644
--- a/drivers/gpu/drm/i915/gt/intel_rc6.c
+++ b/drivers/gpu/drm/i915/gt/intel_rc6.c
@@ -608,11 +608,13 @@ void intel_rc6_init(struct intel_rc6 *rc6)
        /* Disable runtime-pm until we can save the GPU state with rc6 pctx */
        rpm_get(rc6);
 
-       if (!rc6_supported(rc6))
-               return;
-
        rc6_res_reg_init(rc6);
 
+       if (!rc6_supported(rc6)) {
+               rpm_put(rc6);
+               return;
+       }
+
        if (IS_CHERRYVIEW(i915))
                err = chv_rc6_init(rc6);
        else if (IS_VALLEYVIEW(i915))
-- 
2.38.1

Reply via email to