Skip to content

Commit

Permalink
drm/msm/gem: Drop early returns in close/purge vma
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Rob Clark committed Jun 15, 2022
1 parent 311e03c commit b4d329c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/msm/msm_gem_vma.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ void msm_gem_purge_vma(struct msm_gem_address_space *aspace,
unsigned size = vma->node.size;

/* Print a message if we try to purge a vma in use */
if (GEM_WARN_ON(msm_gem_vma_inuse(vma)))
return;
GEM_WARN_ON(msm_gem_vma_inuse(vma));

/* Don't do anything if the memory isn't mapped */
if (!vma->mapped)
Expand Down Expand Up @@ -128,8 +127,7 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace,
void msm_gem_close_vma(struct msm_gem_address_space *aspace,
struct msm_gem_vma *vma)
{
if (GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped))
return;
GEM_WARN_ON(msm_gem_vma_inuse(vma) || vma->mapped);

spin_lock(&aspace->lock);
if (vma->iova)
Expand Down

0 comments on commit b4d329c

Please sign in to comment.