aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@amd.com>2014-12-22 04:19:23 -0500
committerOded Gabbay <oded.gabbay@amd.com>2014-12-29 07:46:00 -0500
commit38c2adfb00db045a876dd667040abc01b788ad61 (patch)
tree064ba3938f0fd90a51b2d3dbdd3954c5ed57cec8 /drivers/gpu
parent68d0cb49f8db5ddce7cb6cbd7781e232c42c472a (diff)
drm/radeon: Init amdkfd only if it was compiled
This patch changes the radeon_kfd_init(), which is used to initialize the interface between radeon and amdkfd, so the interface will be initialized only if amdkfd was build, either as module or inside the kernel image. In the modules case, the symbol_request() will be used (same as old code). In the in-image compilation case, a direct call to kgd2kfd_init() will be done. For other cases, radeon_kfd_init() will just return false. This patch is necessary because in case of the following specific configuration: kernel 32-bit, no modules support, random kernel base and no hibernation, the symbol_request() doesn't work as expected - it doesn't return NULL if the symbol doesn't exists - which makes the kernel panic. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_kfd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c
index 242fd8b1b221..d3e78b4a6b75 100644
--- a/drivers/gpu/drm/radeon/radeon_kfd.c
+++ b/drivers/gpu/drm/radeon/radeon_kfd.c
@@ -101,6 +101,7 @@ static const struct kgd2kfd_calls *kgd2kfd;
101 101
102bool radeon_kfd_init(void) 102bool radeon_kfd_init(void)
103{ 103{
104#if defined(CONFIG_HSA_AMD_MODULE)
104 bool (*kgd2kfd_init_p)(unsigned, const struct kfd2kgd_calls*, 105 bool (*kgd2kfd_init_p)(unsigned, const struct kfd2kgd_calls*,
105 const struct kgd2kfd_calls**); 106 const struct kgd2kfd_calls**);
106 107
@@ -117,6 +118,17 @@ bool radeon_kfd_init(void)
117 } 118 }
118 119
119 return true; 120 return true;
121#elif defined(CONFIG_HSA_AMD)
122 if (!kgd2kfd_init(KFD_INTERFACE_VERSION, &kfd2kgd, &kgd2kfd)) {
123 kgd2kfd = NULL;
124
125 return false;
126 }
127
128 return true;
129#else
130 return false;
131#endif
120} 132}
121 133
122void radeon_kfd_fini(void) 134void radeon_kfd_fini(void)