Skip to content

Commit

Permalink
drm/nouveau: uvmm: remove incorrect calls to mas_unlock()
Browse files Browse the repository at this point in the history
Remove incorrect calls to mas_unlock() in the unwind path of
__nouveau_uvma_region_insert(). The region maple tree uses an external
lock instead, namely the global uvmm lock.

Fixes: b88baab ("drm/nouveau: implement new VM_BIND uAPI")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230807163238.2091-5-dakr@redhat.com
  • Loading branch information
dakr committed Aug 8, 2023
1 parent e39701e commit 3cbc772
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/gpu/drm/nouveau/nouveau_uvmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,11 @@ __nouveau_uvma_region_insert(struct nouveau_uvmm *uvmm,
u64 last = addr + range - 1;
MA_STATE(mas, &uvmm->region_mt, addr, addr);

if (unlikely(mas_walk(&mas))) {
mas_unlock(&mas);
if (unlikely(mas_walk(&mas)))
return -EEXIST;
}

if (unlikely(mas.last < last)) {
mas_unlock(&mas);
if (unlikely(mas.last < last))
return -EEXIST;
}

mas.index = addr;
mas.last = last;
Expand Down

0 comments on commit 3cbc772

Please sign in to comment.