Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3813f5ca authored by Jerome Glisse's avatar Jerome Glisse Committed by Alex Deucher
Browse files

drm/radeon: do not try to uselessly update virtual memory pagetable



If a buffer is never bound to a virtual memory pagetable than don't try
to unbind it. Only drawback is that we don't update the pagetable when
unbinding the ib pool buffer which is fine because it only happens at
suspend or module unload/shutdown.

Fixes spurious messages about buffers without VM mappings. E.g.:
radeon 0000:01:00.0: bo ffff88020afac400 don't has a mapping in vm ffff88021ca2b900

Cc: stable@kernel.org
Signed-off-by: default avatarJerome Glisse <jglisse@redhat.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent df63d3ec
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -1197,11 +1197,13 @@ int radeon_vm_bo_update_pte(struct radeon_device *rdev,
int radeon_vm_bo_rmv(struct radeon_device *rdev,
int radeon_vm_bo_rmv(struct radeon_device *rdev,
		     struct radeon_bo_va *bo_va)
		     struct radeon_bo_va *bo_va)
{
{
	int r;
	int r = 0;


	mutex_lock(&rdev->vm_manager.lock);
	mutex_lock(&rdev->vm_manager.lock);
	mutex_lock(&bo_va->vm->mutex);
	mutex_lock(&bo_va->vm->mutex);
	if (bo_va->soffset) {
		r = radeon_vm_bo_update_pte(rdev, bo_va->vm, bo_va->bo, NULL);
		r = radeon_vm_bo_update_pte(rdev, bo_va->vm, bo_va->bo, NULL);
	}
	mutex_unlock(&rdev->vm_manager.lock);
	mutex_unlock(&rdev->vm_manager.lock);
	list_del(&bo_va->vm_list);
	list_del(&bo_va->vm_list);
	mutex_unlock(&bo_va->vm->mutex);
	mutex_unlock(&bo_va->vm->mutex);