[PATCH] drm/i915: WARN if asked to wait on an impossible future seqno

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On the hunt for an indefinite __wait_seqno() the most likely cause being
asked to wait upon a future seqno, we can lay a trap and see if anything
gets caught.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 39de523..b2effab 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1118,6 +1118,12 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
 	bool wait_forever = true;
 	int ret;
 
+	if (WARN_ON(!i915_seqno_passed(list_entry(ring->request_list.prev,
+						  struct drm_i915_gem_request,
+						  list)->seqno,
+				       seqno)))
+		return -EDEADLK;
+
 	if (i915_seqno_passed(ring->get_seqno(ring, true), seqno))
 		return 0;
 
-- 
1.7.10.4



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux