Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f914600 authored by Tarun Karra's avatar Tarun Karra
Browse files

msm: kgsl: Add barrier to read preemption state correctly



Preemption state gives us the current state of preemption.
This state is updated in different points in the driver.
Without a barrier we are reading stale values, add a barrier
to read the most recent updated preemption state.

Change-Id: I1e52b2c3c6cd8aec5252c6e750a7012c68ab26dd
Signed-off-by: default avatarTarun Karra <tkarra@codeaurora.org>
parent 55bc7ff0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3155,6 +3155,12 @@ static void a5xx_preemption_schedule(

	mutex_lock(&device->mutex);

	/*
	 * This barrier is needed for most updated preemption_state
	 * to be read.
	 */
	smp_mb();

	if (KGSL_STATE_ACTIVE == device->state)
		FOR_EACH_RINGBUFFER(adreno_dev, rb, i)
			rb->rptr = adreno_get_rptr(rb);