Skip to content

Commit 48aa62f

Browse files
candicelicyalexdeucher
authored andcommitted
drm/amd/pm: Enable bad memory page/channel recording support for smu v13_0_0
Send message to SMU to update bad memory page and bad channel info. Signed-off-by: Candice Li <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 177817d commit 48aa62f

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,13 @@
131131
#define PPSMC_MSG_EnableAudioStutterWA 0x44
132132
#define PPSMC_MSG_PowerUpUmsch 0x45
133133
#define PPSMC_MSG_PowerDownUmsch 0x46
134-
#define PPSMC_Message_Count 0x47
134+
#define PPSMC_MSG_SetDcsArch 0x47
135+
#define PPSMC_MSG_TriggerVFFLR 0x48
136+
#define PPSMC_MSG_SetNumBadMemoryPagesRetired 0x49
137+
#define PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel 0x4A
138+
#define PPSMC_MSG_SetPriorityDeltaGain 0x4B
139+
#define PPSMC_MSG_AllowIHHostInterrupt 0x4C
140+
#define PPSMC_Message_Count 0x4D
135141

136142
//Debug Dump Message
137143
#define DEBUGSMC_MSG_TestMessage 0x1

drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,9 @@
239239
__SMU_DUMMY_MAP(DriverMode2Reset), \
240240
__SMU_DUMMY_MAP(GetGfxOffStatus), \
241241
__SMU_DUMMY_MAP(GetGfxOffEntryCount), \
242-
__SMU_DUMMY_MAP(LogGfxOffResidency),
242+
__SMU_DUMMY_MAP(LogGfxOffResidency), \
243+
__SMU_DUMMY_MAP(SetNumBadMemoryPagesRetired), \
244+
__SMU_DUMMY_MAP(SetBadMemoryPagesRetiredFlagsPerChannel),
243245

244246
#undef __SMU_DUMMY_MAP
245247
#define __SMU_DUMMY_MAP(type) SMU_MSG_##type

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ static struct cmn2asic_msg_mapping smu_v13_0_0_message_map[SMU_MSG_MAX_COUNT] =
141141
MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0),
142142
MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0),
143143
MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0),
144+
MSG_MAP(SetNumBadMemoryPagesRetired, PPSMC_MSG_SetNumBadMemoryPagesRetired, 0),
145+
MSG_MAP(SetBadMemoryPagesRetiredFlagsPerChannel,
146+
PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel, 0),
144147
};
145148

146149
static struct cmn2asic_mapping smu_v13_0_0_clk_map[SMU_CLK_COUNT] = {
@@ -1838,6 +1841,40 @@ static void smu_v13_0_0_set_smu_mailbox_registers(struct smu_context *smu)
18381841
smu->debug_resp_reg = SOC15_REG_OFFSET(MP1, 0, mmMP1_SMN_C2PMSG_54);
18391842
}
18401843

1844+
static int smu_v13_0_0_smu_send_bad_mem_page_num(struct smu_context *smu,
1845+
uint32_t size)
1846+
{
1847+
int ret = 0;
1848+
1849+
/* message SMU to update the bad page number on SMUBUS */
1850+
ret = smu_cmn_send_smc_msg_with_param(smu,
1851+
SMU_MSG_SetNumBadMemoryPagesRetired,
1852+
size, NULL);
1853+
if (ret)
1854+
dev_err(smu->adev->dev,
1855+
"[%s] failed to message SMU to update bad memory pages number\n",
1856+
__func__);
1857+
1858+
return ret;
1859+
}
1860+
1861+
static int smu_v13_0_0_send_bad_mem_channel_flag(struct smu_context *smu,
1862+
uint32_t size)
1863+
{
1864+
int ret = 0;
1865+
1866+
/* message SMU to update the bad channel info on SMUBUS */
1867+
ret = smu_cmn_send_smc_msg_with_param(smu,
1868+
SMU_MSG_SetBadMemoryPagesRetiredFlagsPerChannel,
1869+
size, NULL);
1870+
if (ret)
1871+
dev_err(smu->adev->dev,
1872+
"[%s] failed to message SMU to update bad memory pages channel info\n",
1873+
__func__);
1874+
1875+
return ret;
1876+
}
1877+
18411878
static const struct pptable_funcs smu_v13_0_0_ppt_funcs = {
18421879
.get_allowed_feature_mask = smu_v13_0_0_get_allowed_feature_mask,
18431880
.set_default_dpm_table = smu_v13_0_0_set_default_dpm_table,
@@ -1908,6 +1945,8 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = {
19081945
.mode1_reset = smu_v13_0_0_mode1_reset,
19091946
.set_mp1_state = smu_v13_0_0_set_mp1_state,
19101947
.set_df_cstate = smu_v13_0_0_set_df_cstate,
1948+
.send_hbm_bad_pages_num = smu_v13_0_0_smu_send_bad_mem_page_num,
1949+
.send_hbm_bad_channel_flag = smu_v13_0_0_send_bad_mem_channel_flag,
19111950
};
19121951

19131952
void smu_v13_0_0_set_ppt_funcs(struct smu_context *smu)

0 commit comments

Comments
 (0)