Pstate settings should be performed after all device of the
XGMI setup get initialized.

Change-Id: I5c4b3f79fbd60a5ccfb4dc6f94d9e1db6faec694
Signed-off-by: Evan Quan <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 08e9d85d22f4..93720c4790f8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2081,9 +2081,6 @@ static int amdgpu_device_ip_late_init(struct 
amdgpu_device *adev)
        if (r)
                DRM_ERROR("enable mgpu fan boost failed (%d).\n", r);
 
-       /* set to low pstate by default */
-       amdgpu_xgmi_set_pstate(adev, 0);
-
        return 0;
 }
 
@@ -2195,6 +2192,18 @@ static void 
amdgpu_device_delayed_init_work_handler(struct work_struct *work)
        r = amdgpu_ib_ring_tests(adev);
        if (r)
                DRM_ERROR("ib ring test failed (%d).\n", r);
+
+       /*
+        * set to low pstate by default
+        * This should be performed after all devices from
+        * XGMI finish their initializations. Thus it's moved
+        * to here.
+        * The time delay is 2S. TODO: confirm whether that
+        * is enough for all possible XGMI setups.
+        */
+       r = amdgpu_xgmi_set_pstate(adev, 0);
+       if (r)
+               DRM_ERROR("pstate setting failed (%d).\n", r);
 }
 
 static void amdgpu_device_delay_enable_gfx_off(struct work_struct *work)
-- 
2.23.0

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

Reply via email to