Skip to content

Commit b4d329c

Browse files
committed
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
1 parent 311e03c commit b4d329c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/gpu/drm/msm/msm_gem_vma.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ void msm_gem_purge_vma(struct msm_gem_address_space *aspace,
6262
unsigned size = vma->node.size;
6363

6464
/* 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));
6766

6867
/* Don't do anything if the memory isn't mapped */
6968
if (!vma->mapped)
@@ -128,8 +127,7 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace,
128127
void msm_gem_close_vma(struct msm_gem_address_space *aspace,
129128
struct msm_gem_vma *vma)
130129
{
131-
if (GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped))
132-
return;
130+
GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped);
133131

134132
spin_lock(&aspace->lock);
135133
if (vma->iova)

0 commit comments

Comments
 (0)