This is a note to let you know that I've just added the patch titled drm/etnaviv: check for reaped mapping in etnaviv_iommu_unmap_gem to the 5.17-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-check-for-reaped-mapping-in-etnaviv_iommu_unmap_gem.patch and it can be found in the queue-5.17 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From e168c25526cd0368af098095c2ded4a008007e1b Mon Sep 17 00:00:00 2001 From: Lucas Stach <l.stach@xxxxxxxxxxxxxx> Date: Wed, 23 Mar 2022 17:08:22 +0100 Subject: drm/etnaviv: check for reaped mapping in etnaviv_iommu_unmap_gem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Lucas Stach <l.stach@xxxxxxxxxxxxxx> commit e168c25526cd0368af098095c2ded4a008007e1b upstream. When the mapping is already reaped the unmap must be a no-op, as we would otherwise try to remove the mapping twice, corrupting the involved data structures. Cc: stable@xxxxxxxxxxxxxxx # 5.4 Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx> Reviewed-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx> Tested-by: Guido Günther <agx@xxxxxxxxxxx> Acked-by: Guido Günther <agx@xxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/etnaviv/etnaviv_mmu.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/gpu/drm/etnaviv/etnaviv_mmu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_mmu.c @@ -286,6 +286,12 @@ void etnaviv_iommu_unmap_gem(struct etna mutex_lock(&context->lock); + /* Bail if the mapping has been reaped by another thread */ + if (!mapping->context) { + mutex_unlock(&context->lock); + return; + } + /* If the vram node is on the mm, unmap and remove the node */ if (mapping->vram_node.mm == &context->mm) etnaviv_iommu_remove_mapping(context, mapping); Patches currently in stable-queue which might be from l.stach@xxxxxxxxxxxxxx are queue-5.17/drm-bridge-adv7511-clean-up-cec-adapter-when-probe-f.patch queue-5.17/drm-etnaviv-check-for-reaped-mapping-in-etnaviv_iommu_unmap_gem.patch queue-5.17/pci-imx6-fix-perst-start-up-sequence.patch