drm/amdgpu: Move amdgpu_ras_recovery_init to after SMU ready.
authorAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Fri, 18 Oct 2019 20:15:04 +0000 (16:15 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 25 Oct 2019 20:50:10 +0000 (16:50 -0400)
For Arcturus the I2C traffic is done through SMU tables and so
we must postpone RAS recovery init to after they are ready
which is in amdgpu_device_ip_hw_init_phase2.

Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@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_ttm.c

index 46218b36dc9ed0023f8154121f21d0cf803e8cef..83d80070f0e9d57038b06d4cebf889cddf4947c8 100644 (file)
@@ -1877,6 +1877,19 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
        if (r)
                goto init_failed;
 
+       /*
+        * retired pages will be loaded from eeprom and reserved here,
+        * it should be called after amdgpu_device_ip_hw_init_phase2  since
+        * for some ASICs the RAS EEPROM code relies on SMU fully functioning
+        * for I2C communication which only true at this point.
+        * recovery_init may fail, but it can free all resources allocated by
+        * itself and its failure should not stop amdgpu init process.
+        *
+        * Note: theoretically, this should be called before all vram allocations
+        * to protect retired page from abusing
+        */
+       amdgpu_ras_recovery_init(adev);
+
        if (adev->gmc.xgmi.num_physical_nodes > 1)
                amdgpu_xgmi_add_device(adev);
        amdgpu_amdkfd_device_init(adev);
index 69e54308f080deb2b58b551fbe4d4eab54bea557..41eb2af594453f7c9734a70df040902c8527772b 100644 (file)
@@ -1802,17 +1802,6 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
                                                adev->gmc.visible_vram_size);
 #endif
 
-       /*
-        * retired pages will be loaded from eeprom and reserved here,
-        * it should be called after ttm init since new bo may be created,
-        * recovery_init may fail, but it can free all resources allocated by
-        * itself and its failure should not stop amdgpu init process.
-        *
-        * Note: theoretically, this should be called before all vram allocations
-        * to protect retired page from abusing
-        */
-       amdgpu_ras_recovery_init(adev);
-
        /*
         *The reserved vram for firmware must be pinned to the specified
         *place on the VRAM, so reserve it early.