Commit 26093ce1 authored by Stanley.Yang's avatar Stanley.Yang Committed by Alex Deucher

drm/amdgpu: Only send ras feature for gfx block

GFX is the only IP block that RAS TA needs to program
the hardware when receiving enable_feature command.

Changed from V1:
    remove amdgpu_ras_need_send_ras_feature inline function,
    use GFX RAS block check directly.
Signed-off-by: default avatarStanley.Yang <Stanley.Yang@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent cbe07c98
...@@ -717,6 +717,7 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, ...@@ -717,6 +717,7 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev,
if (!con) if (!con)
return -EINVAL; return -EINVAL;
if (head->block == AMDGPU_RAS_BLOCK__GFX) {
info = kzalloc(sizeof(union ta_ras_cmd_input), GFP_KERNEL); info = kzalloc(sizeof(union ta_ras_cmd_input), GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
...@@ -732,12 +733,14 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, ...@@ -732,12 +733,14 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev,
.error_type = amdgpu_ras_error_to_ta(head->type), .error_type = amdgpu_ras_error_to_ta(head->type),
}; };
} }
}
/* Do not enable if it is not allowed. */ /* Do not enable if it is not allowed. */
WARN_ON(enable && !amdgpu_ras_is_feature_allowed(adev, head)); WARN_ON(enable && !amdgpu_ras_is_feature_allowed(adev, head));
/* Only enable ras feature operation handle on host side */ /* Only enable ras feature operation handle on host side */
if (!amdgpu_sriov_vf(adev) && if (head->block == AMDGPU_RAS_BLOCK__GFX &&
!amdgpu_sriov_vf(adev) &&
!amdgpu_ras_intr_triggered()) { !amdgpu_ras_intr_triggered()) {
ret = psp_ras_enable_features(&adev->psp, info, enable); ret = psp_ras_enable_features(&adev->psp, info, enable);
if (ret) { if (ret) {
...@@ -753,6 +756,7 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, ...@@ -753,6 +756,7 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev,
__amdgpu_ras_feature_enable(adev, head, enable); __amdgpu_ras_feature_enable(adev, head, enable);
ret = 0; ret = 0;
out: out:
if (head->block == AMDGPU_RAS_BLOCK__GFX)
kfree(info); kfree(info);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment