Hi Christian,
You can reproduce this issue by allocate CSA buffer in baremetal and map them to reserved VM address.
Please see the attached patch.
Best Regards Rex
From: Christian König <ckoenig.leichtzumerken@xxxxxxxxx>
Sent: Tuesday, October 23, 2018 5:01 PM To: Zhu, Rex; Zhang, Jerry; amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Deucher, Alexander; Koenig, Christian Subject: Re: [PATCH] drm/amdgpu: Fix amdgpu_vm_alloc_pts failed Hi guys,
yeah the root PD doesn't necessarily have a power of two entries. But what exactly was the problem with the original code? Why does 0xffffffff doesn't work? The only possible explanation I can see is that somebody tried to use an address which is above max_pfn, or how did that trigger? Thanks, Christian. Am 23.10.18 um 07:42 schrieb Zhu, Rex:
|
From a68c029e2bc5f60fd26d1b0705fee2be80b6f604 Mon Sep 17 00:00:00 2001 From: Rex Zhu <Rex.Zhu@xxxxxxx> Date: Tue, 23 Oct 2018 17:07:12 +0800 Subject: [PATCH] debug: create and map csa buffer --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 450b0b7..e0d46b9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1658,7 +1658,7 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) adev->ip_blocks[i].status.hw = true; /* right after GMC hw init, we create CSA */ - if (amdgpu_sriov_vf(adev)) { +// if (amdgpu_sriov_vf(adev)) { r = amdgpu_allocate_static_csa(adev, &adev->virt.csa_obj, AMDGPU_GEM_DOMAIN_VRAM, AMDGPU_CSA_SIZE); @@ -1666,7 +1666,7 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) DRM_ERROR("allocate CSA failed %d\n", r); return r; } - } +// } } } diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index f2ef9a1..b332262 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -977,13 +977,13 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) goto error_vm; } - if (amdgpu_sriov_vf(adev)) { +// if (amdgpu_sriov_vf(adev)) { uint64_t csa_addr = amdgpu_csa_vaddr(adev, 1) & AMDGPU_GMC_HOLE_MASK; r = amdgpu_map_static_csa(adev, &fpriv->vm, adev->virt.csa_obj, &fpriv->csa_va, csa_addr, AMDGPU_CSA_SIZE); if (r) goto error_vm; - } +// } mutex_init(&fpriv->bo_list_lock); idr_init(&fpriv->bo_list_handles); @@ -1043,13 +1043,13 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, amdgpu_vm_bo_rmv(adev, fpriv->prt_va); - if (amdgpu_sriov_vf(adev)) { +// if (amdgpu_sriov_vf(adev)) { /* TODO: how to handle reserve failure */ BUG_ON(amdgpu_bo_reserve(adev->virt.csa_obj, true)); amdgpu_vm_bo_rmv(adev, fpriv->csa_va); fpriv->csa_va = NULL; amdgpu_bo_unreserve(adev->virt.csa_obj); - } +// } pasid = fpriv->vm.pasid; pd = amdgpu_bo_ref(fpriv->vm.root.base.bo); -- 1.9.1
_______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx