Change-Id: I3e7eabc3576af4265f8cf58187ebe6cc62503ac6 Signed-off-by: Chunming Zhou <David1.Zhou at amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 9721552..8ccc6a4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1462,8 +1462,8 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev, memset(parent->entries, 0 , sizeof(struct amdgpu_vm_pt)); } - from = saddr >> shift; - to = eaddr >> shift; + from = (saddr >> shift) % amdgpu_vm_num_entries(adev, level); + to = (eaddr >> shift) % amdgpu_vm_num_entries(adev, level); if (to > parent->last_entry_used) parent->last_entry_used = to; -- 1.9.1