[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171115024521.5884-40-alexander.levin@verizon.com>
Date: Wed, 15 Nov 2017 02:45:44 +0000
From: alexander.levin@...izon.com
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Cc: Chris Wilson <chris@...is-wilson.co.uk>,
alexander.levin@...izon.com
Subject: [PATCH AUTOSEL for 4.9 40/56] drm/i915: Assert no external observers
when unwind a failed request alloc
From: Chris Wilson <chris@...is-wilson.co.uk>
[ Upstream commit 1618bdb89b5d8b47edf42d9c6ea96ecf001ad625 ]
Before we return the request back to the kmem_cache after a failed
i915_gem_request_alloc(), we should assert that it has not been added to
any global state tracking.
Signed-off-by: Chris Wilson <chris@...is-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161125131718.20978-2-chris@chris-wilson.co.uk
Signed-off-by: Sasha Levin <alexander.levin@...izon.com>
---
drivers/gpu/drm/i915/i915_gem_request.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 8832f8ec1583..71e284d7c640 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -455,6 +455,11 @@ i915_gem_request_alloc(struct intel_engine_cs *engine,
return req;
err_ctx:
+ /* Make sure we didn't add ourselves to external state before freeing */
+ GEM_BUG_ON(!list_empty(&req->active_list));
+ GEM_BUG_ON(!list_empty(&req->priotree.signalers_list));
+ GEM_BUG_ON(!list_empty(&req->priotree.waiters_list));
+
i915_gem_context_put(ctx);
err:
kmem_cache_free(dev_priv->requests, req);
--
2.11.0
Powered by blists - more mailing lists