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);
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.