From: Andres Rodriguez Date: Thu, 13 Apr 2017 17:55:41 +0000 (-0400) Subject: drm/amdgpu: fix kgd_hqd_load failing to update shadow_wptr X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8ae0d2b8a03dc44d72dd3cccb2a78ec89518bebf;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/amdgpu: fix kgd_hqd_load failing to update shadow_wptr The return value from copy_form_user is 0 for the success case. Reviewed-by: Felix Kuehling Signed-off-by: Andres Rodriguez Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c index f9ad534696c4..8af29756a9d9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c @@ -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);