patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: "Timur Kristóf" <timur.kristof@gmail.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Sasha Levin" <sashal@kernel.org>,
	sunil.khatri@amd.com, lijo.lazar@amd.com,
	alexandre.f.demers@gmail.com, chris@rudorff.com,
	boyuan.zhang@amd.com, mario.limonciello@amd.com
Subject: [PATCH AUTOSEL 6.17-6.1] drm/amd/pm: Disable MCLK switching on SI at high pixel clocks
Date: Mon, 27 Oct 2025 20:39:00 -0400	[thread overview]
Message-ID: <20251028003940.884625-16-sashal@kernel.org> (raw)
In-Reply-To: <20251028003940.884625-1-sashal@kernel.org>

From: Timur Kristóf <timur.kristof@gmail.com>

[ Upstream commit 5c05bcf6ae7732da1bd4dc1958d527b5f07f216a ]

On various SI GPUs, a flickering can be observed near the bottom
edge of the screen when using a single 4K 60Hz monitor over DP.
Disabling MCLK switching works around this problem.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.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:

Based on my comprehensive analysis using semantic code analysis tools
and examining the kernel repository, here is my assessment:

## **BACKPORT RECOMMENDATION: YES**

## Detailed Analysis:

### 1. **Semantic Code Analysis Findings:**

**Tool: mcp__semcode__find_function**
- Located function `si_apply_state_adjust_rules` in
  drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
- Function is part of AMD SI GPU power management infrastructure
- Called by `si_dpm_pre_set_power_state` which is registered as a power
  management callback

**Tool: mcp__semcode__find_callers**
- `si_apply_state_adjust_rules` has only 2 callers (appears to be
  duplicate entries)
- Call path: Power management system → `si_dpm_pre_set_power_state` →
  `si_apply_state_adjust_rules`
- The function is part of the standard DRM/power management callback
  chain

**Tool: mcp__semcode__grep_functions**
- Found that `disable_mclk_switching` already exists as a local variable
  in the function
- The change modifies existing logic flow rather than introducing new
  infrastructure
- There's an identical function in the legacy radeon driver
  (drivers/gpu/drm/radeon/)

**Tool: mcp__semcode__find_calls**
- Function calls standard helper functions:
  `btc_adjust_clock_combinations`, `btc_apply_voltage_dependency_rules`,
  etc.
- No new dependencies introduced
- Uses existing `high_pixelclock_count` variable that was already
  present

### 2. **Critical Context Discovery:**

Through git log examination, I discovered a **related commit
(63499c7ed46f9)** that was **already backported** by the autosel
process. This commit:
- Added the `high_pixelclock_count` infrastructure and detection logic
- Fixed flickering when **TWO** 4K 60Hz displays are connected to
  **Oland specifically**
- Has "Fixes: 841686df9f7d" tag and was signed off by Sasha Levin
- Commit message includes "[ Upstream commit
  7009e3af0474aca5f64262b3c72fb6e23b232f9b ]"

The current commit (5c05bcf6ae773) is a **companion fix** that:
- Uses the **same infrastructure** already backported
- Fixes flickering for **ANY SINGLE** high-resolution display on **all
  SI GPUs**
- Addresses a **more common scenario** than the previously backported
  fix

### 3. **Code Changes Analysis:**

The change adds only **5 lines** in one location:
```c
if (high_pixelclock_count) {
    /* Work around flickering lines at the bottom edge
     - of the screen when using a single 4K 60Hz monitor.
     */
    disable_mclk_switching = true;  // <-- NEW LINE

    /* On Oland, we observe some flickering when two 4K 60Hz... */
    if (high_pixelclock_count > 1 && adev->asic_type == CHIP_OLAND)
        disable_sclk_switching = true;
}
```

This is extremely localized and low-risk.

### 4. **Impact Assessment:**

- **User Impact**: HIGH - Fixes visible display corruption (flickering
  at bottom of screen)
- **Hardware Scope**: SI generation AMD GPUs (Tahiti, Pitcairn, Cape
  Verde, Oland, Hainan ~2012-2013)
- **Risk Level**: LOW - Conservative workaround that disables a power-
  saving feature
- **Side Effect**: Slightly higher power consumption with high pixel
  clock displays, but fixes critical visual bug
- **Regression Risk**: MINIMAL - Only affects power state selection
  logic, doesn't change core GPU functionality

### 5. **Backport Justification:**

✅ **Bug Fix**: Fixes user-visible display corruption
✅ **Small & Contained**: 5 lines added to one function
✅ **No New Features**: Pure bug fix workaround
✅ **No Architectural Changes**: Uses existing infrastructure
✅ **Completes a Series**: Related fix already backported
✅ **Common Scenario**: Single 4K 60Hz monitor more common than dual
monitors
✅ **Low Risk**: Conservative change that disables a feature to fix a bug
✅ **Reviewed**: Reviewed-by Alex Deucher (AMD maintainer)
✅ **Hardware Specific**: Only affects legacy SI GPUs, isolated impact

