diff options
author | 2023-10-12 11:22:07 +0800 | |
---|---|---|
committer | 2023-10-20 15:11:28 -0400 | |
commit | 8096df766474b54758b268afe900ba9d7ab0cc37 (patch) | |
tree | 2aeafbb2d40b7c7bc92a299fd26b9cddcb2ea735 /drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | |
parent | drm/amdgpu: replace reset_error_count with amdgpu_ras_reset_error_count (diff) | |
download | linux-8096df766474b54758b268afe900ba9d7ab0cc37.tar.gz linux-8096df766474b54758b268afe900ba9d7ab0cc37.tar.bz2 linux-8096df766474b54758b268afe900ba9d7ab0cc37.zip |
drm/amdgpu: add set/get mca debug mode operations
Record the debug mode status in RAS.
Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index eb81efacefe2..3c83a2b8fb2c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -3311,6 +3311,27 @@ int amdgpu_ras_reset_gpu(struct amdgpu_device *adev) return 0; } +void amdgpu_ras_set_mca_debug_mode(struct amdgpu_device *adev, bool enable) +{ + struct amdgpu_ras *con = amdgpu_ras_get_context(adev); + + if (con) + con->is_mca_debug_mode = enable; +} + +bool amdgpu_ras_get_mca_debug_mode(struct amdgpu_device *adev) +{ + struct amdgpu_ras *con = amdgpu_ras_get_context(adev); + const struct amdgpu_mca_smu_funcs *mca_funcs = adev->mca.mca_funcs; + + if (!con) + return false; + + if (mca_funcs && mca_funcs->mca_set_debug_mode) + return con->is_mca_debug_mode; + else + return true; +} /* Register each ip ras block into amdgpu ras */ int amdgpu_ras_register_ras_block(struct amdgpu_device *adev, |