diff options
author | Jonathan Kim <Jonathan.Kim@amd.com> | 2024-08-07 22:33:41 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-08-13 17:35:00 +0300 |
commit | 70f83e7706e57200edb8ffa36883b2f43d214142 (patch) | |
tree | 5187d0b70d6320cad19a59de202efa7124d2ab1f | |
parent | 9b7e697839c2745c10f63fe5fd54c9e328fa2e3b (diff) | |
download | linux-70f83e7706e57200edb8ffa36883b2f43d214142.tar.xz |
drm/amdkfd: fix partition query when setting up recommended sdma engines
When users dynamically set the partition mode through sysfs writes,
this can lead to a double lock situation where the KFD is trying to take
the partition lock when updating the recommended SDMA engines.
Have the KFD reference its saved socket device number count instead.
Also ensure we have enough SDMA xGMI engines to report the recommended
engines in the first place.
Fixes: e06b71b2313a ("drm/amdkfd: allow users to target recommended SDMA engines")
Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 40771f8752cb..27d452e50ca9 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -1286,9 +1286,8 @@ static void kfd_set_recommended_sdma_engines(struct kfd_topology_device *to_dev, struct amdgpu_device *adev = gpu->adev; int num_xgmi_nodes = adev->gmc.xgmi.num_physical_nodes; bool support_rec_eng = !amdgpu_sriov_vf(adev) && to_dev->gpu && - adev->aid_mask && num_xgmi_nodes && - (amdgpu_xcp_query_partition_mode(adev->xcp_mgr, AMDGPU_XCP_FL_NONE) == - AMDGPU_SPX_PARTITION_MODE) && + adev->aid_mask && num_xgmi_nodes && gpu->kfd->num_nodes == 1 && + kfd_get_num_xgmi_sdma_engines(gpu) >= 14 && (!(adev->flags & AMD_IS_APU) && num_xgmi_nodes == 8); if (support_rec_eng) { |