### 6. **Notable Points:**

- **Missing Stable Tags**: The commit lacks "Cc: stable@vger.kernel.org"
  or "Fixes:" tags, likely an oversight
- **Part of Fix Series**: This completes the SI DPM flickering
  workaround series
- **Infrastructure Already Backported**: The `high_pixelclock_count`
  detection logic is already in stable trees
- **Active Maintenance**: Author has made multiple fixes to SI DPM code
  recently
- **Broader Applicability**: Previous fix was Oland-specific, this helps
  **all SI GPUs**

### 7. **Conclusion:**

This commit should **definitely be backported** to stable kernel trees.
It fixes a user-visible bug (display flickering) affecting users with 4K
60Hz monitors on SI generation AMD GPUs. The fix is small, safe, and
complements a related fix that was already backported. The lack of
explicit stable tags appears to be an oversight rather than an
intentional exclusion. Users who received the previous backport
(63499c7ed46f9) may still experience flickering with a single 4K
monitor—this commit addresses that scenario.

**Backport Status: YES** - High priority for stable trees to complete
the SI DPM flickering workaround series.

 drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index 4236700fc1ad1..9281aca0e64af 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -3504,6 +3504,11 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev,
 	 * for these GPUs to calculate bandwidth requirements.
 	 */
 	if (high_pixelclock_count) {
+		/* Work around flickering lines at the bottom edge
+		 * of the screen when using a single 4K 60Hz monitor.
+		 */
+		disable_mclk_switching = true;
+
 		/* On Oland, we observe some flickering when two 4K 60Hz
 		 * displays are connected, possibly because voltage is too low.
 		 * Raise the voltage by requiring a higher SCLK.
-- 
2.51.0


  parent reply	other threads:[~2025-10-28  0:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28  0:38 [PATCH AUTOSEL 6.17-6.1] smb/server: fix possible memory leak in smb2_read() Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17-5.4] NFS4: Fix state renewals missing after boot Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17-6.12] drm/amdgpu: remove two invalid BUG_ON()s Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17-5.15] NFS: check if suid/sgid was cleared after a write as needed Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17-6.12] HID: logitech-hidpp: Add HIDPP_QUIRK_RESET_HI_RES_SCROLL Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17-5.4] ASoC: max98090/91: fixed max98091 ALSA widget powering up/down Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17] ALSA: hda/realtek: Fix mute led for HP Omen 17-cb0xxx Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17-5.10] RISC-V: clear hot-unplugged cores from all task mm_cpumasks to avoid rfence errors Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17] ASoC: nau8821: Avoid unnecessary blocking in IRQ handler Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17-5.4] HID: quirks: avoid Cooler Master MM712 dongle wakeup bug Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17] drm/amdkfd: fix suspend/resume all calls in mes based eviction path Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17-6.12] exfat: fix improper check of dentry.stream.valid_size Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17] io_uring: fix unexpected placement on same size resizing Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17] drm/amd: Disable ASPM on SI Sasha Levin
2025-10-28  0:38 ` [PATCH AUTOSEL 6.17-6.6] riscv: acpi: avoid errors caused by probing DT devices when ACPI is used Sasha Levin
2025-10-28  0:39 ` Sasha Levin [this message]
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17-6.12] drm/amdgpu: hide VRAM sysfs attributes on GPUs without VRAM Sasha Levin
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17] fs: return EOPNOTSUPP from file_setattr/file_getattr syscalls Sasha Levin
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17-6.12] NFS4: Apply delay_retrans to async operations Sasha Levin
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17-6.1] drm/amdgpu: Fix NULL pointer dereference in VRAM logic for APU devices Sasha Levin
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17] ixgbe: handle IXGBE_VF_FEATURES_NEGOTIATE mbox cmd Sasha Levin
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17] ixgbe: handle IXGBE_VF_GET_PF_LINK_STATE mailbox operation Sasha Levin
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17-6.6] HID: quirks: Add ALWAYS_POLL quirk for VRS R295 steering wheel Sasha Levin
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17] HID: intel-thc-hid: intel-quickspi: Add ARL PCI Device Id's Sasha Levin
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17-6.12] HID: nintendo: Wait longer for initial probe Sasha Levin
2025-10-28  0:39 ` [PATCH AUTOSEL 6.17-6.1] smb/server: fix possible refcount leak in smb2_sess_setup() Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251028003940.884625-16-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alexander.deucher@amd.com \
    --cc=alexandre.f.demers@gmail.com \
    --cc=boyuan.zhang@amd.com \
    --cc=chris@rudorff.com \
    --cc=lijo.lazar@amd.com \
    --cc=mario.limonciello@amd.com \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=sunil.khatri@amd.com \
    --cc=timur.kristof@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).