Skip to content

Commit

Permalink
drm/amdkfd: Module option to disable CRAT table
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felix Kuehling authored and Oded Gabbay committed Dec 9, 2017
1 parent 413e85d commit ebcfd1e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/amdkfd/kfd_crat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions drivers/gpu/drm/amd/amdkfd/kfd_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/amdkfd/kfd_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down

0 comments on commit ebcfd1e

Please sign in to comment.