diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-02 11:51:30 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-02 15:18:55 +0000 |
commit | e60a870d7f83517e583e6094ff5646d3a8d732db (patch) | |
tree | f861564b3a7f5ffb353abbb0a281ff352d1d1914 /drivers/gpu/drm/i915/i915_gem_request.c | |
parent | a5509abda48ecfc133fac6268e83fc1a93dba039 (diff) | |
download | op-kernel-dev-e60a870d7f83517e583e6094ff5646d3a8d732db.zip op-kernel-dev-e60a870d7f83517e583e6094ff5646d3a8d732db.tar.gz |
drm/i915: Assert that fence->lock is held in an irq-safe manner
Everytime we take the fence->lock (aka request->lock), we must do so
with irqs disabled since it may be used from within an hardirq context.
As sometimes we are taking the lock in a nested manner, assert that the
caller did disable the irqs for us.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170302115130.28434-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_request.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_request.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c index 77c3ee7..582471c 100644 --- a/drivers/gpu/drm/i915/i915_gem_request.c +++ b/drivers/gpu/drm/i915/i915_gem_request.c @@ -400,12 +400,14 @@ void __i915_gem_request_submit(struct drm_i915_gem_request *request) struct intel_timeline *timeline; u32 seqno; + GEM_BUG_ON(!irqs_disabled()); + assert_spin_locked(&engine->timeline->lock); + trace_i915_gem_request_execute(request); /* Transfer from per-context onto the global per-engine timeline */ timeline = engine->timeline; GEM_BUG_ON(timeline == request->timeline); - assert_spin_locked(&timeline->lock); seqno = timeline_get_seqno(timeline); GEM_BUG_ON(!seqno); @@ -446,6 +448,7 @@ void __i915_gem_request_unsubmit(struct drm_i915_gem_request *request) struct intel_engine_cs *engine = request->engine; struct intel_timeline *timeline; + GEM_BUG_ON(!irqs_disabled()); assert_spin_locked(&engine->timeline->lock); /* Only unwind in reverse order, required so that the per-context list |