Use uniras generic mp1 message to enable/disable aca debug mode on mp1 v13_0.
Signed-off-by: YiPeng Chai <[email protected]> --- drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c | 15 +++++++++------ drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c b/drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c index a450e79a55ff..713c30c5e5a1 100644 --- a/drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c +++ b/drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c @@ -26,6 +26,12 @@ #include "core_status.h" #include "ras_mp1_v13_0.h" +#define MSG_DATA_LOW32(idx) (((idx) & 0xFFFFU) | BIT(16)) +#define MSG_DATA_HIGH32(idx) (((idx) & 0xFFFFU) | BIT(17)) + +#define MP1_V13_ClearMcaOnRead_UE_FLAG_MASK 0x1 +#define MP1_V13_ClearMcaOnRead_CE_POLL_MASK 0x2 + static int __send_mp1_msg32(struct ras_core_context *ras_core, enum ras_mp1_msg_id msg_id, u32 input, u32 *output) { @@ -213,13 +219,10 @@ static int mp1_v13_0_dump_bank(struct ras_core_context *ras_core, static int mp1_v13_0_set_debug_mode(struct ras_core_context *ras_core, bool enable) { - struct ras_mp1 *mp1 = &ras_core->ras_mp1; - const struct ras_mp1_sys_func *sys_func = mp1->sys_func; - - if (!sys_func || !sys_func->mp1_set_debug_mode) - return -RAS_CORE_NOT_SUPPORTED; + u32 param = enable ? 0 : + (MP1_V13_ClearMcaOnRead_UE_FLAG_MASK | MP1_V13_ClearMcaOnRead_CE_POLL_MASK); - return sys_func->mp1_set_debug_mode(ras_core, enable); + return __send_mp1_msg32(ras_core, RAS_MP1_MSG_ClearMcaOnRead, param, NULL); } diff --git a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c index 8dd4b678e13a..eb7ffa354541 100644 --- a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c +++ b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c @@ -28,6 +28,7 @@ static const enum smu_message_type ras_smu_msg_maps[RAS_MP1_MSG_MAX] = { [RAS_MP1_MSG_QueryValidMcaCount] = SMU_MSG_QueryValidMcaCount, [RAS_MP1_MSG_McaBankDumpDW] = SMU_MSG_McaBankDumpDW, + [RAS_MP1_MSG_ClearMcaOnRead] = SMU_MSG_ClearMcaOnRead, [RAS_MP1_MSG_QueryValidMcaCeCount] = SMU_MSG_QueryValidMcaCeCount, [RAS_MP1_MSG_McaBankCeDumpDW] = SMU_MSG_McaBankCeDumpDW, [RAS_MP1_MSG_GetRasTableVersion] = SMU_MSG_GetRASTableVersion, -- 2.43.0
