Commit 63ad8d58 authored by Jammy Zhou's avatar Jammy Zhou Committed by Alex Deucher

drm/amdgpu: make last_handled_seq atomic

Signed-off-by: default avatarJammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f95b7e3e
...@@ -393,7 +393,7 @@ static int amd_sched_main(void *param) ...@@ -393,7 +393,7 @@ static int amd_sched_main(void *param)
uint64_t amd_sched_get_handled_seq(struct amd_gpu_scheduler *sched) uint64_t amd_sched_get_handled_seq(struct amd_gpu_scheduler *sched)
{ {
return sched->last_handled_seq; return atomic64_read(&sched->last_handled_seq);
} }
/** /**
...@@ -414,7 +414,7 @@ void amd_sched_isr(struct amd_gpu_scheduler *sched) ...@@ -414,7 +414,7 @@ void amd_sched_isr(struct amd_gpu_scheduler *sched)
job = NULL; job = NULL;
sched->ops->process_job(sched, job); sched->ops->process_job(sched, job);
sched->last_handled_seq++; atomic64_inc(&sched->last_handled_seq);
wake_up_interruptible(&sched->wait_queue); wake_up_interruptible(&sched->wait_queue);
} }
...@@ -448,7 +448,7 @@ struct amd_gpu_scheduler *amd_sched_create(void *device, ...@@ -448,7 +448,7 @@ struct amd_gpu_scheduler *amd_sched_create(void *device,
sched->granularity = granularity; sched->granularity = granularity;
sched->ring_id = ring; sched->ring_id = ring;
sched->preemption = preemption; sched->preemption = preemption;
sched->last_handled_seq = 0; atomic64_set(&sched->last_handled_seq, 0);
snprintf(name, sizeof(name), "gpu_sched[%d]", ring); snprintf(name, sizeof(name), "gpu_sched[%d]", ring);
mutex_init(&sched->sched_lock); mutex_init(&sched->sched_lock);
......
...@@ -112,7 +112,7 @@ struct amd_gpu_scheduler { ...@@ -112,7 +112,7 @@ struct amd_gpu_scheduler {
uint32_t ring_id; uint32_t ring_id;
uint32_t granularity; /* in ms unit */ uint32_t granularity; /* in ms unit */
uint32_t preemption; uint32_t preemption;
uint64_t last_handled_seq; atomic64_t last_handled_seq;
wait_queue_head_t wait_queue; wait_queue_head_t wait_queue;
struct amd_context_entity *current_entity; struct amd_context_entity *current_entity;
struct mutex sched_lock; struct mutex sched_lock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment