From: Charlene Liu Charlene.Liu@amd.com
[ Upstream commit 3886b198bd6e49c801fe9552fcfbfc387a49fbbc ]
[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 (cherry picked from commit bf5e396957acafd46003318965500914d5f4edfa) Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
### 3. TECHNICAL ANALYSIS
**The Bug:** The original code had an incorrect operation sequence: 1. Called `az_enable()` - attempts to access audio controller registers 2. Called `enable_pme_wa()` - wakes audio controller from D3 power state
This is backwards - you cannot access hardware registers while the device is still in D3 (sleeping). The hardware must be woken up FIRST.
**The Fix:** The fix simply reorders these operations: 1. Call `enable_pme_wa()` - wake audio controller from D3 first 2. Call `az_enable()` - now safe to access registers
### 4. SCOPE AND RISK ASSESSMENT
- **Lines changed:** ~8 lines (just reordering) - **Files touched:** 1 file (dce110_hwseq.c) - **Complexity:** Very low - no new logic, just reordering existing function calls - **Subsystem:** AMD display driver, well-tested and mature - **Risk:** Minimal - same operations, correct sequence
### 5. USER IMPACT
- **Affected users:** AMD GPU users with DisplayPort audio output - **Severity:** High - complete loss of audio functionality - **Usage scenario:** Very common (monitors with speakers, AV receivers, docking stations) - **Symptoms:** "DP no audio issue" - a clearly user-visible bug
### 6. STABILITY INDICATORS
- Reviewed-by: Swapnil Patel (AMD engineer) - Tested-by: Daniel Wheeler (AMD engineer) - Multiple sign-offs from AMD display team - Cherry-picked from mainline - indicates AMD considers it important
### 7. DEPENDENCY CHECK
The dce110_hwseq.c file has been in the kernel for years and the `dce110_enable_audio_stream` function is stable code. The fix only reorders existing calls to `enable_pme_wa()` and `az_enable()` - both of which already exist in stable trees.
## Summary
**Meets stable criteria:** - ✅ **Obviously correct:** Simple reordering to match hardware requirements - ✅ **Fixes real bug:** Complete audio failure on DisplayPort is a significant user-visible bug - ✅ **Small and contained:** ~8 lines changed, same functions, just different order - ✅ **No new features:** No new functionality added - ✅ **Tested:** Has Tested-by and Reviewed-by tags from AMD engineers - ✅ **No dependencies:** Uses existing functions already in stable trees
**Risk vs Benefit:** - **Benefit:** Restores DisplayPort audio functionality for affected AMD GPU users - **Risk:** Very low - the same operations are performed, just in the correct hardware-required sequence
This is an ideal stable backport candidate: a small, surgical fix for a clear user-visible bug (no audio on DP), with proper code review and testing from the hardware vendor.
**YES**
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c index ebc220b29d14..0bf98d834e61 100644 --- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c @@ -1098,13 +1098,13 @@ void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx) if (dc->current_state->res_ctx.pipe_ctx[i].stream_res.audio != NULL) num_audio++; } + 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);
- if (num_audio >= 1 && clk_mgr->funcs->enable_pme_wa) - /*this is the first audio. apply the PME w/a in order to wake AZ from D3*/ - clk_mgr->funcs->enable_pme_wa(clk_mgr); - link_hwss->enable_audio_packet(pipe_ctx);
if (pipe_ctx->stream_res.audio)
linux-stable-mirror@lists.linaro.org