summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd/kfd_device.c
diff options
context:
space:
mode:
authorMukul Joshi <mukul.joshi@amd.com>2022-06-07 21:46:18 +0300
committerAlex Deucher <alexander.deucher@amd.com>2023-06-09 16:44:22 +0300
commitd1d22df174ae512c57374f517e346b608f61555c (patch)
tree6a10ba60957beeb55936e698c084e624bc6c8436 /drivers/gpu/drm/amd/amdkfd/kfd_device.c
parent1bd6dd21fcd53ac78a9018b96699ef1aa99a3e59 (diff)
downloadlinux-d1d22df174ae512c57374f517e346b608f61555c.tar.xz
drm/amdkfd: Populate memory info before adding GPU node to topology
The local memory info needs to be fetched before the GPU node is added to topology. Without this, the sysfs is incorrectly populated and the size is reported as 0. This was causing rocr tests to fail. This issue was caused because of a bad merge. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Amber Lin <Amber.Lin@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 8e5d785b8824..829e32433faf 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -743,6 +743,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
node->max_proc_per_quantum = max_proc_per_quantum;
atomic_set(&node->sram_ecc_flag, 0);
+ amdgpu_amdkfd_get_local_mem_info(kfd->adev, &kfd->local_mem_info);
+
dev_info(kfd_device, "Total number of KFD nodes to be created: %d\n",
kfd->num_nodes);
for (i = 0; i < kfd->num_nodes; i++) {
@@ -793,8 +795,6 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
if (kfd_resume_iommu(kfd))
goto kfd_resume_iommu_error;
- amdgpu_amdkfd_get_local_mem_info(kfd->adev, &kfd->local_mem_info);
-
kfd->init_complete = true;
dev_info(kfd_device, "added device %x:%x\n", kfd->adev->pdev->vendor,
kfd->adev->pdev->device);