diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/1463-drm-amdkfd-Ignore-CPU-Node-if-no-cores-are-online.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.14.71/1463-drm-amdkfd-Ignore-CPU-Node-if-no-cores-are-online.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/1463-drm-amdkfd-Ignore-CPU-Node-if-no-cores-are-online.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/1463-drm-amdkfd-Ignore-CPU-Node-if-no-cores-are-online.patch new file mode 100644 index 00000000..5760fa52 --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/1463-drm-amdkfd-Ignore-CPU-Node-if-no-cores-are-online.patch @@ -0,0 +1,52 @@ +From fee0dc5ed45bb3bf3329b5aaf400c997419bea4a Mon Sep 17 00:00:00 2001 +From: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> +Date: Wed, 29 Jun 2016 17:57:10 -0400 +Subject: [PATCH 1463/4131] drm/amdkfd: Ignore CPU Node if no cores are online + +Change-Id: Ib5a6c3b291fe18faeaada29973fc4d1270486fda +Signed-off-by: Jay Cornwall <jay.cornwall@amd.com> +Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> +--- + drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 3 +++ + drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 8 +++++--- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +index 2583ab1..e4d7375 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +@@ -822,6 +822,9 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) + sub_type_hdr = (struct crat_subtype_generic *)(crat_table+1); + + for_each_online_node(numa_node_id) { ++ if (kfd_numa_node_to_apic_id(numa_node_id) == -1) ++ continue; ++ + /* Fill in Subtype: Compute Unit */ + ret = kfd_fill_cu_for_cpu(numa_node_id, &avail_size, + crat_table->num_domains, +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +index 0e1305b..5ba4179 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +@@ -1194,12 +1194,14 @@ int kfd_topology_enum_kfd_devices(uint8_t idx, struct kfd_dev **kdev) + static int kfd_cpumask_to_apic_id(const struct cpumask *cpumask) + { + const struct cpuinfo_x86 *cpuinfo; +- int first_cpu_of_nuna_node; ++ int first_cpu_of_numa_node; + + if (cpumask == NULL || cpumask == cpu_none_mask) + return -1; +- first_cpu_of_nuna_node = cpumask_first(cpumask); +- cpuinfo = &cpu_data(first_cpu_of_nuna_node); ++ first_cpu_of_numa_node = cpumask_first(cpumask); ++ if (first_cpu_of_numa_node >= nr_cpu_ids) ++ return -1; ++ cpuinfo = &cpu_data(first_cpu_of_numa_node); + + return cpuinfo->apicid; + } +-- +2.7.4 + |