Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/gem: Drop early returns in close/purge vma

Keep the warn, but drop the early return. If we do manage to hit this
sort of issue, skipping the cleanup just makes things worse (dangling
drm_mm_nodes when the msm_gem_vma is freed, etc). Whereas the worst
that happens if we tear down a mapping the GPU is accessing is that we
get GPU iova faults, but otherwise the world keeps spinning.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Reported-by: Steev Klimaszewski <steev@kali.org>
Patchwork: https://patchwork.freedesktop.org/patch/489115/
Link: https://lore.kernel.org/r/20220610172055.2337977-1-robdclark@gmail.com

+2 -4
+2 -4
drivers/gpu/drm/msm/msm_gem_vma.c
··· 62 62 unsigned size = vma->node.size; 63 63 64 64 /* Print a message if we try to purge a vma in use */ 65 - if (GEM_WARN_ON(msm_gem_vma_inuse(vma))) 66 - return; 65 + GEM_WARN_ON(msm_gem_vma_inuse(vma)); 67 66 68 67 /* Don't do anything if the memory isn't mapped */ 69 68 if (!vma->mapped) ··· 127 128 void msm_gem_close_vma(struct msm_gem_address_space *aspace, 128 129 struct msm_gem_vma *vma) 129 130 { 130 - if (GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped)) 131 - return; 131 + GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped); 132 132 133 133 spin_lock(&aspace->lock); 134 134 if (vma->iova)