<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Felix Kuehling <Felix.Kuehling@amd.com><br>
<b>Sent:</b> Friday, August 31, 2018 5:34:42 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Kuehling, Felix<br>
<b>Subject:</b> [PATCH 1/1] drm/amdgpu: Clean up KFD init and fini</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Only initialize KFD once by moving amdgpu_amdkfd_init from<br>
amdgpu_pci_probe to amdgpu_init. This fixes kernel oopses and hangs<br>
when booting multi-GPU systems.<br>
<br>
Also removed some vestiges of KFD being its own module.<br>
<br>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 5 +----<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 ++++--------<br>
2 files changed, 5 insertions(+), 12 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c<br>
index 8bee9a0..a79df2a 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c<br>
@@ -28,7 +28,6 @@<br>
#include <linux/module.h><br>
<br>
const struct kgd2kfd_calls *kgd2kfd;<br>
-bool (*kgd2kfd_init_p)(unsigned int, const struct kgd2kfd_calls**);<br>
<br>
static const unsigned int compute_vmid_bitmap = 0xFF00;<br>
<br>
@@ -51,10 +50,8 @@ int amdgpu_amdkfd_init(void)<br>
<br>
void amdgpu_amdkfd_fini(void)<br>
{<br>
- if (kgd2kfd) {<br>
+ if (kgd2kfd)<br>
kgd2kfd->exit();<br>
- symbol_put(kgd2kfd_init);<br>
- }<br>
}<br>
<br>
void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev)<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
index a96ceff..b5c2ccb 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
@@ -922,14 +922,6 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,<br>
return -ENODEV;<br>
}<br>
<br>
- /*<br>
- * Initialize amdkfd before starting radeon. If it was not loaded yet,<br>
- * defer radeon probing<br>
- */<br>
- ret = amdgpu_amdkfd_init();<br>
- if (ret == -EPROBE_DEFER)<br>
- return ret;<br>
-<br>
/* Get rid of things like offb */<br>
ret = amdgpu_kick_out_firmware_fb(pdev);<br>
if (ret)<br>
@@ -1274,6 +1266,10 @@ static int __init amdgpu_init(void)<br>
pdriver = &amdgpu_kms_pci_driver;<br>
driver->num_ioctls = amdgpu_max_kms_ioctl;<br>
amdgpu_register_atpx_handler();<br>
+<br>
+ /* Ignore KFD init failures. Normal when CONFIG_HSA_AMD is not set. */<br>
+ amdgpu_amdkfd_init();<br>
+<br>
/* let modprobe override vga console setting */<br>
return pci_register_driver(pdriver);<br>
<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>