Skip to contentSkip to conversation

drm/amdgpu: Allow issue disable gfx ras cmd to firmware

PATCH In review Hawking Zhang 2 participants 2 messages Aug 24, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: Allow issue disable gfx ras cmd to firmware

Disable gfx ras command is needed in some use cases like live migration.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4 -3
index 378478cf9c21..7db6baa16236 100644
@@ -769,9 +769,10 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev,
 	if (!con)
 		return -EINVAL;
 
-	/* Do not enable ras feature if it is not allowed */
-	if (enable &&
-	    head->block != AMDGPU_RAS_BLOCK__GFX &&
+	/* For non-gfx ip, do not enable ras feature if it is not allowed.
+	 * For gfx ip, regardless of feature support status,
+	 * force issue enable or disable ras feature commands */
+	if (head->block != AMDGPU_RAS_BLOCK__GFX &&
 	    !amdgpu_ras_is_feature_allowed(adev, head))
 		goto out;
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

Quoted 38 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Hawking Zhang
Sent: Thursday, August 24, 2023 9:49 AM
To: [email protected]; Yang, Stanley <[email protected]>; Zhou1, Tao <[email protected]>
Cc: Zhang, Hawking <[email protected]>
Subject: [PATCH] drm/amdgpu: Allow issue disable gfx ras cmd to firmware

Disable gfx ras command is needed in some use cases like live migration.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +4 -4
index 378478cf9c21..7db6baa16236 100644
@@ -769,9 +769,10 @@ int amdgpu_ras_feature_enable(struct amdgpu_device
 *adev,
      if (!con)
              return -EINVAL;
 
-     /* Do not enable ras feature if it is not allowed */
-     if (enable &&
-         head->block != AMDGPU_RAS_BLOCK__GFX &&
+     /* For non-gfx ip, do not enable ras feature if it is not allowed.
+      * For gfx ip, regardless of feature support status,
+      * force issue enable or disable ras feature commands */
+     if (head->block != AMDGPU_RAS_BLOCK__GFX &&
          !amdgpu_ras_is_feature_allowed(adev, head))
              goto out;
 
--

2.17.1