drm/amdgpu: fix kgd_hqd_load failing to update shadow_wptr
authorAndres Rodriguez <andresx7@gmail.com>
Thu, 13 Apr 2017 17:55:41 +0000 (13:55 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 31 May 2017 20:48:49 +0000 (16:48 -0400)
The return value from copy_form_user is 0 for the success case.

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c

index f9ad534696c46b0f926d05516514b868f215508a..8af29756a9d9d51637416a65257b46a3104009be 100644 (file)
@@ -252,7 +252,7 @@ static int kgd_hqd_load(struct kgd_dev *kgd, void *mqd, uint32_t pipe_id,
        m = get_mqd(mqd);
 
        valid_wptr = copy_from_user(&shadow_wptr, wptr, sizeof(shadow_wptr));
-       if (valid_wptr > 0)
+       if (valid_wptr == 0)
                m->cp_hqd_pq_wptr = shadow_wptr;
 
        acquire_queue(kgd, pipe_id, queue_id);