drm/amdgpu: must update page table after gpu reset
authorChunming Zhou <David1.Zhou@amd.com>
Mon, 27 Jun 2016 09:06:01 +0000 (17:06 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Jul 2016 19:06:02 +0000 (15:06 -0400)
Record the gpu reset count in vmid to identify if gpu reset happened.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 7df1f486f1fbf766a80bd2e04ca8867c2fc8e57b..0c8be665ca2cec225f11ac5209bc0c17174f57f6 100644 (file)
@@ -897,6 +897,8 @@ struct amdgpu_vm_id {
        /* last flushed PD/PT update */
        struct fence            *flushed_updates;
 
+       uint32_t                current_gpu_reset_count;
+
        uint32_t                gds_base;
        uint32_t                gds_size;
        uint32_t                gws_base;
index ea10b7af33dfb7b8bde12edd376b1740de686c5a..be0941621f4dfb94e6f105f92cae375828923bba 100644 (file)
@@ -255,6 +255,8 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
                /* Check all the prerequisites to using this VMID */
                if (!id)
                        continue;
+               if (id->current_gpu_reset_count != atomic_read(&adev->gpu_reset_counter))
+                       continue;
 
                if (atomic64_read(&id->owner) != vm->client_id)
                        continue;
@@ -278,6 +280,7 @@ int amdgpu_vm_grab_id(struct amdgpu_vm *vm, struct amdgpu_ring *ring,
                if (r)
                        goto error;
 
+               id->current_gpu_reset_count = atomic_read(&adev->gpu_reset_counter);
                list_move_tail(&id->list, &adev->vm_manager.ids_lru);
                vm->ids[ring->idx] = id;