Skip to content

Commit

Permalink
drm/i915: Report if i915_active is still busy upon waiting
Browse files Browse the repository at this point in the history
If we try to wait on an i915_active from within a critical section, it
will remain busy (such as if we are shrinking from within
i915_active_ref). Report the failure so that we do not proceed thinking
it is idle.

Extracted from a future patch "drm/i915: Coordinate i915_active with its
own mutex".

Fixes: 12c255b ("drm/i915: Provide an i915_active.acquire callback")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190702092117.1707-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Jul 2, 2019
1 parent 8759aa4 commit afd1bcd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/i915/i915_active.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,13 @@ int i915_active_wait(struct i915_active *ref)
}

__active_retire(ref);
return err;
if (err)
return err;

if (!i915_active_is_idle(ref))
return -EBUSY;

return 0;
}

int i915_request_await_active_request(struct i915_request *rq,
Expand Down

0 comments on commit afd1bcd

Please sign in to comment.