This is a note to let you know that I've just added the patch titled drm/etnaviv: exec and MMU state is lost when resetting the GPU to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-etnaviv-exec-and-mmu-state-is-lost-when-resetting-the-gpu.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 725cbc7884c37f3b4f1777bc1aea6432cded8ca5 Mon Sep 17 00:00:00 2001 From: Lucas Stach <l.stach@xxxxxxxxxxxxxx> Date: Fri, 20 Aug 2021 22:18:27 +0200 Subject: drm/etnaviv: exec and MMU state is lost when resetting the GPU From: Lucas Stach <l.stach@xxxxxxxxxxxxxx> commit 725cbc7884c37f3b4f1777bc1aea6432cded8ca5 upstream. 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@xxxxxxxxxxxxxxx # 5.4 Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx> Tested-by: Michael Walle <michael@xxxxxxxx> Tested-by: Marek Vasut <marex@xxxxxxx> Reviewed-by: Christian Gmeiner <christian.gmeiner@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -562,6 +562,8 @@ static int etnaviv_hw_reset(struct etnav etnaviv_gpu_update_clock(gpu); gpu->fe_running = false; + gpu->exec_state = -1; + gpu->mmu_context = NULL; return 0; } @@ -818,7 +820,6 @@ int etnaviv_gpu_init(struct etnaviv_gpu /* Now program the hardware */ mutex_lock(&gpu->lock); etnaviv_gpu_hw_init(gpu); - gpu->exec_state = -1; mutex_unlock(&gpu->lock); pm_runtime_mark_last_busy(gpu->dev); @@ -1043,8 +1044,6 @@ void etnaviv_gpu_recover_hang(struct etn spin_unlock(&gpu->event_spinlock); etnaviv_gpu_hw_init(gpu); - gpu->exec_state = -1; - gpu->mmu_context = NULL; mutex_unlock(&gpu->lock); pm_runtime_mark_last_busy(gpu->dev); Patches currently in stable-queue which might be from l.stach@xxxxxxxxxxxxxx are queue-5.10/drm-etnaviv-put-submit-prev-mmu-context-when-it-exists.patch queue-5.10/drm-etnaviv-reference-mmu-context-when-setting-up-hardware-state.patch queue-5.10/drm-etnaviv-stop-abusing-mmu_context-as-fe-running-marker.patch queue-5.10/drm-etnaviv-return-context-from-etnaviv_iommu_context_get.patch queue-5.10/drm-etnaviv-keep-mmu-context-across-runtime-suspend-resume.patch queue-5.10/drm-etnaviv-exec-and-mmu-state-is-lost-when-resetting-the-gpu.patch queue-5.10/drm-etnaviv-add-missing-mmu-context-put-when-reaping-mmu-mapping.patch queue-5.10/drm-etnaviv-fix-mmu-context-leak-on-gpu-reset.patch