drm/amdgpu:fix duplicated setting job's vram_lost
authorMonk Liu <Monk.Liu@amd.com>
Mon, 16 Oct 2017 12:02:08 +0000 (20:02 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 19 Oct 2017 19:27:17 +0000 (15:27 -0400)
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

index 52dd78ee8fd07efc10af1542331c26bc48836814..32cf83e2f2d9fbfb2589f3be415bec814fa06e05 100644 (file)
@@ -172,7 +172,6 @@ static int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
        if (ret)
                goto free_all_kdata;
 
-       p->job->vram_lost_counter = atomic_read(&p->adev->vram_lost_counter);
        if (p->ctx->vram_lost_counter != p->job->vram_lost_counter) {
                ret = -ECANCELED;
                goto free_all_kdata;
index a8357885776e15e236a5237ed754d52d46b789e1..0cfc68db575b1ec8c220060154e2485ff8cecf78 100644 (file)
@@ -61,11 +61,11 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,
        (*job)->vm = vm;
        (*job)->ibs = (void *)&(*job)[1];
        (*job)->num_ibs = num_ibs;
-       (*job)->vram_lost_counter = atomic_read(&adev->vram_lost_counter);
 
        amdgpu_sync_create(&(*job)->sync);
        amdgpu_sync_create(&(*job)->dep_sync);
        amdgpu_sync_create(&(*job)->sched_sync);
+       (*job)->vram_lost_counter = atomic_read(&adev->vram_lost_counter);
 
        return 0;
 }