diff options
| author | Christian König <[email protected]> | 2023-12-08 12:43:09 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-12-13 21:08:01 +0000 |
| commit | 683b8c7e7a94fb7445b8d300c7404322ad040bab (patch) | |
| tree | aaf99619fe1a98bb58079ca669162d6ab7f6a904 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | |
| parent | drm/amd/display: decouple steps for mapping CRTC degamma to DC plane (diff) | |
| download | kernel-683b8c7e7a94fb7445b8d300c7404322ad040bab.tar.gz kernel-683b8c7e7a94fb7445b8d300c7404322ad040bab.zip | |
drm/amdgpu: fix tear down order in amdgpu_vm_pt_free
When freeing PD/PT with shadows it can happen that the shadow
destruction races with detaching the PD/PT from the VM causing a NULL
pointer dereference in the invalidation code.
Fix this by detaching the the PD/PT from the VM first and then
freeing the shadow instead.
Signed-off-by: Christian König <[email protected]>
Fixes: https://gitlab.freedesktop.org/drm/amd/-/issues/2867
Cc: <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c index a2287bb25223..a160265ddc07 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c @@ -642,13 +642,14 @@ static void amdgpu_vm_pt_free(struct amdgpu_vm_bo_base *entry) if (!entry->bo) return; + + entry->bo->vm_bo = NULL; shadow = amdgpu_bo_shadowed(entry->bo); if (shadow) { ttm_bo_set_bulk_move(&shadow->tbo, NULL); amdgpu_bo_unref(&shadow); } ttm_bo_set_bulk_move(&entry->bo->tbo, NULL); - entry->bo->vm_bo = NULL; spin_lock(&entry->vm->status_lock); list_del(&entry->vm_status); |
