[PATCH 03/11] drm/amdgpu: Init gfx ras block when ras is supported

Hawking Zhang Hawking.Zhang at amd.com
Mon Mar 6 02:31:52 UTC 2023


Initialize gfx ras block only when gfx ip block
supports ras features.

Signed-off-by: Hawking Zhang <Hawking.Zhang at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 9 ++++++---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c  | 9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
index 3bf697a80cf2..d7d4847e2644 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
@@ -1409,9 +1409,12 @@ static int gfx_v11_0_sw_init(void *handle)
 	if (r)
 		return r;
 
-	if (amdgpu_gfx_ras_sw_init(adev)) {
-		dev_err(adev->dev, "Failed to initialize gfx ras block!\n");
-		return -EINVAL;
+	if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX)) {
+		r = amdgpu_gfx_ras_sw_init(adev);
+		if (r) {
+			dev_err(adev->dev, "Failed to initialize gfx ras block!\n");
+			return r;
+		}
 	}
 
 	return 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index ae09fc1cfe6b..c9657e89d40e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2177,9 +2177,12 @@ static int gfx_v9_0_sw_init(void *handle)
 	if (r)
 		return r;
 
-	if (amdgpu_gfx_ras_sw_init(adev)) {
-		dev_err(adev->dev, "Failed to initialize gfx ras block!\n");
-		return -EINVAL;
+	if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX)) {
+		r = amdgpu_gfx_ras_sw_init(adev);
+		if (r) {
+			dev_err(adev->dev, "Failed to initialize gfx ras block!\n");
+			return r;
+		}
 	}
 
 	return 0;
-- 
2.17.1



More information about the amd-gfx mailing list