drm/amd: Check that a system is a NUMA system before looking for SRAT
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 2 Jun 2023 12:18:06 +0000 (07:18 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 16:44:46 +0000 (12:44 -0400)
It's pointless on laptops to look for the SRAT table as these are not
NUMA.  Check the number of possible nodes is > 1 to decide whether to
look for SRAT.

Suggested-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@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_crat.c

index 950af6820153b24db59a944e7a492bf0760f2ace..3dcd8f8bc98e56aa680ad1100a02e74cb4573697 100644 (file)
@@ -2041,7 +2041,8 @@ static int kfd_fill_gpu_direct_io_link_to_cpu(int *avail_size,
        sub_type_hdr->proximity_domain_from = proximity_domain;
 
 #ifdef CONFIG_ACPI_NUMA
-       if (kdev->adev->pdev->dev.numa_node == NUMA_NO_NODE)
+       if (kdev->adev->pdev->dev.numa_node == NUMA_NO_NODE &&
+           num_possible_nodes() > 1)
                kfd_find_numa_node_in_srat(kdev);
 #endif
 #ifdef CONFIG_NUMA