Skip to content

Commit 444fa5b

Browse files
dliviuSteven Price
authored andcommitted
drm/panthor: Lock XArray when getting entries for the VM
Similar to commit cac0757 ("drm/panthor: Fix race when converting group handle to group object") we need to use the XArray's internal locking when retrieving a vm pointer from there. v2: Removed part of the patch that was trying to protect fetching the heap pointer from XArray, as that operation is protected by the @pool->lock. Fixes: 647810e ("drm/panthor: Add the MMU/VM logical block") Reported-by: Jann Horn <[email protected]> Cc: [email protected] Signed-off-by: Liviu Dudau <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Steven Price <[email protected]> Signed-off-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 052ef64 commit 444fa5b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/gpu/drm/panthor/panthor_mmu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,9 @@ panthor_vm_pool_get_vm(struct panthor_vm_pool *pool, u32 handle)
15801580
{
15811581
struct panthor_vm *vm;
15821582

1583+
xa_lock(&pool->xa);
15831584
vm = panthor_vm_get(xa_load(&pool->xa, handle));
1585+
xa_unlock(&pool->xa);
15841586

15851587
return vm;
15861588
}

0 commit comments

Comments
 (0)