diff options
author | Ingo Molnar <mingo@kernel.org> | 2016-05-05 03:57:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-05-05 03:57:27 -0400 |
commit | e8c8ce54807b19e90ac84e609b13f7d4e337eab1 (patch) | |
tree | ae7d65ae17d55aee197b605ce1a193fe594af614 /drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | |
parent | 5db4298133d99b3dfc60d6899ac9df169769c899 (diff) | |
parent | 04974df8049fc4240d22759a91e035082ccd18b4 (diff) |
Merge tag 'v4.6-rc6' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 4303b447efe8..d81f1f4883a6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | |||
@@ -121,7 +121,7 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct fence **f) | |||
121 | { | 121 | { |
122 | struct amdgpu_device *adev = ring->adev; | 122 | struct amdgpu_device *adev = ring->adev; |
123 | struct amdgpu_fence *fence; | 123 | struct amdgpu_fence *fence; |
124 | struct fence **ptr; | 124 | struct fence *old, **ptr; |
125 | uint32_t seq; | 125 | uint32_t seq; |
126 | 126 | ||
127 | fence = kmem_cache_alloc(amdgpu_fence_slab, GFP_KERNEL); | 127 | fence = kmem_cache_alloc(amdgpu_fence_slab, GFP_KERNEL); |
@@ -141,7 +141,11 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct fence **f) | |||
141 | /* This function can't be called concurrently anyway, otherwise | 141 | /* This function can't be called concurrently anyway, otherwise |
142 | * emitting the fence would mess up the hardware ring buffer. | 142 | * emitting the fence would mess up the hardware ring buffer. |
143 | */ | 143 | */ |
144 | BUG_ON(rcu_dereference_protected(*ptr, 1)); | 144 | old = rcu_dereference_protected(*ptr, 1); |
145 | if (old && !fence_is_signaled(old)) { | ||
146 | DRM_INFO("rcu slot is busy\n"); | ||
147 | fence_wait(old, false); | ||
148 | } | ||
145 | 149 | ||
146 | rcu_assign_pointer(*ptr, fence_get(&fence->base)); | 150 | rcu_assign_pointer(*ptr, fence_get(&fence->base)); |
147 | 151 | ||