Skip to content

Commit 4d4275a

Browse files
davidwuAMDalexdeucher
authored andcommitted
drm/amdgpu/vcn4.0.5: read back register after written
The addition of register read-back in VCN v4.0.5 is intended to prevent potential race conditions. Reviewed-by: Ruijing Dong <[email protected]> Signed-off-by: David (Ming Qiang) Wu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 5b4c641 commit 4d4275a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,11 @@ static void vcn_v4_0_5_stop_dpg_mode(struct amdgpu_vcn_inst *vinst)
12541254
/* disable dynamic power gating mode */
12551255
WREG32_P(SOC15_REG_OFFSET(VCN, inst_idx, regUVD_POWER_STATUS), 0,
12561256
~UVD_POWER_STATUS__UVD_PG_MODE_MASK);
1257+
1258+
/* Keeping one read-back to ensure all register writes are done,
1259+
* otherwise it may introduce race conditions.
1260+
*/
1261+
RREG32_SOC15(VCN, inst_idx, regUVD_STATUS);
12571262
}
12581263

12591264
/**
@@ -1337,6 +1342,11 @@ static int vcn_v4_0_5_stop(struct amdgpu_vcn_inst *vinst)
13371342
/* enable VCN power gating */
13381343
vcn_v4_0_5_enable_static_power_gating(vinst);
13391344

1345+
/* Keeping one read-back to ensure all register writes are done,
1346+
* otherwise it may introduce race conditions.
1347+
*/
1348+
RREG32_SOC15(VCN, i, regUVD_STATUS);
1349+
13401350
done:
13411351
if (adev->pm.dpm_enabled)
13421352
amdgpu_dpm_enable_vcn(adev, false, i);

0 commit comments

Comments
 (0)