diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index 1a4412e47810..fac7aa2c244f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | |||
@@ -136,11 +136,6 @@ static int amdgpu_ras_reserve_vram(struct amdgpu_device *adev, | |||
136 | static int amdgpu_ras_release_vram(struct amdgpu_device *adev, | 136 | static int amdgpu_ras_release_vram(struct amdgpu_device *adev, |
137 | struct amdgpu_bo **bo_ptr); | 137 | struct amdgpu_bo **bo_ptr); |
138 | 138 | ||
139 | static void amdgpu_ras_self_test(struct amdgpu_device *adev) | ||
140 | { | ||
141 | /* TODO */ | ||
142 | } | ||
143 | |||
144 | static ssize_t amdgpu_ras_debugfs_read(struct file *f, char __user *buf, | 139 | static ssize_t amdgpu_ras_debugfs_read(struct file *f, char __user *buf, |
145 | size_t size, loff_t *pos) | 140 | size_t size, loff_t *pos) |
146 | { | 141 | { |
@@ -689,6 +684,12 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev, | |||
689 | if (!obj) | 684 | if (!obj) |
690 | return -EINVAL; | 685 | return -EINVAL; |
691 | 686 | ||
687 | if (block_info.block_id != TA_RAS_BLOCK__UMC) { | ||
688 | DRM_INFO("%s error injection is not supported yet\n", | ||
689 | ras_block_str(info->head.block)); | ||
690 | return -EINVAL; | ||
691 | } | ||
692 | |||
692 | ret = psp_ras_trigger_error(&adev->psp, &block_info); | 693 | ret = psp_ras_trigger_error(&adev->psp, &block_info); |
693 | if (ret) | 694 | if (ret) |
694 | DRM_ERROR("RAS ERROR: inject %s error failed ret %d\n", | 695 | DRM_ERROR("RAS ERROR: inject %s error failed ret %d\n", |
@@ -1557,6 +1558,12 @@ int amdgpu_ras_init(struct amdgpu_device *adev) | |||
1557 | 1558 | ||
1558 | amdgpu_ras_check_supported(adev, &con->hw_supported, | 1559 | amdgpu_ras_check_supported(adev, &con->hw_supported, |
1559 | &con->supported); | 1560 | &con->supported); |
1561 | if (!con->hw_supported) { | ||
1562 | amdgpu_ras_set_context(adev, NULL); | ||
1563 | kfree(con); | ||
1564 | return 0; | ||
1565 | } | ||
1566 | |||
1560 | con->features = 0; | 1567 | con->features = 0; |
1561 | INIT_LIST_HEAD(&con->head); | 1568 | INIT_LIST_HEAD(&con->head); |
1562 | /* Might need get this flag from vbios. */ | 1569 | /* Might need get this flag from vbios. */ |
@@ -1570,8 +1577,6 @@ int amdgpu_ras_init(struct amdgpu_device *adev) | |||
1570 | if (amdgpu_ras_fs_init(adev)) | 1577 | if (amdgpu_ras_fs_init(adev)) |
1571 | goto fs_out; | 1578 | goto fs_out; |
1572 | 1579 | ||
1573 | amdgpu_ras_self_test(adev); | ||
1574 | |||
1575 | DRM_INFO("RAS INFO: ras initialized successfully, " | 1580 | DRM_INFO("RAS INFO: ras initialized successfully, " |
1576 | "hardware ability[%x] ras_mask[%x]\n", | 1581 | "hardware ability[%x] ras_mask[%x]\n", |
1577 | con->hw_supported, con->supported); | 1582 | con->hw_supported, con->supported); |