Complete reset-on-init sequence before sysfs interfaces are created.
Devices get properly initiaized only after reset, and then only sysfs
interfaces should be made available.

Signed-off-by: Lijo Lazar <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 7e428e7bffd6..3bc2bc0d525d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -4856,6 +4856,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
                flush_delayed_work(&adev->delayed_init_work);
        }
 
+       if (adev->init_lvl->level == AMDGPU_INIT_LEVEL_MINIMAL_XGMI)
+               amdgpu_xgmi_reset_on_init(adev);
        /*
         * Place those sysfs registering after `late_init`. As some of those
         * operations performed in `late_init` might affect the sysfs
@@ -4889,9 +4891,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
        if (px)
                vga_switcheroo_init_domain_pm_ops(adev->dev, 
&adev->vga_pm_domain);
 
-       if (adev->init_lvl->level == AMDGPU_INIT_LEVEL_MINIMAL_XGMI)
-               amdgpu_xgmi_reset_on_init(adev);
-
        amdgpu_device_check_iommu_direct_map(adev);
 
        adev->pm_nb.notifier_call = amdgpu_device_pm_notifier;
-- 
2.49.0

Reply via email to