Skip to content

Commit 3059cd8

Browse files
Evan Quanalexdeucher
authored andcommitted
drm/amd/pm: disable cstate feature for gpu reset scenario
Suggested by PMFW team and same as what did for gfxoff feature. This can address some Mode1Reset failures observed on SMU13.0.0. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.0.x Signed-off-by: Alex Deucher <[email protected]>
1 parent ba2f099 commit 3059cd8

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,6 +2928,14 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
29282928
amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
29292929
amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
29302930

2931+
/*
2932+
* Per PMFW team's suggestion, driver needs to handle gfxoff
2933+
* and df cstate features disablement for gpu reset(e.g. Mode1Reset)
2934+
* scenario. Add the missing df cstate disablement here.
2935+
*/
2936+
if (amdgpu_dpm_set_df_cstate(adev, DF_CSTATE_DISALLOW))
2937+
dev_warn(adev->dev, "Failed to disallow df cstate");
2938+
29312939
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
29322940
if (!adev->ip_blocks[i].status.valid)
29332941
continue;

drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,9 +2242,17 @@ static void arcturus_get_unique_id(struct smu_context *smu)
22422242
static int arcturus_set_df_cstate(struct smu_context *smu,
22432243
enum pp_df_cstate state)
22442244
{
2245+
struct amdgpu_device *adev = smu->adev;
22452246
uint32_t smu_version;
22462247
int ret;
22472248

2249+
/*
2250+
* Arcturus does not need the cstate disablement
2251+
* prerequisite for gpu reset.
2252+
*/
2253+
if (amdgpu_in_reset(adev) || adev->in_suspend)
2254+
return 0;
2255+
22482256
ret = smu_cmn_get_smc_version(smu, NULL, &smu_version);
22492257
if (ret) {
22502258
dev_err(smu->adev->dev, "Failed to get smu version!\n");

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,15 @@ static bool aldebaran_is_baco_supported(struct smu_context *smu)
16401640
static int aldebaran_set_df_cstate(struct smu_context *smu,
16411641
enum pp_df_cstate state)
16421642
{
1643+
struct amdgpu_device *adev = smu->adev;
1644+
1645+
/*
1646+
* Aldebaran does not need the cstate disablement
1647+
* prerequisite for gpu reset.
1648+
*/
1649+
if (amdgpu_in_reset(adev) || adev->in_suspend)
1650+
return 0;
1651+
16431652
return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_DFCstateControl, state, NULL);
16441653
}
16451654

0 commit comments

Comments
 (0)