drm/amdkfd: simplify cpu hive assignment
authorJonathan Kim <jonathan.kim@amd.com>
Fri, 13 May 2022 00:38:18 +0000 (20:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 26 May 2022 18:56:31 +0000 (14:56 -0400)
commita0af5dbdc914eae667fba8322cb02afc4ce3967b
treec434c7e12e9523cc3166998ba45fcdfefb01bc9a
parent2c2dd0555fd6bcea6d43ab3224c6af718b910e22
drm/amdkfd: simplify cpu hive assignment

CPU hive assignment currently assumes when a GPU hive is connected_to_cpu,
there is only one hive in the system.

Only assign CPUs to the hive if they are explicitly directly connected to
the GPU hive to get rid of the need for this assumption.

It's more efficient to do this when querying IO links since other non-CRAT
info has to be filled in anyways.  Also, stop re-assigning the
same CPU to the same GPU hive if it has already been done before.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c