All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/psr: Fix race in intel_psr_work()
@ 2018-06-25  5:47 Dhinakaran Pandiyan
  2018-06-25  5:47 ` [PATCH 2/2] drm/i915/psr: Warn for erroneous enabling of both PSR1 and PSR2 Dhinakaran Pandiyan
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Dhinakaran Pandiyan @ 2018-06-25  5:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: Dhinakaran Pandiyan, Rodrigo Vivi

Commit 5422b37c907e ("drm/i915/psr: Kill delays when activating psr
back.") switched from delayed work to the plain variant and while doing so
removed the check for work_busy() before scheduling a PSR activation.
This appears to cause consecutive executions of psr_activate() in this
scenario - after a worker picks up the PSR work item for execution and
before the work function can acquire the PSR mutex, a psr_flush() can
get hold of the mutex and schedule another PSR work. Without a psr_exit()
between the two psr_activate() calls, warning messages get printed.
Further, since we drop the mutex in the midst of psr_work() to wait for
PSR to idle, another work item can also get scheduled. Fix this by
returning if PSR was already active.

Fixes: 5422b37c907e ("drm/i915/psr: Kill delays when activating psr back.")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106948
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_psr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
index aea81ace854b..7aa324f0d1f7 100644
--- a/drivers/gpu/drm/i915/intel_psr.c
+++ b/drivers/gpu/drm/i915/intel_psr.c
@@ -811,7 +811,7 @@ static void intel_psr_work(struct work_struct *work)
 	 * recheck. Since psr_flush first clears this and then reschedules we
 	 * won't ever miss a flush when bailing out here.
 	 */
-	if (dev_priv->psr.busy_frontbuffer_bits)
+	if (dev_priv->psr.busy_frontbuffer_bits || dev_priv->psr.active)
 		goto unlock;
 
 	intel_psr_activate(dev_priv->psr.enabled);
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-06-26 19:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-25  5:47 [PATCH 1/2] drm/i915/psr: Fix race in intel_psr_work() Dhinakaran Pandiyan
2018-06-25  5:47 ` [PATCH 2/2] drm/i915/psr: Warn for erroneous enabling of both PSR1 and PSR2 Dhinakaran Pandiyan
2018-06-26  0:09   ` Rodrigo Vivi
2018-06-26  6:44     ` Dhinakaran Pandiyan
2018-06-26  9:05   ` [PATCH v2 " Dhinakaran Pandiyan
2018-06-26 15:50     ` Rodrigo Vivi
2018-06-26 20:02       ` Dhinakaran Pandiyan
2018-06-25  6:21 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/psr: Fix race in intel_psr_work() Patchwork
2018-06-25  7:46 ` ✓ Fi.CI.IGT: " Patchwork
2018-06-26  0:10 ` [PATCH 1/2] " Rodrigo Vivi
2018-06-26  9:42 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/psr: Fix race in intel_psr_work() (rev2) Patchwork
2018-06-26 11:26 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.