[1/2] drm/i915/execlists: Add a couple more validity checks to assert_pending()
diff mbox series

Message ID 20191203115339.2943374-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [1/2] drm/i915/execlists: Add a couple more validity checks to assert_pending()
Related show

Commit Message

Chris Wilson Dec. 3, 2019, 11:53 a.m. UTC
Check the pending request submission is valid: that it at least has a
reference for the submission and that the request is on the active list.

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

Comments

Tvrtko Ursulin Dec. 3, 2019, 3:28 p.m. UTC | #1
On 03/12/2019 11:53, Chris Wilson wrote:
> Check the pending request submission is valid: that it at least has a
> reference for the submission and that the request is on the active list.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/gt/intel_lrc.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index fef4b7e823f5..37ab9742abe7 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -1303,6 +1303,9 @@ assert_pending_valid(const struct intel_engine_execlists *execlists,
>   		unsigned long flags;
>   		bool ok = true;
>   
> +		GEM_BUG_ON(!kref_read(&rq->fence.refcount));
> +		GEM_BUG_ON(!i915_request_is_active(rq));
> +
>   		if (ce == rq->hw_context) {
>   			GEM_TRACE_ERR("Dup context:%llx in pending[%zd]\n",
>   				      ce->timeline->fence_context,
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index fef4b7e823f5..37ab9742abe7 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -1303,6 +1303,9 @@  assert_pending_valid(const struct intel_engine_execlists *execlists,
 		unsigned long flags;
 		bool ok = true;
 
+		GEM_BUG_ON(!kref_read(&rq->fence.refcount));
+		GEM_BUG_ON(!i915_request_is_active(rq));
+
 		if (ce == rq->hw_context) {
 			GEM_TRACE_ERR("Dup context:%llx in pending[%zd]\n",
 				      ce->timeline->fence_context,