aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2018-11-24 23:25:04 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-11-28 14:38:48 -0500
commit1954db153d181e32017804e353e09ffe669c000b (patch)
treecb868a271f83fb6157b3f2b7fed0411c2d2f8294 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parent9ce2b991f7ea45b913c3c391bb652dd95dd78876 (diff)
drm/amdgpu: Avoid endless loop in GPUVM fragment processing
Don't bounce back to the root level for fragment processing, because huge pages are not supported at that level. This is unlikely to happen with the default VM size on Vega, but can be exposed by limiting the VM size with the amdgpu.vm_size module parameter. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index be3e360b0450..0877ff9a9594 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1656,9 +1656,11 @@ static int amdgpu_vm_update_ptes(struct amdgpu_pte_update_params *params,
1656 if (!amdgpu_vm_pt_descendant(adev, &cursor)) 1656 if (!amdgpu_vm_pt_descendant(adev, &cursor))
1657 return -ENOENT; 1657 return -ENOENT;
1658 continue; 1658 continue;
1659 } else if (frag >= parent_shift) { 1659 } else if (frag >= parent_shift &&
1660 cursor.level - 1 != adev->vm_manager.root_level) {
1660 /* If the fragment size is even larger than the parent 1661 /* If the fragment size is even larger than the parent
1661 * shift we should go up one level and check it again. 1662 * shift we should go up one level and check it again
1663 * unless one level up is the root level.
1662 */ 1664 */
1663 if (!amdgpu_vm_pt_ancestor(&cursor)) 1665 if (!amdgpu_vm_pt_ancestor(&cursor))
1664 return -ENOENT; 1666 return -ENOENT;