From: Jouni Högander Date: Tue, 26 Aug 2025 07:44:57 +0000 (+0300) Subject: drm/i915/psr: Check PSR pause counter in __psr_wait_for_idle_locked X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=61a0ef5921d603e64beef12f4a3bf7bfde409f18;p=users%2Fhch%2Fmisc.git drm/i915/psr: Check PSR pause counter in __psr_wait_for_idle_locked 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 Reviewed-by: Jeevan B Link: https://lore.kernel.org/r/20250826074457.1992524-1-jouni.hogander@intel.com --- diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c index 681e20d92376..22433fe2ee14 100644 --- a/drivers/gpu/drm/i915/display/intel_psr.c +++ b/drivers/gpu/drm/i915/display/intel_psr.c @@ -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)