[PATCH] drm/amdgpu: improve RAS ACA to avoid binding unsupported RAS blocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Improve RAS ACA code to avoid binding unsupported RAS blocks,
thus avoiding invalid ACA Bank to ACA Bank cache,
and also reduce system memory consumption.

Signed-off-by: Yang Wang <kevinyang.wang@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
index db081618e85c..54426e04c7bf 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
@@ -1302,6 +1302,9 @@ int amdgpu_ras_bind_aca(struct amdgpu_device *adev, enum amdgpu_ras_block blk,
 	if (adev->in_suspend || amdgpu_reset_in_recovery(adev))
 		return 0;
 
+	if (!amdgpu_ras_is_supported(adev, blk))
+		return 0;
+
 	obj = get_ras_manager(adev, blk);
 	if (!obj)
 		return -EINVAL;
@@ -1313,6 +1316,9 @@ int amdgpu_ras_unbind_aca(struct amdgpu_device *adev, enum amdgpu_ras_block blk)
 {
 	struct ras_manager *obj;
 
+	if (!amdgpu_ras_is_supported(adev, blk))
+		return 0;
+
 	obj = get_ras_manager(adev, blk);
 	if (!obj)
 		return -EINVAL;
-- 
2.34.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux