Skip to content

Commit

Permalink
drm/i915: Spinlocks in tasklets can use spin_(un)lock_irq
Browse files Browse the repository at this point in the history
The tasklets callbacks are only called from tasklet context so
it is safe do to this.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170321105511.18269-1-tvrtko.ursulin@linux.intel.com
  • Loading branch information
Tvrtko Ursulin committed Mar 21, 2017
1 parent fe085f1 commit 9f7886d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions drivers/gpu/drm/i915/i915_guc_submission.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ static bool i915_guc_dequeue(struct intel_engine_cs *engine)
{
struct execlist_port *port = engine->execlist_port;
struct drm_i915_gem_request *last = port[0].request;
unsigned long flags;
struct rb_node *rb;
bool submit = false;

Expand All @@ -589,7 +588,7 @@ static bool i915_guc_dequeue(struct intel_engine_cs *engine)
if (!READ_ONCE(engine->execlist_first))
return false;

spin_lock_irqsave(&engine->timeline->lock, flags);
spin_lock_irq(&engine->timeline->lock);
rb = engine->execlist_first;
while (rb) {
struct drm_i915_gem_request *rq =
Expand Down Expand Up @@ -619,7 +618,7 @@ static bool i915_guc_dequeue(struct intel_engine_cs *engine)
nested_enable_signaling(last);
engine->execlist_first = rb;
}
spin_unlock_irqrestore(&engine->timeline->lock, flags);
spin_unlock_irq(&engine->timeline->lock);

return submit;
}
Expand Down
5 changes: 2 additions & 3 deletions drivers/gpu/drm/i915/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
{
struct drm_i915_gem_request *last;
struct execlist_port *port = engine->execlist_port;
unsigned long flags;
struct rb_node *rb;
bool submit = false;

Expand Down Expand Up @@ -448,7 +447,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
* and context switches) submission.
*/

spin_lock_irqsave(&engine->timeline->lock, flags);
spin_lock_irq(&engine->timeline->lock);
rb = engine->execlist_first;
while (rb) {
struct drm_i915_gem_request *cursor =
Expand Down Expand Up @@ -500,7 +499,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
i915_gem_request_assign(&port->request, last);
engine->execlist_first = rb;
}
spin_unlock_irqrestore(&engine->timeline->lock, flags);
spin_unlock_irq(&engine->timeline->lock);

if (submit)
execlists_submit_ports(engine);
Expand Down

0 comments on commit 9f7886d

Please sign in to comment.