drm/amdgpu/pm: support mca_ceumc_addr in ecctable
Subsystems (3)
PATCH v2 1/2 drm/amdgpu/pm: support mca_ceumc_addr in ecctable
SMU add a new variable mca_ceumc_addr to record umc correctable error address in EccInfo table, driver side add EccInfo_V2_t to support this feature
Changed from V1:
remove ecc_table_v2 and unnecessary table id, define union struct include EccInfo_t and EccInfo_V2_t.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 1 + .../inc/pmfw_if/smu13_driver_if_aldebaran.h | 16 +++++- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 53 ++++++++++++++----- 3 files changed, 57 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +1 -0
@@ -328,6 +328,7 @@ struct ecc_info_per_ch {uint16_t ce_count_hi_chip;uint64_t mca_umc_status;uint64_t mca_umc_addr; +uint64_t mca_ceumc_addr; };struct umc_ecc_info {
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_aldebaran.h +15 -1
@@ -519,7 +519,21 @@ typedef struct { } EccInfo_t;typedef struct { -EccInfo_t EccInfo[ALDEBARAN_UMC_CHANNEL_NUM ]; +uint64_t mca_umc_status; +uint64_t mca_umc_addr; +uint64_t mca_ceumc_addr; + +uint16_t ce_count_lo_chip; +uint16_t ce_count_hi_chip; + +uint32_t eccPadding; +}EccInfo_V2_t ; + +typedef struct { +union { +EccInfo_t EccInfo[ALDEBARAN_UMC_CHANNEL_NUM ]; +EccInfo_V2_t EccInfo_V2[ALDEBARAN_UMC_CHANNEL_NUM ]; + }; }EccInfoTable_t ;// These defines are used with the following messages:
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +41 -12
85 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 2/2 drm/amdgpu: print umc correctable error address
Changed from V1:
remove unnecessary same row physical address calculation
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 ++ drivers/gpu/drm/amd/amdgpu/umc_v6_7.c | 52 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 1 + 3 files changed, 56 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +5 -0
@@ -1108,6 +1108,11 @@ struct amdgpu_device {bool scpm_enabled;uint32_t scpm_status; + +/* Determine smu ecctable whether support +* record correctable error address +*/ +int record_ce_addr_supported; };static inline struct amdgpu_device *drm_to_adev (struct drm_device *ddev)
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +50 -2
76 lines not on this page · raw message
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +1 -0
@@ -1882,6 +1882,7 @@ static ssize_t aldebaran_get_ecc_info(struct smu_context *smu, ecc_table->EccInfo_V2[i].mca_umc_addr; ecc_info_per_channel->mca_ceumc_addr = ecc_table->EccInfo_V2[i].mca_ceumc_addr; + smu->adev->record_ce_addr_supported =1 ; } }
Signature · 1 line
2.17.1
Re: [PATCH Review v2 2/2] drm/amdgpu: print umc correctable error address
Quoted 15 lines · Stanley.Yang
Changed from V1:
remove unnecessary same row physical address calculationSigned-off-by Stanley.Yang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 ++ drivers/gpu/drm/amd/amdgpu/umc_v6_7.c | 52 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 1 + 3 files changed, 56 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu.h struct amdgpu_device { · line 1115
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +5
-0@@ -1108,6 +1108,11 @@ struct amdgpu_device {bool scpm_enabled;uint32_t scpm_status; + +/* Determine smu ecctable whether support +* record correctable error address +*/ +int record_ce_addr_supported;
Why not keep this in umc_ecc_info passed back from FW?
Thanks,
Lijo
Quoted 100 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0};static inline struct amdgpu_device *drm_to_adev (struct drm_device *ddev)drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +50
-2@@ -119,6 +119,24 @@ static void umc_v6_7_ecc_info_query_correctable_error_count(struct amdgpu_device *error_count +=1 ;umc_v6_7_query_error_status_helper (adev, mc_umc_status, umc_reg_offset); + +if (adev->record_ce_addr_supported) { +uint64_t err_addr, soc_pa; +uint32_t channel_index = + adev->umc.channel_idx_tbl[umc_inst * adev->umc.channel_inst_num + ch_inst]; + + err_addr = ras->umc_ecc.ecc[eccinfo_table_idx].mca_ceumc_addr; + err_addr =REG_GET_FIELD (err_addr,MCA_UMC_UMC0_MCUMC_ADDRT0 , ErrorAddr); +/* translate umc channel address to soc pa, 3 parts are included */ + soc_pa =ADDR_OF_8KB_BLOCK (err_addr) | +ADDR_OF_256B_BLOCK (channel_index) | +OFFSET_IN_256B_BLOCK (err_addr); + +/* The umc channel bits are not original values, they are hashed */ +SET_CHANNEL_HASH (channel_index, soc_pa); + +dev_info (adev->dev,"Error Address(PA): 0x%llx\n" , soc_pa); + } } }@@ -251,7 +269,9 @@ static void umc_v6_7_ecc_info_query_ras_error_address(struct amdgpu_device *adevstatic void umc_v6_7_query_correctable_error_count (struct amdgpu_device *adev,uint32_t umc_reg_offset, -unsigned long *error_count) +unsigned long *error_count, +uint32_t ch_inst, +uint32_t umc_inst) {uint32_t ecc_err_cnt_sel, ecc_err_cnt_sel_addr;uint32_t ecc_err_cnt, ecc_err_cnt_addr;@@ -295,6 +315,33 @@ static void umc_v6_7_query_correctable_error_count(struct amdgpu_device *adev, *error_count +=1 ;umc_v6_7_query_error_status_helper (adev, mc_umc_status, umc_reg_offset); + + { +uint64_t err_addr, soc_pa; +uint32_t mc_umc_addrt0; +uint32_t channel_index; + + mc_umc_addrt0 = +SOC15_REG_OFFSET (UMC ,0 , regMCA_UMC_UMC0_MCUMC_ADDRT0); + + channel_index = + adev->umc.channel_idx_tbl[umc_inst * adev->umc.channel_inst_num + ch_inst]; + + err_addr =RREG64_PCIE ((mc_umc_addrt0 + umc_reg_offset) *4 ); + err_addr =REG_GET_FIELD (err_addr,MCA_UMC_UMC0_MCUMC_ADDRT0 , ErrorAddr); + +/* translate umc channel address to soc pa, 3 parts are included */ + soc_pa =ADDR_OF_8KB_BLOCK (err_addr) | +ADDR_OF_256B_BLOCK (channel_index) | +OFFSET_IN_256B_BLOCK (err_addr); + +/* The umc channel bits are not original values, they are hashed */ +SET_CHANNEL_HASH (channel_index, soc_pa); + +/* clear [C4 C3 C2] in soc physical address */ + soc_pa &= ~(0x7ULL <<UMC_V6_7_PA_C2_BIT ); +dev_info (adev->dev,"Error Address(PA): 0x%llx\n" , soc_pa); + } } }@@ -395,7 +442,8 @@ static void umc_v6_7_query_ras_error_count(struct amdgpu_device *adev, ch_inst);umc_v6_7_query_correctable_error_count (adev, umc_reg_offset, - &(err_data->ce_count)); + &(err_data->ce_count), + ch_inst, umc_inst);umc_v6_7_querry_uncorrectable_error_count (adev, umc_reg_offset, &(err_data->ue_count));drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +1
-0@@ -1882,6 +1882,7 @@ static ssize_t aldebaran_get_ecc_info(struct smu_context *smu, ecc_table->EccInfo_V2[i].mca_umc_addr; ecc_info_per_channel->mca_ceumc_addr = ecc_table->EccInfo_V2[i].mca_ceumc_addr; + smu->adev->record_ce_addr_supported =1 ; } }
答复: [PATCH Review v2 2/2] drm/amdgpu: print umc correctable error address
[AMD Official Use Only - General]
[AMD Official Use Only - General]
发件人: Lazar, Lijo <[email protected]>
日期: 星期三, 2022年5月25日 上午12:03
收件人: Yang, Stanley <[email protected]>, [email protected] <[email protected]>, Zhang, Hawking <[email protected]>, Zhou1, Tao <[email protected]>, Quan, Evan <[email protected]> 主题: Re: [PATCH Review v2 2/2] drm/amdgpu: print umc correctable error address
Quoted 15 lines · Stanley.Yang
Changed from V1:
remove unnecessary same row physical address calculationSigned-off-by Stanley.Yang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 ++ drivers/gpu/drm/amd/amdgpu/umc_v6_7.c | 52 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 1 + 3 files changed, 56 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu.h struct amdgpu_device { · line 1115
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +5
-0@@ -1108,6 +1108,11 @@ struct amdgpu_device {bool scpm_enabled;uint32_t scpm_status; + +/* Determine smu ecctable whether support +* record correctable error address +*/ +int record_ce_addr_supported;
Why not keep this in umc_ecc_info passed back from FW?
Thanks,
Lijo
Stanley: Good point, this can keep the overall logic of the RAS ecctableinfo, thanks Lijo.
Quoted 100 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0};static inline struct amdgpu_device *drm_to_adev (struct drm_device *ddev)drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +50
-2@@ -119,6 +119,24 @@ static void umc_v6_7_ecc_info_query_correctable_error_count(struct amdgpu_device *error_count +=1 ;umc_v6_7_query_error_status_helper (adev, mc_umc_status, umc_reg_offset); + +if (adev->record_ce_addr_supported) { +uint64_t err_addr, soc_pa; +uint32_t channel_index = + adev->umc.channel_idx_tbl[umc_inst * adev->umc.channel_inst_num + ch_inst]; + + err_addr = ras->umc_ecc.ecc[eccinfo_table_idx].mca_ceumc_addr; + err_addr =REG_GET_FIELD (err_addr,MCA_UMC_UMC0_MCUMC_ADDRT0 , ErrorAddr); +/* translate umc channel address to soc pa, 3 parts are included */ + soc_pa =ADDR_OF_8KB_BLOCK (err_addr) | +ADDR_OF_256B_BLOCK (channel_index) | +OFFSET_IN_256B_BLOCK (err_addr); + +/* The umc channel bits are not original values, they are hashed */ +SET_CHANNEL_HASH (channel_index, soc_pa); + +dev_info (adev->dev,"Error Address(PA): 0x%llx\n" , soc_pa); + } } }@@ -251,7 +269,9 @@ static void umc_v6_7_ecc_info_query_ras_error_address(struct amdgpu_device *adevstatic void umc_v6_7_query_correctable_error_count (struct amdgpu_device *adev,uint32_t umc_reg_offset, -unsigned long *error_count) +unsigned long *error_count, +uint32_t ch_inst, +uint32_t umc_inst) {uint32_t ecc_err_cnt_sel, ecc_err_cnt_sel_addr;uint32_t ecc_err_cnt, ecc_err_cnt_addr;@@ -295,6 +315,33 @@ static void umc_v6_7_query_correctable_error_count(struct amdgpu_device *adev, *error_count +=1 ;umc_v6_7_query_error_status_helper (adev, mc_umc_status, umc_reg_offset); + + { +uint64_t err_addr, soc_pa; +uint32_t mc_umc_addrt0; +uint32_t channel_index; + + mc_umc_addrt0 = +SOC15_REG_OFFSET (UMC ,0 , regMCA_UMC_UMC0_MCUMC_ADDRT0); + + channel_index = + adev->umc.channel_idx_tbl[umc_inst * adev->umc.channel_inst_num + ch_inst]; + + err_addr =RREG64_PCIE ((mc_umc_addrt0 + umc_reg_offset) *4 ); + err_addr =REG_GET_FIELD (err_addr,MCA_UMC_UMC0_MCUMC_ADDRT0 , ErrorAddr); + +/* translate umc channel address to soc pa, 3 parts are included */ + soc_pa =ADDR_OF_8KB_BLOCK (err_addr) | +ADDR_OF_256B_BLOCK (channel_index) | +OFFSET_IN_256B_BLOCK (err_addr); + +/* The umc channel bits are not original values, they are hashed */ +SET_CHANNEL_HASH (channel_index, soc_pa); + +/* clear [C4 C3 C2] in soc physical address */ + soc_pa &= ~(0x7ULL <<UMC_V6_7_PA_C2_BIT ); +dev_info (adev->dev,"Error Address(PA): 0x%llx\n" , soc_pa); + } } }@@ -395,7 +442,8 @@ static void umc_v6_7_query_ras_error_count(struct amdgpu_device *adev, ch_inst);umc_v6_7_query_correctable_error_count (adev, umc_reg_offset, - &(err_data->ce_count)); + &(err_data->ce_count), + ch_inst, umc_inst);umc_v6_7_querry_uncorrectable_error_count (adev, umc_reg_offset, &(err_data->ue_count));drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +1
-0@@ -1882,6 +1882,7 @@ static ssize_t aldebaran_get_ecc_info(struct smu_context *smu, ecc_table->EccInfo_V2[i].mca_umc_addr; ecc_info_per_channel->mca_ceumc_addr = ecc_table->EccInfo_V2[i].mca_ceumc_addr; + smu->adev->record_ce_addr_supported =1 ; } }
RE: [PATCH Review v2 2/2] drm/amdgpu: print umc correctable error address
In reply to Stanley.YangQuoted 127 lines
-----Original Message-----
From: Stanley.Yang <[email protected]>
Sent: Tuesday, May 24, 2022 10:31 PM
To: [email protected]; Zhang, Hawking <[email protected]>; Zhou1, Tao <[email protected]>; Quan, Evan <[email protected]>; Lazar, Lijo <[email protected]>
Cc: Yang, Stanley <[email protected]>
Subject: [PATCH Review v2 2/2] drm/amdgpu: print umc correctable error addressChanged from V1:
remove unnecessary same row physical address calculationSigned-off-by Stanley.Yang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 5 ++ drivers/gpu/drm/amd/amdgpu/umc_v6_7.c | 52 ++++++++++++++++++- .../drm/amd/pm/swsmu/smu13/aldebaran_ppt.c | 1 + 3 files changed, 56 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +5
-1@@ -1108,6 +1108,11 @@ struct amdgpu_device {bool scpm_enabled;uint32_t scpm_status; + +/* Determine smu ecctable whether support +* record correctable error address +*/ +int record_ce_addr_supported; };static inline struct amdgpu_device *drm_to_adev (struct drm_device *ddev) diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c
b/drivers/gpu/drm/amd/amdgpu/umc_v6_7.c
index606892dbea1c..91bdc5e048c2100644drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +0
-0@@ -119,6 +119,24 @@ static voidumc_v6_7_ecc_info_query_correctable_error_count(struct
amdgpu_devicedrivers/gpu/drm/amd/amdgpu/umc_v6_7.c +0
-0*error_count +=1 ; umc_v6_7_query_error_status_helper(adev, mc_umc_status,
umc_reg_offset);drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +5
-0+ +if (adev->record_ce_addr_supported) { +uint64_t err_addr, soc_pa; +uint32_t channel_index = + adev->umc.channel_idx_tbl[umc_inst * adev-Quoted 1 line
umc.channel_inst_num +
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +3
-0+ch_inst]; + + err_addr = ras-Quoted 1 line
umc_ecc.ecc[eccinfo_table_idx].mca_ceumc_addr;
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +1
-0+ err_addr = REG_GET_FIELD(err_addr,
MCA_UMC_UMC0_MCUMC_ADDRT0, ErrorAddr);drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +1
-0+/* translate umc channel address to soc pa, 3 parts are included */
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +2
-0+ soc_pa =ADDR_OF_8KB_BLOCK (err_addr) | +ADDR_OF_256B_BLOCK (channel_index)|
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +3
-0+OFFSET_IN_256B_BLOCK (err_addr); + +/* The umc channel bits are not original values, they are hashed */
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +3
-0+SET_CHANNEL_HASH (channel_index, soc_pa); + + dev_info(adev->dev, "Error Address(PA): 0x%llx\n",
soc_pa);drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +1
-0+ } } }@@ -251,7 +269,9 @@ static voidumc_v6_7_ecc_info_query_ras_error_address(struct
amdgpu_device*adevstatic void umc_v6_7_query_correctable_error_count(struct
amdgpu_device
*adev,drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +3
-1uint32_t umc_reg_offset, - unsigned long *error_count) + unsigned long *error_count, + uint32_t ch_inst, + uint32_t umc_inst) { uint32_t ecc_err_cnt_sel, ecc_err_cnt_sel_addr; uint32_t ecc_err_cnt, ecc_err_cnt_addr; @@ -295,6 +315,33 @@ staticvoid umc_v6_7_query_correctable_error_count(struct
amdgpu_device*adev,drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +0
-0*error_count +=1 ; umc_v6_7_query_error_status_helper(adev, mc_umc_status,
umc_reg_offset);drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +8
-0+ + { +uint64_t err_addr, soc_pa; +uint32_t mc_umc_addrt0; +uint32_t channel_index; + + mc_umc_addrt0 = + SOC15_REG_OFFSET(UMC, 0,
regMCA_UMC_UMC0_MCUMC_ADDRT0);drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +3
-0+ + channel_index = + adev->umc.channel_idx_tbl[umc_inst * adev-Quoted 1 line
umc.channel_inst_num +
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +3
-0+ch_inst]; + + err_addr = RREG64_PCIE((mc_umc_addrt0 +
umc_reg_offset) * 4);drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +1
-0+ err_addr = REG_GET_FIELD(err_addr,
MCA_UMC_UMC0_MCUMC_ADDRT0,drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +3
-0+ErrorAddr); + +/* translate umc channel address to soc pa, 3 parts are included */
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +2
-0+ soc_pa =ADDR_OF_8KB_BLOCK (err_addr) | +ADDR_OF_256B_BLOCK (channel_index)|
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +3
-0+OFFSET_IN_256B_BLOCK (err_addr); + +/* The umc channel bits are not original values, they are hashed */
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c static void umc_v6_7_query_correctable_error_count(struct amdgpu_device *adev, · line 342
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +4
-0+SET_CHANNEL_HASH (channel_index, soc_pa); + +/* clear [C4 C3 C2] in soc physical address */ + soc_pa &= ~(0x7ULL <<UMC_V6_7_PA_C2_BIT );
[Tao] this clear needs to be dropped as well.
Quoted 34 lines
drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +1
-0+ dev_info(adev->dev, "Error Address(PA): 0x%llx\n",
soc_pa);drivers/gpu/drm/amd/amdgpu/umc_v6_7.c +3
-1+ } } }@@ -395,7 +442,8 @@ static void umc_v6_7_query_ras_error_count(structamdgpu_device *adev, ch_inst);umc_v6_7_query_correctable_error_count (adev, umc_reg_offset, - &(err_data->ce_count)); + &(err_data->ce_count), + ch_inst, umc_inst); umc_v6_7_querry_uncorrectable_error_count(adev, umc_reg_offset,&(err_data-
Quoted 1 line
ue_count));drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c +1
-1@@ -1882,6 +1882,7 @@ static ssize_t aldebaran_get_ecc_info(struct smu_context *smu, ecc_table->EccInfo_V2[i].mca_umc_addr; ecc_info_per_channel->mca_ceumc_addr = ecc_table->EccInfo_V2[i].mca_ceumc_addr; + smu->adev->record_ce_addr_supported =1 ; } } --2.17.1