diff options
author | Hawking Zhang <Hawking.Zhang@amd.com> | 2019-09-03 06:02:07 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-09-13 17:41:49 -0500 |
commit | bfcf62c2a5a930423c043b363de2e5aef7146f39 (patch) | |
tree | 04ae5dec182922f8c26507980828c7cab0dd6849 /drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | |
parent | 6caeee7a708c018e4922510954c1e5fb5364ad0b (diff) | |
download | lwn-bfcf62c2a5a930423c043b363de2e5aef7146f39.tar.gz lwn-bfcf62c2a5a930423c043b363de2e5aef7146f39.zip |
drm/amdgpu/sdma: switch to amdgpu_sdma_ras_late_init helper function
amdgpu_sdma_ras_late_init is used to init sdma specfic
ras debugfs/sysfs node and sdma specific interrupt handler.
It can be shared among sdma generations
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index 5e759a877fdf..c3635c477bd1 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c @@ -1699,48 +1699,8 @@ static int sdma_v4_0_late_init(void *handle) struct ras_ih_if ih_info = { .cb = sdma_v4_0_process_ras_data_cb, }; - struct ras_fs_if fs_info = { - .sysfs_name = "sdma_err_count", - .debugfs_name = "sdma_err_inject", - }; - int r, i; - - if (!adev->sdma.ras_if) { - adev->sdma.ras_if = kmalloc(sizeof(struct ras_common_if), GFP_KERNEL); - if (!adev->sdma.ras_if) - return -ENOMEM; - adev->sdma.ras_if->block = AMDGPU_RAS_BLOCK__SDMA; - adev->sdma.ras_if->type = AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE; - adev->sdma.ras_if->sub_block_index = 0; - strcpy(adev->sdma.ras_if->name, "sdma"); - } - fs_info.head = ih_info.head = *adev->sdma.ras_if; - - r = amdgpu_ras_late_init(adev, adev->sdma.ras_if, - &fs_info, &ih_info); - if (r) - goto free; - - if (amdgpu_ras_is_supported(adev, adev->sdma.ras_if->block)) { - for (i = 0; i < adev->sdma.num_instances; i++) { - r = amdgpu_irq_get(adev, &adev->sdma.ecc_irq, - AMDGPU_SDMA_IRQ_INSTANCE0 + i); - if (r) - goto late_fini; - } - } else { - /* free sdma ras_if if sdma ras is not supported */ - r = 0; - goto free; - } - return 0; -late_fini: - amdgpu_ras_late_fini(adev, adev->sdma.ras_if, &ih_info); -free: - kfree(adev->sdma.ras_if); - adev->sdma.ras_if = NULL; - return r; + return amdgpu_sdma_ras_late_init(adev, &ih_info); } static int sdma_v4_0_sw_init(void *handle) |