This is a note to let you know that I've just added the patch titled drm/etnaviv: put submit prev MMU context when it exists to the 5.14-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-put-submit-prev-mmu-context-when-it-exists.patch and it can be found in the queue-5.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From cda7532916f7bc860b36a1806cb8352e6f63dacb Mon Sep 17 00:00:00 2001 From: Lucas Stach <l.stach@xxxxxxxxxxxxxx> Date: Fri, 20 Aug 2021 22:18:24 +0200 Subject: drm/etnaviv: put submit prev MMU context when it exists From: Lucas Stach <l.stach@xxxxxxxxxxxxxx> commit cda7532916f7bc860b36a1806cb8352e6f63dacb upstream. The prev context is the MMU context at the time of the job queueing in hardware. As a job might be queued multiple times due to recovery after a GPU hang, we need to make sure to put the stale prev MMU context from a prior queuing, to avoid the reference and thus the MMU context leaking. 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 | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1368,6 +1368,8 @@ struct dma_fence *etnaviv_gpu_submit(str gpu->mmu_context = etnaviv_iommu_context_get(submit->mmu_context); etnaviv_gpu_start_fe_idleloop(gpu); } else { + if (submit->prev_mmu_context) + etnaviv_iommu_context_put(submit->prev_mmu_context); submit->prev_mmu_context = etnaviv_iommu_context_get(gpu->mmu_context); } Patches currently in stable-queue which might be from l.stach@xxxxxxxxxxxxxx are queue-5.14/drm-etnaviv-put-submit-prev-mmu-context-when-it-exists.patch queue-5.14/drm-etnaviv-reference-mmu-context-when-setting-up-hardware-state.patch queue-5.14/drm-etnaviv-stop-abusing-mmu_context-as-fe-running-marker.patch queue-5.14/drm-etnaviv-return-context-from-etnaviv_iommu_context_get.patch queue-5.14/drm-etnaviv-keep-mmu-context-across-runtime-suspend-resume.patch queue-5.14/drm-etnaviv-exec-and-mmu-state-is-lost-when-resetting-the-gpu.patch queue-5.14/drm-etnaviv-add-missing-mmu-context-put-when-reaping-mmu-mapping.patch queue-5.14/drm-etnaviv-fix-mmu-context-leak-on-gpu-reset.patch