Skip to content

Commit 17c65d6

Browse files
Evan Quanalexdeucher
authored andcommitted
drm/amdgpu: correct the wrong cached state for GMC on PICASSO
Pair the operations did in GMC ->hw_init and ->hw_fini. That can help to maintain correct cached state for GMC and avoid unintention gate operation dropping due to wrong cached state. BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1828 Signed-off-by: Evan Quan <[email protected]> Acked-by: Guchun Chen <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 791255c commit 17c65d6

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,14 @@ static int gmc_v9_0_hw_fini(void *handle)
18081808
return 0;
18091809
}
18101810

1811+
/*
1812+
* Pair the operations did in gmc_v9_0_hw_init and thus maintain
1813+
* a correct cached state for GMC. Otherwise, the "gate" again
1814+
* operation on S3 resuming will fail due to wrong cached state.
1815+
*/
1816+
if (adev->mmhub.funcs->update_power_gating)
1817+
adev->mmhub.funcs->update_power_gating(adev, false);
1818+
18111819
amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0);
18121820
amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0);
18131821

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@ static void mmhub_v1_0_update_power_gating(struct amdgpu_device *adev,
301301
if (amdgpu_sriov_vf(adev))
302302
return;
303303

304-
if (enable && adev->pg_flags & AMD_PG_SUPPORT_MMHUB) {
305-
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GMC, true);
306-
307-
}
304+
if (adev->pg_flags & AMD_PG_SUPPORT_MMHUB)
305+
amdgpu_dpm_set_powergating_by_smu(adev,
306+
AMD_IP_BLOCK_TYPE_GMC,
307+
enable);
308308
}
309309

310310
static int mmhub_v1_0_gart_enable(struct amdgpu_device *adev)

drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,12 @@ static int pp_set_powergating_by_smu(void *handle,
13281328
pp_dpm_powergate_vce(handle, gate);
13291329
break;
13301330
case AMD_IP_BLOCK_TYPE_GMC:
1331-
pp_dpm_powergate_mmhub(handle);
1331+
/*
1332+
* For now, this is only used on PICASSO.
1333+
* And only "gate" operation is supported.
1334+
*/
1335+
if (gate)
1336+
pp_dpm_powergate_mmhub(handle);
13321337
break;
13331338
case AMD_IP_BLOCK_TYPE_GFX:
13341339
ret = pp_dpm_powergate_gfx(handle, gate);

0 commit comments

Comments
 (0)