diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-07-09 10:19:45 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-07-09 10:19:45 +0000 |
commit | 5b941fe7f1c794e628fb79fc7716897f312fb381 (patch) | |
tree | 207821fd13c11523ff4dc5c4f1b8ffef21f58b22 /sys/dev/pci/drm/i915 | |
parent | a11d682383134a688e9baf16801eb39567e944ba (diff) |
drm/i915/gt: Mark timeline->cacheline as destroyed after rcu grace period
From Chris Wilson
18ad3ad0b9b35370182ae4a7dbd89a77168df19e in linux 5.7.y/5.7.8
8e87e0139aff59c5961347ab1ef06814f092c439 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/i915')
-rw-r--r-- | sys/dev/pci/drm/i915/gt/intel_timeline.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/i915/gt/intel_timeline.c b/sys/dev/pci/drm/i915/gt/intel_timeline.c index 2fa61904404..d0cc2056f5b 100644 --- a/sys/dev/pci/drm/i915/gt/intel_timeline.c +++ b/sys/dev/pci/drm/i915/gt/intel_timeline.c @@ -119,6 +119,15 @@ static void __idle_hwsp_free(struct intel_timeline_hwsp *hwsp, int cacheline) spin_unlock_irqrestore(>->hwsp_lock, flags); } +static void __rcu_cacheline_free(struct rcu_head *rcu) +{ + struct intel_timeline_cacheline *cl = + container_of(rcu, typeof(*cl), rcu); + + i915_active_fini(&cl->active); + kfree(cl); +} + static void __idle_cacheline_free(struct intel_timeline_cacheline *cl) { GEM_BUG_ON(!i915_active_is_idle(&cl->active)); @@ -127,8 +136,7 @@ static void __idle_cacheline_free(struct intel_timeline_cacheline *cl) i915_vma_put(cl->hwsp->vma); __idle_hwsp_free(cl->hwsp, ptr_unmask_bits(cl->vaddr, CACHELINE_BITS)); - i915_active_fini(&cl->active); - kfree_rcu(cl, rcu); + call_rcu(&cl->rcu, __rcu_cacheline_free); } __i915_active_call |