diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3432-drm-amdkfd-Ignore-ACPI-CRAT-for-non-APU-systems.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3432-drm-amdkfd-Ignore-ACPI-CRAT-for-non-APU-systems.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3432-drm-amdkfd-Ignore-ACPI-CRAT-for-non-APU-systems.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3432-drm-amdkfd-Ignore-ACPI-CRAT-for-non-APU-systems.patch new file mode 100644 index 00000000..0a440048 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3432-drm-amdkfd-Ignore-ACPI-CRAT-for-non-APU-systems.patch @@ -0,0 +1,70 @@ +From a1dcc6cf67ed36bc07c2af58bd9b0e34a355853c Mon Sep 17 00:00:00 2001 +From: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> +Date: Fri, 8 Dec 2017 23:09:04 -0500 +Subject: [PATCH 3432/4131] drm/amdkfd: Ignore ACPI CRAT for non-APU systems + +Some AMD motherboards without an APU have a broken CRAT table which +causes KFD initialization failures or incorrect information about +NUMA nodes, CPU cores or system memory. Ignore CRAT tables without +GPUs and rely on KFD's code to create a CRAT table for the CPU. + +Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> +Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> +Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com> +Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com> +--- + drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +index e7daf2c..c6a7609 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +@@ -904,6 +904,25 @@ static void kfd_add_non_crat_information(struct kfd_topology_device *kdev) + /* TODO: For GPU node, rearrange code from kfd_topology_add_device */ + } + ++/* kfd_is_acpi_crat_invalid - CRAT from ACPI is valid only for AMD APU devices. ++ * Ignore CRAT for all other devices. AMD APU is identified if both CPU ++ * and GPU cores are present. ++ * @device_list - topology device list created by parsing ACPI CRAT table. ++ * @return - TRUE if invalid, FALSE is valid. ++ */ ++static bool kfd_is_acpi_crat_invalid(struct list_head *device_list) ++{ ++ struct kfd_topology_device *dev; ++ ++ list_for_each_entry(dev, device_list, list) { ++ if (dev->node_props.cpu_cores_count && ++ dev->node_props.simd_count) ++ return false; ++ } ++ pr_info("Ignoring ACPI CRAT on non-APU system\n"); ++ return true; ++} ++ + int kfd_topology_init(void) + { + void *crat_image = NULL; +@@ -936,7 +955,7 @@ int kfd_topology_init(void) + + /* + * Get the CRAT image from the ACPI. If ACPI doesn't have one +- * create a virtual CRAT. ++ * or if ACPI CRAT is invalid create a virtual CRAT. + * NOTE: The current implementation expects all AMD APUs to have + * CRAT. If no CRAT is available, it is assumed to be a CPU + */ +@@ -945,7 +964,8 @@ int kfd_topology_init(void) + ret = kfd_parse_crat_table(crat_image, + &temp_topology_device_list, + proximity_domain); +- if (ret) { ++ if (ret || ++ kfd_is_acpi_crat_invalid(&temp_topology_device_list)) { + kfd_release_topology_device_list( + &temp_topology_device_list); + kfd_destroy_crat_image(crat_image); +-- +2.7.4 + |