Reviewed-by: Alex Deucher <[email protected]>
________________________________
From: Quan, Evan <[email protected]>
Sent: Tuesday, November 5, 2019 5:18 AM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Quan, Evan 
<[email protected]>
Subject: [PATCH] drm/amdgpu: register gpu instance before fan boost feature 
enablment

Otherwise, the feature enablement will be skipped due to wrong count.
Caused by "drm/amdgpu: fix a race in GPU reset with IB test (v2)".

Change-Id: Id576090d7ce7645a5c98ac160e0af730a51526b0
Signed-off-by: Evan Quan <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 7 +++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c    | 1 -
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 2d72d206cead..02ccadbfd89f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3087,6 +3087,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
                         DRM_INFO("amdgpu: acceleration disabled, skipping 
benchmarks\n");
         }

+       /*
+        * Register gpu instance before amdgpu_device_enable_mgpu_fan_boost.
+        * Otherwise the mgpu fan boost feature will be skipped due to the
+        * gpu instance is counted less.
+        */
+       amdgpu_register_gpu_instance(adev);
+
         /* enable clockgating, etc. after ib tests, etc. since some blocks 
require
          * explicit gating rather than handling it automatically.
          */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 688bb4abccf5..cbd4a5709470 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -204,7 +204,6 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned 
long flags)
                 pm_runtime_put_autosuspend(dev->dev);
         }

-       amdgpu_register_gpu_instance(adev);
 out:
         if (r) {
                 /* balance pm_runtime_get_sync in amdgpu_driver_unload_kms */
--
2.23.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to