Skip to content

Commit

Permalink
drm/amdkfd: Report XGMI IOLINKs for GFXIP9.4.3
Browse files Browse the repository at this point in the history
GFXIP 9.4.3 could be in APU or carveout mode but we cannot use the
xgmi.connected_to_cpu flag to identify the iolinks type. Use appropriate
APU or Carveout mode based condition to report xgmi connection in kfd
topology.

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Rajneesh Bhardwaj authored and Alex Deucher committed Jun 9, 2023
1 parent 13a94f3 commit b2ef2fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/amd/amdkfd/kfd_crat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,10 @@ static int kfd_fill_gpu_direct_io_link_to_cpu(int *avail_size,
/* Fill in IOLINK subtype.
* TODO: Fill-in other fields of iolink subtype
*/
if (kdev->adev->gmc.xgmi.connected_to_cpu) {
if (kdev->adev->gmc.xgmi.connected_to_cpu ||
(KFD_GC_VERSION(kdev) == IP_VERSION(9, 4, 3) &&
kdev->adev->smuio.funcs->get_pkg_type(kdev->adev) ==
AMDGPU_PKG_TYPE_APU)) {
bool ext_cpu = KFD_GC_VERSION(kdev) != IP_VERSION(9, 4, 3);
int mem_bw = 819200, weight = ext_cpu ? KFD_CRAT_XGMI_WEIGHT :
KFD_CRAT_INTRA_SOCKET_WEIGHT;
Expand Down
5 changes: 2 additions & 3 deletions drivers/gpu/drm/amd/amdkfd/kfd_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1327,9 +1327,8 @@ static void kfd_fill_iolink_non_crat_info(struct kfd_topology_device *dev)
continue;

/* Include the CPU peer in GPU hive if connected over xGMI. */
if (!peer_dev->gpu && !peer_dev->node_props.hive_id &&
dev->node_props.hive_id &&
dev->gpu->adev->gmc.xgmi.connected_to_cpu)
if (!peer_dev->gpu &&
link->iolink_type == CRAT_IOLINK_TYPE_XGMI)
peer_dev->node_props.hive_id = dev->node_props.hive_id;

list_for_each_entry(inbound_link, &peer_dev->io_link_props,
Expand Down

0 comments on commit b2ef2fd

Please sign in to comment.