]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: register gpu instance before fan boost feature enablment
authorEvan Quan <evan.quan@amd.com>
Tue, 5 Nov 2019 10:13:49 +0000 (18:13 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Nov 2019 21:27:47 +0000 (16:27 -0500)
Otherwise, the feature enablement will be skipped due to wrong count.

Fixes: ab248e9b88a81df ("drm/amdgpu: fix a race in GPU reset with IB test (v2)")
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

index 40ff06b99e5bd3a6abf139b69e88fd362668e1fc..7b33058c4e03355bef8c9e963345338e51e016b0 100644 (file)
@@ -3029,6 +3029,13 @@ fence_driver_init:
                        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.
         */
index 137a8573d5569ca58ab9445438d37ece65c5111f..82c46c4faaad5761b3f03ea3fbf41771800b16be 100644 (file)
@@ -190,7 +190,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 */