diff mbox series

drm/i915/execlists: Only mark incomplete requests as -EIO on cancelling

Message ID 20191011103345.26013-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series drm/i915/execlists: Only mark incomplete requests as -EIO on cancelling | expand

Commit Message

Chris Wilson Oct. 11, 2019, 10:33 a.m. UTC
Only the requests that have not completed do we want to change the
status of to signal the -EIO when cancelling the inflight set of requests
upon wedging.

Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_lrc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Tvrtko Ursulin Oct. 11, 2019, noon UTC | #1
On 11/10/2019 11:33, Chris Wilson wrote:
> Only the requests that have not completed do we want to change the
> status of to signal the -EIO when cancelling the inflight set of requests
> upon wedging.
> 
> Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   drivers/gpu/drm/i915/gt/intel_lrc.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index b00499cc7586..1f4772329021 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -247,8 +247,12 @@ static void __context_pin_release(struct intel_context *ce)
>   
>   static void mark_eio(struct i915_request *rq)
>   {
> -	if (!i915_request_signaled(rq))
> -		dma_fence_set_error(&rq->fence, -EIO);
> +	if (i915_request_completed(rq))
> +		return;
> +
> +	GEM_BUG_ON(i915_request_signaled(rq));
> +
> +	dma_fence_set_error(&rq->fence, -EIO);
>   	i915_request_mark_complete(rq);
>   }
>   
> 

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

Regards,

Tvrtko
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
index b00499cc7586..1f4772329021 100644
--- a/drivers/gpu/drm/i915/gt/intel_lrc.c
+++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
@@ -247,8 +247,12 @@  static void __context_pin_release(struct intel_context *ce)
 
 static void mark_eio(struct i915_request *rq)
 {
-	if (!i915_request_signaled(rq))
-		dma_fence_set_error(&rq->fence, -EIO);
+	if (i915_request_completed(rq))
+		return;
+
+	GEM_BUG_ON(i915_request_signaled(rq));
+
+	dma_fence_set_error(&rq->fence, -EIO);
 	i915_request_mark_complete(rq);
 }