]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/amdgpu: evict vram when gpu reset
authorChunming Zhou <David1.Zhou@amd.com>
Sun, 12 Jun 2016 07:43:20 +0000 (15:43 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Jul 2016 18:54:44 +0000 (14:54 -0400)
On workstation cards with ECC vram, the entirety of vram is cleared to 0
on asic init to set the ECC status correctly.  On non ECC boards, I don't
think they do any explicit clearing, but the vram controller is reset
which may cause issues with the data there.

Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index a7a84286a06ff09f7d5ad6917e49dd9ebd1d879e..b9ddb4ffc90ac3b3ec86347dc2d76ff6b8f26121 100644 (file)
@@ -1896,6 +1896,9 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
 
        atomic_inc(&adev->gpu_reset_counter);
 
+       /* evict vram memory */
+       amdgpu_bo_evict_vram(adev);
+
        /* block scheduler */
        for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
                struct amdgpu_ring *ring = adev->rings[i];
@@ -1904,6 +1907,7 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
                        continue;
                kthread_park(ring->sched.thread);
        }
+
        /* block TTM */
        resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);