This is a note to let you know that I've just added the patch titled drm/etnaviv: keep MMU context across runtime suspend/resume 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-keep-mmu-context-across-runtime-suspend-resume.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 8f3eea9d01d7b0f95b0fe04187c0059019ada85b Mon Sep 17 00:00:00 2001 From: Lucas Stach <l.stach@xxxxxxxxxxxxxx> Date: Fri, 20 Aug 2021 22:18:26 +0200 Subject: drm/etnaviv: keep MMU context across runtime suspend/resume From: Lucas Stach <l.stach@xxxxxxxxxxxxxx> commit 8f3eea9d01d7b0f95b0fe04187c0059019ada85b upstream. The MMU state may be kept across a runtime suspend/resume cycle, as we avoid a full hardware reset to keep the latency of the runtime PM small. Don't pretend that the MMU state is lost in driver state. The MMU context is pushed out when new HW jobs with a different context are coming in. The only exception to this is when the GPU is unbound, in which case we need to make sure to also free the last active context. Cc: stable@xxxxxxxxxxxxxxx # 5.4 Reported-by: Michael Walle <michael@xxxxxxxx> 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1578,9 +1578,6 @@ static int etnaviv_gpu_hw_suspend(struct */ etnaviv_gpu_wait_idle(gpu, 100); - etnaviv_iommu_context_put(gpu->mmu_context); - gpu->mmu_context = NULL; - gpu->fe_running = false; } @@ -1729,6 +1726,9 @@ static void etnaviv_gpu_unbind(struct de etnaviv_gpu_hw_suspend(gpu); #endif + if (gpu->mmu_context) + etnaviv_iommu_context_put(gpu->mmu_context); + if (gpu->initialized) { etnaviv_cmdbuf_free(&gpu->buffer); etnaviv_iommu_global_fini(gpu); 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