Skip to content

Commit

Permalink
drm/amdgpu: fix clear_all and replace handling in the VM (v2)
Browse files Browse the repository at this point in the history
v2: assign bo_va as well

We need to put the lose ends on the invalid list because it is possible
that we need to split up huge pages for them.

Cc: stable@vger.kernel.org
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com> (v2)
Reviewed-by: David Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Junwei Zhang authored and Alex Deucher committed Jun 13, 2018
1 parent 2352939 commit 387f49e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,8 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
before->last = saddr - 1;
before->offset = tmp->offset;
before->flags = tmp->flags;
list_add(&before->list, &tmp->list);
before->bo_va = tmp->bo_va;
list_add(&before->list, &tmp->bo_va->invalids);
}

/* Remember mapping split at the end */
Expand All @@ -2133,7 +2134,8 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
after->offset = tmp->offset;
after->offset += after->start - tmp->start;
after->flags = tmp->flags;
list_add(&after->list, &tmp->list);
after->bo_va = tmp->bo_va;
list_add(&after->list, &tmp->bo_va->invalids);
}

list_del(&tmp->list);
Expand Down

0 comments on commit 387f49e

Please sign in to comment.