<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 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></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> Quan, Evan <Evan.Quan@amd.com><br>
<b>Sent:</b> Tuesday, November 5, 2019 5:18 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Quan, Evan <Evan.Quan@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu: register gpu instance before fan boost feature enablment</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Otherwise, the feature enablement will be skipped due to wrong count.<br>
Caused by "drm/amdgpu: fix a race in GPU reset with IB test (v2)".<br>
<br>
Change-Id: Id576090d7ce7645a5c98ac160e0af730a51526b0<br>
Signed-off-by: Evan Quan <evan.quan@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 -<br>
2 files changed, 7 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
index 2d72d206cead..02ccadbfd89f 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -3087,6 +3087,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,<br>
DRM_INFO("amdgpu: acceleration disabled, skipping benchmarks\n");<br>
}<br>
<br>
+ /*<br>
+ * Register gpu instance before amdgpu_device_enable_mgpu_fan_boost.<br>
+ * Otherwise the mgpu fan boost feature will be skipped due to the<br>
+ * gpu instance is counted less.<br>
+ */<br>
+ amdgpu_register_gpu_instance(adev);<br>
+<br>
/* enable clockgating, etc. after ib tests, etc. since some blocks require<br>
* explicit gating rather than handling it automatically.<br>
*/<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
index 688bb4abccf5..cbd4a5709470 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c<br>
@@ -204,7 +204,6 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)<br>
pm_runtime_put_autosuspend(dev->dev);<br>
}<br>
<br>
- amdgpu_register_gpu_instance(adev);<br>
out:<br>
if (r) {<br>
/* balance pm_runtime_get_sync in amdgpu_driver_unload_kms */<br>
-- <br>
2.23.0<br>
<br>
</div>
</span></font></div>
</body>
</html>