drm/amdgpu: protect fence_process from multiple context
authorChunming Zhou <david1.zhou@amd.com>
Fri, 24 Jul 2015 02:49:47 +0000 (10:49 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Aug 2015 20:50:38 +0000 (16:50 -0400)
fence_process may be called from kthread, user thread and interrupt context.
it is possible to called concurrently, then will wake up fence queue multiple times.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c

index 1b8d05f..0703fbf 100644 (file)
@@ -869,6 +869,7 @@ struct amdgpu_ring {
        struct amdgpu_fence_driver      fence_drv;
        struct amd_gpu_scheduler        *scheduler;
 
+       spinlock_t              fence_lock;
        struct mutex            *ring_lock;
        struct amdgpu_bo        *ring_obj;
        volatile uint32_t       *ring;