Skip to content

Commit 7f3b16f

Browse files
Jie1zhangalexdeucher
authored andcommitted
drm/amdgpu: Fix SDMA UTC_L1 handling during start/stop sequences
This commit makes two key fixes to SDMA v4.4.2 handling: 1. disable UTC_L1 in sdma_cntl register when stopping SDMA engines by reading the current value before modifying UTC_L1_ENABLE bit. 2. Ensure UTC_L1_ENABLE is consistently managed by: - Adding the missing register write when enabling UTC_L1 during start - Keeping UTC_L1 enabled by default as per hardware requirements v2: Correct SDMA_CNTL setting (Philip) Suggested-by: Jonathan Kim <[email protected]> Signed-off-by: Jesse Zhang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 375bf56) Cc: [email protected]
1 parent 785c536 commit 7f3b16f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ static void sdma_v4_4_2_inst_gfx_stop(struct amdgpu_device *adev,
490490
{
491491
struct amdgpu_ring *sdma[AMDGPU_MAX_SDMA_INSTANCES];
492492
u32 doorbell_offset, doorbell;
493-
u32 rb_cntl, ib_cntl;
493+
u32 rb_cntl, ib_cntl, sdma_cntl;
494494
int i;
495495

496496
for_each_inst(i, inst_mask) {
@@ -502,6 +502,9 @@ static void sdma_v4_4_2_inst_gfx_stop(struct amdgpu_device *adev,
502502
ib_cntl = RREG32_SDMA(i, regSDMA_GFX_IB_CNTL);
503503
ib_cntl = REG_SET_FIELD(ib_cntl, SDMA_GFX_IB_CNTL, IB_ENABLE, 0);
504504
WREG32_SDMA(i, regSDMA_GFX_IB_CNTL, ib_cntl);
505+
sdma_cntl = RREG32_SDMA(i, regSDMA_CNTL);
506+
sdma_cntl = REG_SET_FIELD(sdma_cntl, SDMA_CNTL, UTC_L1_ENABLE, 0);
507+
WREG32_SDMA(i, regSDMA_CNTL, sdma_cntl);
505508

506509
if (sdma[i]->use_doorbell) {
507510
doorbell = RREG32_SDMA(i, regSDMA_GFX_DOORBELL);
@@ -995,6 +998,7 @@ static int sdma_v4_4_2_inst_start(struct amdgpu_device *adev,
995998
/* set utc l1 enable flag always to 1 */
996999
temp = RREG32_SDMA(i, regSDMA_CNTL);
9971000
temp = REG_SET_FIELD(temp, SDMA_CNTL, UTC_L1_ENABLE, 1);
1001+
WREG32_SDMA(i, regSDMA_CNTL, temp);
9981002

9991003
if (amdgpu_ip_version(adev, SDMA0_HWIP, 0) < IP_VERSION(4, 4, 5)) {
10001004
/* enable context empty interrupt during initialization */

0 commit comments

Comments
 (0)