aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2017-12-08 23:09:03 -0500
committerOded Gabbay <oded.gabbay@gmail.com>2017-12-08 23:09:03 -0500
commitebcfd1e276207e4436a6d15a81f7e151a103565c (patch)
treeed164e3f9eabe3ae94b52f3524c4dba976cc520b
parent413e85d5d38f9b000561b6b9adf4182803b50af0 (diff)
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>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_crat.c5
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_module.c5
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_priv.h6
3 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
index d00061b75193..2bc2816767a7 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)
696 return -EINVAL; 696 return -EINVAL;
697 } 697 }
698 698
699 if (ignore_crat) {
700 pr_info("CRAT table disabled by module option\n");
701 return -ENODATA;
702 }
703
699 pcrat_image = kmalloc(crat_table->length, GFP_KERNEL); 704 pcrat_image = kmalloc(crat_table->length, GFP_KERNEL);
700 if (!pcrat_image) 705 if (!pcrat_image)
701 return -ENOMEM; 706 return -ENOMEM;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
index f50e4949a2ed..3ac72bed4f31 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);
69MODULE_PARM_DESC(send_sigterm, 69MODULE_PARM_DESC(send_sigterm,
70 "Send sigterm to HSA process on unhandled exception (0 = disable, 1 = enable)"); 70 "Send sigterm to HSA process on unhandled exception (0 = disable, 1 = enable)");
71 71
72int ignore_crat;
73module_param(ignore_crat, int, 0444);
74MODULE_PARM_DESC(ignore_crat,
75 "Ignore CRAT table during KFD initialization (0 = use CRAT (default), 1 = ignore CRAT)");
76
72static int amdkfd_init_completed; 77static int amdkfd_init_completed;
73 78
74int kgd2kfd_init(unsigned int interface_version, 79int 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 f0327c219879..6a48d29ada47 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;
104 */ 104 */
105extern int send_sigterm; 105extern int send_sigterm;
106 106
107/*
108 * Ignore CRAT table during KFD initialization, can be used to work around
109 * broken CRAT tables on some AMD systems
110 */
111extern int ignore_crat;
112
107/** 113/**
108 * enum kfd_sched_policy 114 * enum kfd_sched_policy
109 * 115 *