提交 725cbc78 编写于 作者: L Lucas Stach

drm/etnaviv: exec and MMU state is lost when resetting the GPU

When the GPU is reset both the current exec state, as well as all MMU
state is lost. Move the driver side state tracking into the reset function
to keep hardware and software state from diverging.

Cc: stable@vger.kernel.org # 5.4
Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
Tested-by: NMichael Walle <michael@walle.cc>
Tested-by: NMarek Vasut <marex@denx.de>
Reviewed-by: NChristian Gmeiner <christian.gmeiner@gmail.com>
上级 8f3eea9d
...@@ -570,6 +570,8 @@ static int etnaviv_hw_reset(struct etnaviv_gpu *gpu) ...@@ -570,6 +570,8 @@ static int etnaviv_hw_reset(struct etnaviv_gpu *gpu)
etnaviv_gpu_update_clock(gpu); etnaviv_gpu_update_clock(gpu);
gpu->fe_running = false; gpu->fe_running = false;
gpu->exec_state = -1;
gpu->mmu_context = NULL;
return 0; return 0;
} }
...@@ -836,7 +838,6 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu) ...@@ -836,7 +838,6 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
/* Now program the hardware */ /* Now program the hardware */
mutex_lock(&gpu->lock); mutex_lock(&gpu->lock);
etnaviv_gpu_hw_init(gpu); etnaviv_gpu_hw_init(gpu);
gpu->exec_state = -1;
mutex_unlock(&gpu->lock); mutex_unlock(&gpu->lock);
pm_runtime_mark_last_busy(gpu->dev); pm_runtime_mark_last_busy(gpu->dev);
...@@ -1061,8 +1062,6 @@ void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu) ...@@ -1061,8 +1062,6 @@ void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu)
spin_unlock(&gpu->event_spinlock); spin_unlock(&gpu->event_spinlock);
etnaviv_gpu_hw_init(gpu); etnaviv_gpu_hw_init(gpu);
gpu->exec_state = -1;
gpu->mmu_context = NULL;
mutex_unlock(&gpu->lock); mutex_unlock(&gpu->lock);
pm_runtime_mark_last_busy(gpu->dev); pm_runtime_mark_last_busy(gpu->dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册