Skip to content

Commit f0e0687

Browse files
erichuang22alexdeucher
authored andcommitted
drm/amdgpu: Fix a bug on flag table_freed
table_freed will be always true when mapping a memory with size bigger than 2MB. The problem is page table's entries are always existed, but existing mapping depends on page talbe's bo, so using a check of page table's bo existed will resolve the issue. Signed-off-by: Eric Huang <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent ba80900 commit f0e0687

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,9 +1619,12 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
16191619
* completely covered by the range and so potentially still in use.
16201620
*/
16211621
while (cursor.pfn < frag_start) {
1622-
amdgpu_vm_free_pts(adev, params->vm, &cursor);
1622+
/* Make sure previous mapping is freed */
1623+
if (cursor.entry->base.bo) {
1624+
params->table_freed = true;
1625+
amdgpu_vm_free_pts(adev, params->vm, &cursor);
1626+
}
16231627
amdgpu_vm_pt_next(adev, &cursor);
1624-
params->table_freed = true;
16251628
}
16261629

16271630
} else if (frag >= shift) {

0 commit comments

Comments
 (0)