lkml.org 
[lkml]   [2014]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] amdkfd: Don't clear *kfd2kgd on kfd_module_init
Am 20.12.2014 um 21:46 schrieb Oded Gabbay:
> When amdkfd and radeon are compiled inside the kernel image (not as modules),
> radeon will load before amdkfd and will set *kfd2kgd to its interface
> structure. Therefore, we must not set *kfd2kgd to NULL when amdkfd is loaded
> because it will override radeon's initialization and cause kernel BUG.
>
> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>

You should probably rather fix the dependency between the two modules to
get an determined load order instead of doing such nasty workarounds.

Christian.

> ---
> drivers/gpu/drm/amd/amdkfd/kfd_module.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_module.c b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
> index 95d5af1..236562f 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c
> @@ -34,7 +34,7 @@
> #define KFD_DRIVER_MINOR 7
> #define KFD_DRIVER_PATCHLEVEL 0
>
> -const struct kfd2kgd_calls *kfd2kgd;
> +const struct kfd2kgd_calls *kfd2kgd = NULL;
> static const struct kgd2kfd_calls kgd2kfd = {
> .exit = kgd2kfd_exit,
> .probe = kgd2kfd_probe,
> @@ -84,14 +84,13 @@ EXPORT_SYMBOL(kgd2kfd_init);
>
> void kgd2kfd_exit(void)
> {
> + kfd2kgd = NULL;
> }
>
> static int __init kfd_module_init(void)
> {
> int err;
>
> - kfd2kgd = NULL;
> -
> /* Verify module parameters */
> if ((sched_policy < KFD_SCHED_POLICY_HWS) ||
> (sched_policy > KFD_SCHED_POLICY_NO_HWS)) {



\
 
 \ /
  Last update: 2014-12-21 12:41    [W:0.178 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site