drm/amd/ras: retrieve ras error info via common interface and message for mp1_v13_0
Subsystems (2)
PATCH 1/6 drm/amd/ras: retrieve ras error info via common interface and message for mp1_v13_0
Retrieve ras error info via common interface and message for mp1_v13_0.
--- drivers/gpu/drm/amd/ras/core/ras_mp1.h | 8 +++ drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c | 61 +++++++++++++------ .../gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c | 4 ++ 3 files changed, 53 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/ras/core/ras_mp1.h +8 -0
@@ -25,7 +25,15 @@#define __RAS_MP1_H__#include "ras.h" +#define MAX_UE_BANKS_PER_QUERY 12 +#define MAX_CE_BANKS_PER_QUERY 12 +enum ras_mp1_msg_id { + RAS_MP1_MSG_QueryValidMcaCount, + RAS_MP1_MSG_McaBankDumpDW, + RAS_MP1_MSG_ClearMcaOnRead, + RAS_MP1_MSG_QueryValidMcaCeCount, + RAS_MP1_MSG_McaBankCeDumpDW, RAS_MP1_MSG_GetRasTableVersion, RAS_MP1_MSG_GetRmaStatus, RAS_MP1_MSG_GetBadPageCount,
drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c +41 -20
101 lines not on this page · raw message
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c +4 -0
@@ -26,6 +26,10 @@#include "ras.h" 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_QueryValidMcaCeCount] = SMU_MSG_QueryValidMcaCeCount, + [RAS_MP1_MSG_McaBankCeDumpDW] = SMU_MSG_McaBankCeDumpDW, [RAS_MP1_MSG_GetRasTableVersion] = SMU_MSG_GetRASTableVersion, [RAS_MP1_MSG_GetBadPageCount] = SMU_MSG_GetBadPageCount, [RAS_MP1_MSG_GetBadPageMcaAddr] = SMU_MSG_GetBadPageMcaAddr,
Signature · 1 line
2.43.0
PATCH 2/6 drm/amd/ras: add pmfw-managed eeprom support for mp1_v13_0
Add pmfw-managed eeprom support for mp1_v13_0.
--- drivers/gpu/drm/amd/ras/core/ras_mp1.h | 26 +++++- drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c | 89 ++++++++++++++++++++ 2 files changed, 112 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/ras/core/ras_mp1.h +23 -3
@@ -48,9 +48,29 @@ enum ras_mp1_msg_id { };struct eeprom_err_record { -u64 timestamp; -u64 mca_addr; -u64 ipid; +union { +struct { +u32 timestamp_low; +u32 timestamp_high; + }; +u64 timestamp; + }; + +union { +struct { +u32 mca_addr_low; +u32 mca_addr_high; + }; +u64 mca_addr; + }; + +union { +struct { +u32 ipid_low; +u32 ipid_high; + }; +u64 ipid; + }; };enum ras_err_type ;
drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c +89 -0
99 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 3/6 drm/amd/ras: support aca debug mode for mp1 v13_0
In reply to YiPeng ChaiUse uniras generic mp1 message to enable/disable
aca debug mode on mp1 v13_0.
--- 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(-)
drivers/gpu/drm/amd/ras/core/ras_mp1_v13_0.c +9 -6
@@ -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 ); }
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c +1 -0
@@ -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,
Signature · 1 line
2.43.0
PATCH 4/6 drm/amd/ras: add MP1 RAS feature status query
In reply to YiPeng ChaiAdd a generic MP1 interface to query the status of RAS-related SMU features, including the PMFW EEPROM feature.
--- drivers/gpu/drm/amd/ras/core/ras.h | 2 ++ drivers/gpu/drm/amd/ras/core/ras_mp1.c | 13 +++++++++ drivers/gpu/drm/amd/ras/core/ras_mp1.h | 7 +++++ .../gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c | 28 +++++++++++++++++++ 4 files changed, 50 insertions(+)
drivers/gpu/drm/amd/ras/core/ras.h +2 -0
@@ -216,6 +216,8 @@ struct ras_mp1_sys_func {int (*mp1_set_debug_mode)(struct ras_core_context *ras_core,bool enable);int (*mp1_send_ras_msg)(struct ras_core_context *ras_core,u32 msg_id,u32 *params,u32 num_params,u32 *read_args,u32 num_read_args); +int (*check_ras_feature_status)(struct ras_core_context *ras_core, +enum ras_mp1_feature_id feature_id,u32 *status); };struct ras_eeprom_param_config {
drivers/gpu/drm/amd/ras/core/ras_mp1.c +13 -0
@@ -183,6 +183,19 @@ int ras_mp1_set_debug_mode(struct ras_core_context *ras_core, bool enable)return mp1->ip_func->set_debug_mode (ras_core, enable); } +int ras_mp1_check_feature_status (struct ras_core_context *ras_core, +enum ras_mp1_feature_id feature_id,u32 *status) +{ +struct ras_mp1 *mp1 = &ras_core->ras_mp1; + +if (!mp1->sys_func || + !mp1->sys_func->check_ras_feature_status) +return -EOPNOTSUPP ; + +return mp1->sys_func->check_ras_feature_status (ras_core, + feature_id, status); +} +int ras_mp1_sw_init (struct ras_core_context *ras_core) {struct ras_mp1 *mp1 = &ras_core->ras_mp1;
drivers/gpu/drm/amd/ras/core/ras_mp1.h +7 -0
@@ -28,6 +28,11 @@#define MAX_UE_BANKS_PER_QUERY 12#define MAX_CE_BANKS_PER_QUERY 12 +enum ras_mp1_feature_id { +RAS_MP1_FEATURE_PMFW_EEPROM , +RAS_MP1_FEATURE_MAX +}; +enum ras_mp1_msg_id { RAS_MP1_MSG_QueryValidMcaCount, RAS_MP1_MSG_McaBankDumpDW,
@@ -122,4 +127,6 @@ int ras_mp1_reset_ras_table(struct ras_core_context *ras_core,int ras_mp1_get_record_count (struct ras_core_context *ras_core,u32 *count);int ras_mp1_get_record (struct ras_core_context *ras_core,u32 idx,struct eeprom_err_record *rec); +int ras_mp1_check_feature_status (struct ras_core_context *ras_core, +enum ras_mp1_feature_id feature_id,u32 *status);#endif
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1.c +28 -0
@@ -25,6 +25,10 @@#include "amdgpu_reset.h" #include "ras.h" +static const enum smu_feature_mask ras_smu_feature_masks[RAS_MP1_FEATURE_MAX ] = { + [RAS_MP1_FEATURE_PMFW_EEPROM ] =SMU_FEATURE_HROM_EN_BIT , +}; +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,
@@ -49,6 +53,29 @@ static enum smu_message_typereturn ras_smu_msg_maps[msg_id]; } +static int amdgpu_ras_check_ras_feature_status (struct ras_core_context *ras_core, +enum ras_mp1_feature_id feature_id,u32 *status) +{ +struct amdgpu_device *adev = (struct amdgpu_device *)ras_core->dev; +u32 res =0 ; + +if (!status || (feature_id >=RAS_MP1_FEATURE_MAX )) +return -EINVAL ; + +if (down_read_trylock (&adev->reset_domain->sem)) { +if (amdgpu_smu_ras_feature_is_enabled (adev, + ras_smu_feature_masks[feature_id])) + res =1 ; +up_read (&adev->reset_domain->sem); + }else { +return -RAS_CORE_GPU_IN_MODE1_RESET ; + } + + *status = res; + +return 0 ; +} +static int amdgpu_ras_send_mp1_msg (struct ras_core_context *ras_core,u32 msg_id,u32 *params,u32 num_params,u32 *read_args,u32 num_read_args) {
@@ -73,4 +100,5 @@ static int amdgpu_ras_send_mp1_msg(struct ras_core_context *ras_core, u32 msg_idconst struct ras_mp1_sys_func amdgpu_ras_mp1_sys_func = { .mp1_send_ras_msg = amdgpu_ras_send_mp1_msg, + .check_ras_feature_status = amdgpu_ras_check_ras_feature_status, };
Signature · 1 line
2.43.0
PATCH 5/6 drm/amd/ras: use common mp1 ras interface for v13
In reply to YiPeng ChaiUse the common mp1 ras manager interface for MP1 v13_0.
--- drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +0 -2
@@ -158,8 +158,6 @@ static int amdgpu_ras_mgr_init_mp1_config(struct amdgpu_device *adev,case IP_VERSION (13 ,0 ,6 ):case IP_VERSION (13 ,0 ,14 ):case IP_VERSION (13 ,0 ,12 ): - mp1_cfg->mp1_sys_fn = &amdgpu_ras_mp1_sys_func_v13_0; -break ;case IP_VERSION (15 ,0 ,8 ): mp1_cfg->mp1_sys_fn = &amdgpu_ras_mp1_sys_func;break ;
Signature · 1 line
2.43.0
PATCH 6/6 drm/amd/ras: remove obsolete ras mp1 v13 manager code
In reply to YiPeng ChaiRemove obsolete ras mp1 v13 manager code.
--- drivers/gpu/drm/amd/ras/core/ras.h | 9 - drivers/gpu/drm/amd/ras/ras_mgr/Makefile | 1 - .../gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 1 - .../amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c | 161 ------------------ .../amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.h | 30 ---- 5 files changed, 202 deletions(-) delete mode 100644 drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c delete mode 100644 drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.h
drivers/gpu/drm/amd/ras/core/ras.h +0 -9
@@ -205,15 +205,6 @@ struct ras_psp;struct ras_eeprom_mgr ;struct ras_mp1_sys_func { -int (*mp1_get_valid_bank_count)(struct ras_core_context *ras_core, -u32 msg,u32 *count); -int (*mp1_dump_valid_bank)(struct ras_core_context *ras_core, -u32 msg,u32 idx,u32 reg_idx,u64 *val); -int (*mp1_send_eeprom_msg)(struct ras_core_context *ras_core, -u32 msg_id,uint32_t param,uint32_t *read_arg); -int (*mp1_get_ras_enabled_mask)(struct ras_core_context *ras_core, -uint64_t *enabled_mask); -int (*mp1_set_debug_mode)(struct ras_core_context *ras_core,bool enable);int (*mp1_send_ras_msg)(struct ras_core_context *ras_core,u32 msg_id,u32 *params,u32 num_params,u32 *read_args,u32 num_read_args); int (*check_ras_feature_status)(struct ras_core_context *ras_core,
drivers/gpu/drm/amd/ras/ras_mgr/Makefile +0 -1
@@ -21,7 +21,6 @@ RAS_MGR_FILES = amdgpu_ras_sys.o \ amdgpu_ras_mgr.o \ amdgpu_ras_eeprom_i2c.o \ - amdgpu_ras_mp1_v13_0.o \ amdgpu_ras_mp1.o \ amdgpu_ras_cmd.o \ amdgpu_virt_ras_cmd.o \
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +0 -1
@@ -30,7 +30,6 @@#include "amdgpu_virt_ras_cmd.h" #include "amdgpu_ras_process.h" #include "amdgpu_ras_eeprom_i2c.h" -#include "amdgpu_ras_mp1_v13_0.h" #include "amdgpu_ras_mp1.h" #include "amdgpu_ras_nbio_v7_9.h" #include "amdgpu_ras_bert.h"
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0 -161
161 lines not on this page · raw message
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.h deleted +0 -30
@@ -1,30 +0,0 @@ -/* SPDX-License-Identifier: MIT */ -/* -* Copyright 2025 Advanced Micro Devices, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR -* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -* OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef __AMDGPU_RAS_MP1_V13_0_H__ -#define __AMDGPU_RAS_MP1_V13_0_H__ -#include "ras.h" - -extern const struct ras_mp1_sys_func amdgpu_ras_mp1_sys_func_v13_0; - -#endif
Signature · 1 line
2.43.0
RE: [PATCH 6/6] drm/amd/ras: remove obsolete ras mp1 v13 manager code
AMD General
The series is:
Quoted 296 lines
-----Original Message-----
From: Chai, Thomas <[email protected]>
Sent: Friday, September 11, 2026 2:44 PM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Li, Candice <[email protected]>; Yang, Stanley <[email protected]>; Chai, Thomas <[email protected]>
Subject: [PATCH 6/6] drm/amd/ras: remove obsolete ras mp1 v13 manager codeRemove obsolete ras mp1 v13 manager code.
Signed-off-by YiPeng Chai <[email protected]>--- drivers/gpu/drm/amd/ras/core/ras.h | 9 - drivers/gpu/drm/amd/ras/ras_mgr/Makefile | 1 - .../gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 1 - .../amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c | 161 ------------------ .../amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.h | 30 ---- 5 files changed, 202 deletions(-) delete mode 100644 drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c delete mode 100644 drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.hdrivers/gpu/drm/amd/ras/core/ras.h +0
-9@@ -205,15 +205,6 @@ struct ras_psp;struct ras_eeprom_mgr ;struct ras_mp1_sys_func { -int (*mp1_get_valid_bank_count)(struct ras_core_context *ras_core, -u32 msg,u32 *count); -int (*mp1_dump_valid_bank)(struct ras_core_context *ras_core, -u32 msg,u32 idx,u32 reg_idx,u64 *val); -int (*mp1_send_eeprom_msg)(struct ras_core_context *ras_core, -u32 msg_id,uint32_t param,uint32_t *read_arg); -int (*mp1_get_ras_enabled_mask)(struct ras_core_context *ras_core, -uint64_t *enabled_mask); -int (*mp1_set_debug_mode)(struct ras_core_context *ras_core,bool enable);int (*mp1_send_ras_msg)(struct ras_core_context *ras_core,u32 msg_id,u32 *params,u32 num_params,u32 *read_args,u32 num_read_args);int (*check_ras_feature_status)(struct ras_core_context *ras_core, diff --gita/drivers/gpu/drm/amd/ras/ras_mgr/Makefile
b/drivers/gpu/drm/amd/ras/ras_mgr/Makefile
index4f94c97c15ca..c70760f10ffd100644drivers/gpu/drm/amd/ras/ras_mgr/Makefile +0
-1@@ -21,7 +21,6 @@ RAS_MGR_FILES = amdgpu_ras_sys.o \ amdgpu_ras_mgr.o \ amdgpu_ras_eeprom_i2c.o \ - amdgpu_ras_mp1_v13_0.o \ amdgpu_ras_mp1.o \ amdgpu_ras_cmd.o \ amdgpu_virt_ras_cmd.o \drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +0
-1@@ -30,7 +30,6 @@#include "amdgpu_virt_ras_cmd.h" #include "amdgpu_ras_process.h" #include "amdgpu_ras_eeprom_i2c.h" -#include "amdgpu_ras_mp1_v13_0.h" #include "amdgpu_ras_mp1.h" #include "amdgpu_ras_nbio_v7_9.h" #include "amdgpu_ras_bert.h" drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-15@@ -1,161 +0,0 @@ -// SPDX-License-Identifier: MIT -/* -* Copyright 2025 Advanced Micro Devices, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- */drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-19-#include "amdgpu_smu.h" -#include "amdgpu_reset.h" -#include "amdgpu_ras_mp1_v13_0.h" -#include "smu13_driver_if_v13_0_6.h" - -#define RAS_MP1_MSG_QueryValidMcaCeCount 0x3A -#define RAS_MP1_MSG_McaBankCeDumpDW 0x3B - -static const enum smu_message_type pmfw_eeprom_msgs[] = { - [RAS_SMU_GetRASTableVersion] = SMU_MSG_GetRASTableVersion, - [RAS_SMU_GetBadPageCount] = SMU_MSG_GetBadPageCount, - [RAS_SMU_SetTimestamp] = SMU_MSG_SetTimestamp, - [RAS_SMU_GetTimestamp] = SMU_MSG_GetTimestamp, - [RAS_SMU_GetBadPageIpid] = SMU_MSG_GetBadPageIpid, - [RAS_SMU_EraseRasTable] = SMU_MSG_EraseRasTable, - [RAS_SMU_GetBadPageMcaAddr] = SMU_MSG_GetBadPageMcaAddr, -}; - -static int mp1_v13_send_smu_msg(struct amdgpu_device *adev, enum
smu_message_typemsg,drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-3- uint32_t param, uint32_t *read_arg) -{ - return amdgpu_smu_ras_send_msg(adev, msg, ¶m, 1, read_arg,
read_arg? 1 : 0);drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-14-} - -static int mp1_v13_0_get_valid_bank_count (struct ras_core_context *ras_core, -u32 msg,u32 *count) -{ -struct amdgpu_device *adev = (struct amdgpu_device *)ras_core->dev; -u32 smu_msg; -int ret =0 ; - -if (!count) -return -EINVAL ; - - smu_msg = (msg == RAS_MP1_MSG_QueryValidMcaCeCount) ? - SMU_MSG_QueryValidMcaCeCount :
SMU_MSG_QueryValidMcaCount;drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-24- -if (down_read_trylock (&adev->reset_domain->sem)) { - ret =mp1_v13_send_smu_msg (adev, smu_msg,0 , count); -up_read (&adev->reset_domain->sem); - }else { - ret = -RAS_CORE_GPU_IN_MODE1_RESET ; - } - -if (ret) - *count =0 ; - -return ret; -} - -static int mp1_v13_0_dump_valid_bank (struct ras_core_context *ras_core, -u32 msg,u32 idx,u32 reg_idx,u64 *val) -{ -struct amdgpu_device *adev = (struct amdgpu_device *)ras_core->dev; -uint32_t data[2 ] = {0 ,0 }; -uint32_t param; -int ret =0 ; -int i, offset; -u32 smu_msg = (msg == RAS_MP1_MSG_McaBankCeDumpDW) ? - SMU_MSG_McaBankCeDumpDW :
SMU_MSG_McaBankDumpDW;drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-6- -if (down_read_trylock (&adev->reset_domain->sem)) { - offset = reg_idx *8 ; -for (i =0 ; i <ARRAY_SIZE (data); i++) { - param = ((idx &0xffff ) <<16 ) | ((offset + (i <<2 )) &0xfffc ); - ret = mp1_v13_send_smu_msg(adev, smu_msg, param,&data[i]);
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-2-if (ret) { - RAS_DEV_ERR(adev, "ACA failed to readregister[%d], offset:0x%x\n",
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-40- reg_idx, offset); -break ; - } - } -up_read (&adev->reset_domain->sem); - -if (!ret) - *val = (uint64_t )data[1 ] <<32 | data[0 ]; - }else { - ret = -RAS_CORE_GPU_IN_MODE1_RESET ; - } - -return ret; -} - -static int mp1_v13_0_eeprom_send_msg (struct ras_core_context *ras_core, -u32 msg_id,uint32_t param,uint32_t *read_arg) -{ -struct amdgpu_device *adev = (struct amdgpu_device *)ras_core->dev; -int ret =0 ; - -if (down_read_trylock (&adev->reset_domain->sem)) { - ret =mp1_v13_send_smu_msg (adev, - pmfw_eeprom_msgs[msg_id], param, read_arg); -up_read (&adev->reset_domain->sem); - }else { - ret = -RAS_CORE_GPU_IN_MODE1_RESET ; - } - -return ret; -} - -static int mp1_v13_0_get_ras_enabled_mask (struct ras_core_context *ras_core, -uint64_t *enabled_mask) -{ -struct amdgpu_device *adev = (struct amdgpu_device *)ras_core->dev; -int ret =0 ; - -if (down_read_trylock (&adev->reset_domain->sem)) { - if (amdgpu_smu_ras_feature_is_enabled(adev,
SMU_FEATURE_HROM_EN_BIT))
-*enabled_mask|=RAS_CORE_FW_FEATURE_BIT__RAS_EEPROM;drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-9-up_read (&adev->reset_domain->sem); - }else { - ret = -RAS_CORE_GPU_IN_MODE1_RESET ; - } - -return ret; -} - -static int mp1_v13_0_set_debug_mode(struct ras_core_context *ras_core, boolenable) -{
drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.c deleted +0
-19-struct amdgpu_device *adev = (struct amdgpu_device *)ras_core->dev; -u32 param = enable ?0 : ClearMcaOnRead_UE_FLAG_MASK | - ClearMcaOnRead_CE_POLL_MASK; -int ret; -u32 smu_msg = SMU_MSG_ClearMcaOnRead; - - ret =amdgpu_smu_ras_send_msg (adev, smu_msg, - ¶m,1 ,NULL ,0 ); -return ret; -} - -const struct ras_mp1_sys_func amdgpu_ras_mp1_sys_func_v13_0 = { - .mp1_get_valid_bank_count = mp1_v13_0_get_valid_bank_count, - .mp1_dump_valid_bank = mp1_v13_0_dump_valid_bank, - .mp1_send_eeprom_msg = mp1_v13_0_eeprom_send_msg, - .mp1_get_ras_enabled_mask = mp1_v13_0_get_ras_enabled_mask, - .mp1_set_debug_mode = mp1_v13_0_set_debug_mode, -}; -drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.h deleted +0
-15@@ -1,30 +0,0 @@ -/* SPDX-License-Identifier: MIT */ -/* -* Copyright 2025 Advanced Micro Devices, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the "Software"), -* to deal in the Software without restriction, including without limitation -* the rights to use, copy, modify, merge, publish, distribute, sublicense, -* and/or sell copies of the Software, and to permit persons to whom the -* Software is furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- */drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mp1_v13_0.h deleted +0
-9- -#ifndef __AMDGPU_RAS_MP1_V13_0_H__ -#define __AMDGPU_RAS_MP1_V13_0_H__ -#include "ras.h" - -extern const struct ras_mp1_sys_func amdgpu_ras_mp1_sys_func_v13_0; - -#endif --2.43.0