diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-12-31 14:20:09 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-12-31 14:41:45 +0300 |
commit | 7a5580a2a69ae0681805638d1f5c66f544bd9c2a (patch) | |
tree | 33dd6332e7749a0dc20bfb79bf9fa890be5863e3 /drivers/gpu/drm/i915/i915_vma.c | |
parent | f50b79f096a7533e9b13638c06dfa759de070f56 (diff) | |
download | linux-7a5580a2a69ae0681805638d1f5c66f544bd9c2a.tar.xz |
drm/i915: Move assert of page pin vs bind count into i915_vma_unbind
The read of the page pin count and the bind count are unordered,
presenting races in the assert and it firing off incorrectly. Prevent
this by restricting the assert to the vma bind/unbind routines where we
have local cpu ordering between the two.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161231112012.29263-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_vma.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_vma.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index 868d061e1a11..e008e4e8b481 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -640,6 +640,7 @@ int i915_vma_unbind(struct i915_vma *vma) * reaped by the shrinker. */ i915_gem_object_unpin_pages(obj); + GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count); destroy: if (unlikely(i915_vma_is_closed(vma))) |