Skip to contentSkip to conversation

drm/amdkfd: Check use_xgmi_p2p before reporting hive_id

PATCH In review Divya Shikre 3 participants 3 messages Mar 23, 2022 – Mar 24, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/amdkfd: Check use_xgmi_p2p before reporting hive_id

Recently introduced commit "845ebd6b7c32 drm/amdgpu: Add use_xgmi_p2p module parameter" did not update XGMI iolinks when use_xgmi_p2p is disabled. Add fix to not create XGMI iolinks in KFD topology when this parameter is disabled.

---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +2 -1
index 339e12c94cff..d5536e33b3d8 100644
@@ -536,7 +536,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 		goto kfd_doorbell_error;
 	}
 
-	kfd->hive_id = kfd->adev->gmc.xgmi.hive_id;
+	if (amdgpu_use_xgmi_p2p)
+		kfd->hive_id = kfd->adev->gmc.xgmi.hive_id;
 
 	kfd->noretry = kfd->adev->gmc.noretry;
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v2 1/1
#1 lore raw

Am 2022-03-23 um 10:20 schrieb Divya Shikre:

Quoted 6 lines

Recently introduced commit "845ebd6b7c32 drm/amdgpu: Add use_xgmi_p2p module parameter" did not update XGMI iolinks when use_xgmi_p2p is disabled. Add fix to not create XGMI iolinks in KFD topology when this parameter is disabled.

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +2 -1
index 339e12c94cff..d5536e33b3d8 100644
@@ -536,7 +536,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
  		goto kfd_doorbell_error;
  	}
 
-	kfd->hive_id = kfd->adev->gmc.xgmi.hive_id;
+	if (amdgpu_use_xgmi_p2p)
+		kfd->hive_id = kfd->adev->gmc.xgmi.hive_id;
 
  	kfd->noretry = kfd->adev->gmc.noretry;
 
#2 lore raw
In reply to Divya Shikre

Dear Divya,

Am 23.03.22 um 15:20 schrieb Divya Shikre:

Quoted 4 lines

Recently introduced commit "845ebd6b7c32 drm/amdgpu: Add use_xgmi_p2p module parameter" did not update XGMI iolinks when use_xgmi_p2p is disabled. Add fix to not create XGMI iolinks in KFD topology when this parameter is disabled.

Thank you for rerolling the patch. Please also add:

Fixes 845ebd6b7c32 ("drm/amdgpu: Add use_xgmi_p2p module parameter")
Quoted 10 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_device.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_device.c +0 -0
index 339e12c94cff..d5536e33b3d8 100644

drivers/gpu/drm/amd/amdkfd/kfd_device.c bool kgd2kfd_device_init(struct kfd_dev *kfd, · line 543

Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_device.c +2 -1
@@ -536,7 +536,8 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
  		goto kfd_doorbell_error;
  	}
 
-	kfd->hive_id = kfd->adev->gmc.xgmi.hive_id;
+	if (amdgpu_use_xgmi_p2p)
+		kfd->hive_id = kfd->adev->gmc.xgmi.hive_id;
 
  	kfd->noretry = kfd->adev->gmc.noretry;
 

The rest looks good.

Kind regards,

Paul