diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3431-drm-amdkfd-Module-option-to-disable-CRAT-table.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3431-drm-amdkfd-Module-option-to-disable-CRAT-table.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3431-drm-amdkfd-Module-option-to-disable-CRAT-table.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3431-drm-amdkfd-Module-option-to-disable-CRAT-table.patch new file mode 100644 index 00000000..d73a095e --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3431-drm-amdkfd-Module-option-to-disable-CRAT-table.patch @@ -0,0 +1,69 @@ +From 00852655a081d6f3785e7f9b947d7f01ab9b5a76 Mon Sep 17 00:00:00 2001 +From: Felix Kuehling <Felix.Kuehling@amd.com> +Date: Fri, 8 Dec 2017 23:09:03 -0500 +Subject: [PATCH 3431/4131] drm/amdkfd: Module option to disable CRAT table + +Some systems have broken CRAT tables. Add a module option to ignore +a CRAT table. + +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_crat.c | 5 +++++ + drivers/gpu/drm/amd/amdkfd/kfd_module.c | 5 +++++ + drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 6 ++++++ + 3 files changed, 16 insertions(+) + +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +index d00061b..2bc2816 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +@@ -696,6 +696,11 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size) + return -EINVAL; + } + ++ if (ignore_crat) { ++ pr_info("CRAT table disabled by module option\n"); ++ return -ENODATA; ++ } ++ + pcrat_image = kmalloc(crat_table->length, GFP_KERNEL); + if (!pcrat_image) + return -ENOMEM; +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c b/drivers/gpu/drm/amd/amdkfd/kfd_module.c +index f50e494..3ac72be 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c +@@ -69,6 +69,11 @@ module_param(send_sigterm, int, 0444); + MODULE_PARM_DESC(send_sigterm, + "Send sigterm to HSA process on unhandled exception (0 = disable, 1 = enable)"); + ++int ignore_crat; ++module_param(ignore_crat, int, 0444); ++MODULE_PARM_DESC(ignore_crat, ++ "Ignore CRAT table during KFD initialization (0 = use CRAT (default), 1 = ignore CRAT)"); ++ + static int amdkfd_init_completed; + + int kgd2kfd_init(unsigned int interface_version, +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +index f0327c2..6a48d29 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +@@ -104,6 +104,12 @@ extern int cwsr_enable; + */ + extern int send_sigterm; + ++/* ++ * Ignore CRAT table during KFD initialization, can be used to work around ++ * broken CRAT tables on some AMD systems ++ */ ++extern int ignore_crat; ++ + /** + * enum kfd_sched_policy + * +-- +2.7.4 + |