]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/psr: Check PSR pause counter in __psr_wait_for_idle_locked
authorJouni Högander <jouni.hogander@intel.com>
Tue, 26 Aug 2025 07:44:57 +0000 (10:44 +0300)
committerJouni Högander <jouni.hogander@intel.com>
Wed, 27 Aug 2025 06:48:54 +0000 (09:48 +0300)
PSR work is using __psr_wait_for_idle_locked to ensure PSR exit is
completed before continuing to PSR activation. __psr_wait_for_idle_locked
is unlocking PSR mutex which allows PSR disable/enable and PSR
pause/resume while PSR idle is being wait. PSR enable status is already
checked after locking again PSR mutex but PSR pause counter check is
missing. Due to this PSR work may continue to PSR activation even PSR is
paused.

Fix this by checking PSR pause counter in __psr_wait_for_idle_locked after
PSR mutex is locked again.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Jeevan B <jeevan.b@intel.com>
Link: https://lore.kernel.org/r/20250826074457.1992524-1-jouni.hogander@intel.com
drivers/gpu/drm/i915/display/intel_psr.c

index 681e20d92376d18631a2a655a8636c740cfb2875..22433fe2ee141692029731b3153b22c1fb1249b3 100644 (file)
@@ -3093,7 +3093,7 @@ static bool __psr_wait_for_idle_locked(struct intel_dp *intel_dp)
 
        /* After the unlocked wait, verify that PSR is still wanted! */
        mutex_lock(&intel_dp->psr.lock);
-       return err == 0 && intel_dp->psr.enabled;
+       return err == 0 && intel_dp->psr.enabled && !intel_dp->psr.pause_counter;
 }
 
 static int intel_psr_fastset_force(struct intel_display *display)