This function is to update last_emitted_v_seq and wake up the waiters.
It should be called by driver in the run_job backend function
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
if (r)
goto err;
}
- atomic64_set(&c_entity->last_emitted_v_seq,
- sched_job->ibs[sched_job->num_ibs - 1].sequence);
- wake_up_all(&c_entity->wait_emit);
+
+ amd_sched_emit(c_entity, sched_job->ibs[sched_job->num_ibs - 1].sequence);
mutex_unlock(&sched_job->job_lock);
return;
return 0;
}
+/**
+ * Update emitted sequence and wake up the waiters, called by run_job
+ * in driver side
+ *
+ * @entity The context entity
+ * @seq The sequence number for the latest emitted job
+*/
+void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq)
+{
+ atomic64_set(&c_entity->last_emitted_v_seq, seq);
+ wake_up_all(&c_entity->wait_emit);
+}
uint32_t context_id,
uint32_t jobs);
+void amd_sched_emit(struct amd_context_entity *c_entity, uint64_t seq);
+
#endif