Revert "drm/msm/a5xx: fix races in preemption evaluation stage"
This reverts commit 22746ff9a0
.
This commit is contained in:
parent
a33260418a
commit
f007606619
2 changed files with 2 additions and 23 deletions
|
@ -36,7 +36,6 @@ struct a5xx_gpu {
|
|||
uint64_t preempt_iova[MSM_GPU_MAX_RINGS];
|
||||
|
||||
atomic_t preempt_state;
|
||||
spinlock_t preempt_start_lock;
|
||||
struct timer_list preempt_timer;
|
||||
|
||||
struct drm_gem_object *shadow_bo;
|
||||
|
|
|
@ -98,19 +98,12 @@ void a5xx_preempt_trigger(struct msm_gpu *gpu)
|
|||
if (gpu->nr_rings == 1)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Serialize preemption start to ensure that we always make
|
||||
* decision on latest state. Otherwise we can get stuck in
|
||||
* lower priority or empty ring.
|
||||
*/
|
||||
spin_lock_irqsave(&a5xx_gpu->preempt_start_lock, flags);
|
||||
|
||||
/*
|
||||
* Try to start preemption by moving from NONE to START. If
|
||||
* unsuccessful, a preemption is already in flight
|
||||
*/
|
||||
if (!try_preempt_state(a5xx_gpu, PREEMPT_NONE, PREEMPT_START))
|
||||
goto out;
|
||||
return;
|
||||
|
||||
/* Get the next ring to preempt to */
|
||||
ring = get_next_ring(gpu);
|
||||
|
@ -135,11 +128,9 @@ void a5xx_preempt_trigger(struct msm_gpu *gpu)
|
|||
set_preempt_state(a5xx_gpu, PREEMPT_ABORT);
|
||||
update_wptr(gpu, a5xx_gpu->cur_ring);
|
||||
set_preempt_state(a5xx_gpu, PREEMPT_NONE);
|
||||
goto out;
|
||||
return;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&a5xx_gpu->preempt_start_lock, flags);
|
||||
|
||||
/* Make sure the wptr doesn't update while we're in motion */
|
||||
spin_lock_irqsave(&ring->preempt_lock, flags);
|
||||
a5xx_gpu->preempt[ring->id]->wptr = get_wptr(ring);
|
||||
|
@ -163,10 +154,6 @@ void a5xx_preempt_trigger(struct msm_gpu *gpu)
|
|||
|
||||
/* And actually start the preemption */
|
||||
gpu_write(gpu, REG_A5XX_CP_CONTEXT_SWITCH_CNTL, 1);
|
||||
return;
|
||||
|
||||
out:
|
||||
spin_unlock_irqrestore(&a5xx_gpu->preempt_start_lock, flags);
|
||||
}
|
||||
|
||||
void a5xx_preempt_irq(struct msm_gpu *gpu)
|
||||
|
@ -204,12 +191,6 @@ void a5xx_preempt_irq(struct msm_gpu *gpu)
|
|||
update_wptr(gpu, a5xx_gpu->cur_ring);
|
||||
|
||||
set_preempt_state(a5xx_gpu, PREEMPT_NONE);
|
||||
|
||||
/*
|
||||
* Try to trigger preemption again in case there was a submit or
|
||||
* retire during ring switch
|
||||
*/
|
||||
a5xx_preempt_trigger(gpu);
|
||||
}
|
||||
|
||||
void a5xx_preempt_hw_init(struct msm_gpu *gpu)
|
||||
|
@ -324,6 +305,5 @@ void a5xx_preempt_init(struct msm_gpu *gpu)
|
|||
}
|
||||
}
|
||||
|
||||
spin_lock_init(&a5xx_gpu->preempt_start_lock);
|
||||
timer_setup(&a5xx_gpu->preempt_timer, a5xx_preempt_timer, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue