aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
authorxinhui pan <xinhui.pan@amd.com>2018-10-31 02:38:28 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-03-19 16:36:50 -0400
commitc030f2e4166c3f5597c7e7a70bcd9ab383695de4 (patch)
tree59a0c88ae94e00885d84bb2524981270ecad7006 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
parentea11421391e718a173f8dae96517e76531043a5c (diff)
drm/amdgpu: add amdgpu_ras.c to support ras (v2)
add obj management. add feature control. add debugfs infrastructure. add sysfs infrastructure. add IH infrastructure. add recovery infrastructure. It is a framework. Other IPs need call amdgpu_ras_xxx function instead of psp_ras_xxx functions. v2: squash in warning fixes Signed-off-by: xinhui pan <xinhui.pan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index fa4c457914f6..1eb21981ede5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -60,6 +60,7 @@
60#include "amdgpu_pm.h" 60#include "amdgpu_pm.h"
61 61
62#include "amdgpu_xgmi.h" 62#include "amdgpu_xgmi.h"
63#include "amdgpu_ras.h"
63 64
64MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin"); 65MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin");
65MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin"); 66MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin");
@@ -1638,6 +1639,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
1638{ 1639{
1639 int i, r; 1640 int i, r;
1640 1641
1642 r = amdgpu_ras_init(adev);
1643 if (r)
1644 return r;
1645
1641 for (i = 0; i < adev->num_ip_blocks; i++) { 1646 for (i = 0; i < adev->num_ip_blocks; i++) {
1642 if (!adev->ip_blocks[i].status.valid) 1647 if (!adev->ip_blocks[i].status.valid)
1643 continue; 1648 continue;
@@ -1876,6 +1881,8 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
1876{ 1881{
1877 int i, r; 1882 int i, r;
1878 1883
1884 amdgpu_ras_pre_fini(adev);
1885
1879 if (adev->gmc.xgmi.num_physical_nodes > 1) 1886 if (adev->gmc.xgmi.num_physical_nodes > 1)
1880 amdgpu_xgmi_remove_device(adev); 1887 amdgpu_xgmi_remove_device(adev);
1881 1888
@@ -1945,6 +1952,8 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
1945 adev->ip_blocks[i].status.late_initialized = false; 1952 adev->ip_blocks[i].status.late_initialized = false;
1946 } 1953 }
1947 1954
1955 amdgpu_ras_fini(adev);
1956
1948 if (amdgpu_sriov_vf(adev)) 1957 if (amdgpu_sriov_vf(adev))
1949 if (amdgpu_virt_release_full_gpu(adev, false)) 1958 if (amdgpu_virt_release_full_gpu(adev, false))
1950 DRM_ERROR("failed to release exclusive mode on fini\n"); 1959 DRM_ERROR("failed to release exclusive mode on fini\n");