Skip to content

Commit

Permalink
drm/amdgpu: create p2p links unconditionally in dkms
Browse files Browse the repository at this point in the history
P2P needs to be enabled on old kernels without setting
CONFIG_HSA_AMD_P2P, so p2p links needs to be created
unconditionally. This also releases build option from
upstream.

Suggested-by: Ramesh Errabolu <Ramesh.Errabolu@amd.com>
Signed-off-by: Guchun Chen <guchun.chen@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
(cherry picked from commit 8be3c46)

Change-Id: I22150440c8ba16974dd0b8e1052875fbecb35961
  • Loading branch information
Guchun Chen authored and Kent Russell committed Aug 31, 2022
1 parent 28d5cc6 commit c88f99b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/gpu/drm/amd/amdkfd/kfd_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,6 @@ static int kfd_create_indirect_link_prop(struct kfd_topology_device *kdev, int g
return ret;
}

#if defined(CONFIG_HSA_AMD_P2P)
static int kfd_add_peer_prop(struct kfd_topology_device *kdev,
struct kfd_topology_device *peer, int from, int to)
{
Expand Down Expand Up @@ -1635,16 +1634,12 @@ static int kfd_add_peer_prop(struct kfd_topology_device *kdev,

return ret;
}
#endif

static int kfd_dev_create_p2p_links(void)
{
struct kfd_topology_device *dev;
struct kfd_topology_device *new_dev;
#if defined(CONFIG_HSA_AMD_P2P)
uint32_t i;
#endif
uint32_t k;
uint32_t i, k;
int ret = 0;

k = 0;
Expand All @@ -1665,7 +1660,6 @@ static int kfd_dev_create_p2p_links(void)
goto out;

/* create p2p links */
#if defined(CONFIG_HSA_AMD_P2P)
i = 0;
list_for_each_entry(dev, &topology_device_list, list) {
if (dev == new_dev)
Expand All @@ -1686,7 +1680,6 @@ static int kfd_dev_create_p2p_links(void)
next:
i++;
}
#endif

out:
return ret;
Expand Down

0 comments on commit c88f99b

Please sign in to comment.