Initialize sdma ras block only when sdma ip block supports ras features. Signed-off-by: Hawking Zhang <Hawking.Zhang@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 9 ++++++--- drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c | 8 ++++++++ drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 9 ++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index b5affba22156..805c6605b43a 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c @@ -1851,9 +1851,12 @@ static int sdma_v4_0_sw_init(void *handle) } } - if (amdgpu_sdma_ras_sw_init(adev)) { - dev_err(adev->dev, "Failed to initialize sdma ras block!\n"); - return -EINVAL; + if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__SDMA)) { + r = amdgpu_sdma_ras_sw_init(adev); + if (r) { + dev_err(adev->dev, "Failed to initialize sdma ras block!\n"); + return r; + } } return r; diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c index 1b04700a4d55..9bf221cc07b0 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c @@ -1338,6 +1338,14 @@ static int sdma_v4_4_2_sw_init(void *handle) } } + if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__SDMA)) { + r = amdgpu_sdma_ras_sw_init(adev); + if (r) { + dev_err(adev->dev, "Failed to initialize sdma ras block!\n"); + return r; + } + } + return r; } diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c index 40e6b22daa22..4613d73c2535 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c @@ -1281,9 +1281,12 @@ static int sdma_v6_0_sw_init(void *handle) return r; } - if (amdgpu_sdma_ras_sw_init(adev)) { - dev_err(adev->dev, "Failed to initialize sdma ras block!\n"); - return -EINVAL; + if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__SDMA)) { + r = amdgpu_sdma_ras_sw_init(adev); + if (r) { + dev_err(adev->dev, "Failed to initialize sdma ras block!\n"); + return r; + } } return r; -- 2.17.1