[PATCH AUTOSEL 6.19] drm/amd/display: Fix DP no audio issue

Sasha Levin
2026-02-14T01:03:14Z

From: Charlene Liu <Charlene.Liu@amd.com>

[ Upstream commit bf5e396957acafd46003318965500914d5f4edfa ]

[why]
need to enable APG_CLOCK_ENABLE enable first
also need to wake up az from D3 before access az block

Reviewed-by: Swapnil Patel <swapnil.patel@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

Good, the fix has already been picked up in both 6.12.y and 6.6.y stable
trees. Now let me compile my complete analysis.

## Complete Analysis

### 1. COMMIT MESSAGE ANALYSIS

The commit subject is explicit: "Fix DP no audio issue". The body
explains the root cause:
- Need to enable `APG_CLOCK_ENABLE` first
- Need to wake AZ (Azalia audio controller) from D3 power state before
accessing AZ block

The commit has strong trust indicators:
- **Reviewed-by**: Swapnil Patel (AMD)
- **Tested-by**: Daniel Wheeler (AMD)
- **Signed-off-by**: Charlene Liu (AMD display engineer), Alex Deucher
(AMD GPU maintainer)
- Cherry-picked from mainline (`bf5e396957ac`) into drm-fixes for
6.19-rc2

### 2. CODE CHANGE ANALYSIS

The meaningful fix is entirely in `dce110_hwseq.c` (4 lines changed, 1
file). The `dcn401_hwseq.c` change is just a cosmetic blank line
removal.

**Before the fix** (the bug):

```1102:1106:drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
// ORDER WAS: (1) az_enable, (2) enable_pme_wa
pipe_ctx->stream_res.audio->funcs->az_enable(pipe_ctx-
>stream_res.audio); // accesses AZ registers while in D3!
if (num_audio >= 1 && clk_mgr->funcs->enable_pme_wa)
clk_mgr->funcs->enable_pme_wa(clk_mgr); // wakes AZ from D3 - TOO
LATE
```

**After the fix**:

```1121:1126:drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
if (num_audio >= 1 && clk_mgr->funcs->enable_pme_wa) {
/*wake AZ from D3 first before access az
endpoint*/
clk_mgr->funcs->enable_pme_wa(clk_mgr);
}

pipe_ctx->stream_res.audio->funcs->az_enable(pipe_ctx-
>stream_res.audio);
```

The `dce_aud_az_enable()` function reads and writes
`AZALIA_F0_CODEC_PIN_CONTROL_HOT_PLUG_CONTROL` registers. These are
hardware registers of the Azalia audio controller block. When the AZ
block is in D3 (deep power state), register accesses return
garbage/undefined values. The `enable_pme_wa()` function sends a PME
(Power Management Event) to wake the AZ from D3.

The fix simply reorders these two operations so the AZ block is woken
from D3 **before** its registers are accessed.

### 3. BUG HISTORY

Tracing via `git blame`:
- **v4.19-rc1** (commit `1a05873f21d6`): `dce110_enable_audio_stream()`
created with `az_enable()` called before
`set_pme_wa_enable_by_version()` - **bug introduced here**
- **v5.3-rc1** (commit `170a2398d2d80f`): Refactored to
`clk_mgr->funcs->enable_pme_wa()` but preserved the wrong ordering
- **v6.2-rc1** (commit `14e2739c36957`): Further refactoring but
ordering still wrong
- **Now**: Fix corrects the ordering that has been wrong since v4.19

### 4. CLASSIFICATION

This is a **clear bug fix** - hardware initialization ordering error
that causes complete audio failure on DisplayPort connections. Not a
feature, not refactoring.

### 5. SCOPE AND RISK

- **Size**: 4 lines changed in 1 meaningful file
- **Risk**: Extremely low - both `enable_pme_wa()` and `az_enable()`
were already called; only the order changed
- **Subsystem**: AMD display driver (dce110 path is shared by many ASIC
generations including DCN1.0, DCN2.0, DCN2.1, DCN3.0, DCN3.1, DCN3.5,
etc.)

### 6. USER IMPACT

**HIGH**: DP audio is completely broken without this fix. Users with
DisplayPort-connected monitors/TVs would have no audio output. This
affects a very large number of AMD GPU users.

### 7. STABILITY AND TESTING

- Already tested by AMD's QA team (Daniel Wheeler)
- Already picked into drm-fixes (drm maintainer deemed it worthy)
- Already backported to 6.12.y (v6.12.69) and 6.6.y (v6.6.123) stable
trees
- The fix has been in mainline since v6.19-rc2

### 8. DEPENDENCIES

The core fix (reorder `enable_pme_wa` before `az_enable`) is self-
contained. For older stable kernels (pre-6.7), the file path differs
(`dc/dce110/dce110_hw_sequencer.c` vs `dc/hwss/dce110/dce110_hwseq.c`),
and for pre-6.2 kernels there's no `link_hwss` variable, but the core
ordering change applies identically.

### Summary

This is a textbook stable backport candidate:
- Fixes a **complete audio failure** on DP connections for AMD GPUs
- Only **4 lines changed** (reordering two existing function calls)
- **Zero risk** of regression (both calls were already present)
- **Long-standing bug** since v4.19 (2018)
- Properly reviewed, tested, and already backported to 6.12.y and 6.6.y
- Affects a huge number of AMD GPU users with DP audio

**YES**

drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
index 12ce3789f5130..e1f5b1a34cde8 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
@@ -297,7 +297,6 @@ void dcn401_init_hw(struct dc *dc)
}
}
}
-
for (i = 0; i < res_pool->audio_count; i++) {
struct audio *audio = res_pool->audios[i];

--
2.51.0