drm/amdgpu: fix warning in scheduler
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 4 Sep 2015 04:11:54 +0000 (00:11 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 4 Sep 2015 15:04:04 +0000 (11:04 -0400)
This should never happen so warn when the count does
not equal the expected size.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c

index ab8577f8ed4a4728f853c4bf57c3c01dfbbc901c..9259f1b6664c60cb94894d8b0c309ca8e9e8b26e 100644 (file)
@@ -332,7 +332,7 @@ static int amd_sched_main(void *param)
 {
        struct sched_param sparam = {.sched_priority = 1};
        struct amd_gpu_scheduler *sched = (struct amd_gpu_scheduler *)param;
-       int r;
+       int r, count;
 
        sched_setscheduler(current, SCHED_FIFO, &sparam);
 
@@ -361,7 +361,8 @@ static int amd_sched_main(void *param)
                        fence_put(fence);
                }
 
-               kfifo_out(&entity->job_queue, &job, sizeof(job));
+               count = kfifo_out(&entity->job_queue, &job, sizeof(job));
+               WARN_ON(count != sizeof(job));
                wake_up(&sched->job_scheduled);
        }
        return 0;