Skip to contentSkip to conversation

media: ipu6: Close firmware streams on streaming enable failure

PATCH New Sasha Levin 2 participants 128 messages Feb 14 – Feb 16 Page 2 of 2

Subsystems (18)
lore
Share & tools
lore
author maintainer
#95 lore raw

PATCH 1/1 drm/amd/display: Fix mismatched unlock for DMUB HW lock in HWSS fast path

In reply to Sasha Levin

From: Nicholas Kazlauskas <[email protected]>

[ Upstream commit af3303970da5ce5bfe6dffdd07f38f42aad603e0 ]

[Why]
The evaluation for whether we need to use the DMUB HW lock isn't the same as whether we need to unlock which results in a hang when the fast path is used for ASIC without FAMS support.

[How]
Store a flag that indicates whether we should use the lock and use that same flag to specify whether unlocking is needed.

---

LLM Generated explanations, may be completely bogus:

Now I have a complete understanding. Let me summarize my analysis.

---

## Detailed Analysis

### 1. Commit Message Analysis

The commit message is clear and well-structured (AMD's [Why]/[How] format):

- **[Why]:** The evaluation for whether to **acquire** the DMUB HW lock is different from the evaluation for whether to **release** it, which causes a **hang** on ASICs without FAMS support.
- **[How]:** Store the lock requirement decision in a single variable and reuse it for both lock and unlock.
- **Indicators:** "Fix", "hang" — these are strong backport signals.
- **Tags:** Reviewed-by, Tested-by — this has been properly reviewed and tested.

### 2. Code Change Analysis — The Bug Mechanism

The bug is in hwss_build_fast_sequence() in dc_hw_sequencer.c. This function builds a sequence of hardware programming blocks that are executed during fast display updates (page flips, cursor updates, etc.).

**The lock acquisition (line ~765-772 of buggy code):**

```765:772:drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
        if (dc->hwss.dmub_hw_control_lock_fast) {
block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.dc =
dc;
block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.lock
= true;
                block_sequence[*num_steps].params.dmub_hw_control_lock_f
ast_params.is_required =
                        dc_state_is_fams2_in_use(dc, context) ||
                        dmub_hw_lock_mgr_does_link_require_lock(dc,
stream->link);
                block_sequence[*num_steps].func =
DMUB_HW_CONTROL_LOCK_FAST;
```

**The lock release (line ~906-911 of buggy code):**

```906:911:drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
        if (dc->hwss.dmub_hw_control_lock_fast) {
block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.dc =
dc;
block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.lock
= false;
                block_sequence[*num_steps].params.dmub_hw_control_lock_f
ast_params.is_required = dc_state_is_fams2_in_use(dc, context);
                block_sequence[*num_steps].func =
DMUB_HW_CONTROL_LOCK_FAST;
                (*num_steps)++;
```

The critical mismatch:
- **Lock:** is_required = dc_state_is_fams2_in_use(dc, context) || dmub_hw_lock_mgr_does_link_require_lock(dc, stream->link)
- **Unlock:** is_required = dc_state_is_fams2_in_use(dc, context) — **MISSING the dmub_hw_lock_mgr_does_link_require_lock check!**

Looking at dcn401_dmub_hw_control_lock_fast(), when is_required is true, it sends a DMUB inbox0 command to acquire/release a hardware lock. When is_required is false, it does nothing.

**The hang scenario:**
1. FAMS2 is NOT in use (dc_state_is_fams2_in_use() returns false)
2. The link requires lock due to PSR or Replay being enabled (dmub_hw_lock_mgr_does_link_require_lock() returns true)
3. Lock path: is_required = false || true = true → **lock IS acquired**
4. Unlock path: is_required = false → unlock is **NOT performed**
5. The hardware lock is now permanently held → **system hangs**

This is triggered specifically on ASICs that use PSR (Panel Self Refresh) or Replay but do NOT have FAMS2 enabled, which is a real-world configuration (many AMD laptops with eDP panels use PSR).

### 3. Bug Origin

The bug was introduced by commit 7d041982fe11 ("drm/amd/display:
Extend inbox0 lock to run Replay/PSR"), which added the dmub_hw_lock_mgr_does_link_require_lock() call to the **lock** path but forgot to update the **unlock** path. That commit first appeared in v6.19-rc1.

### 4. The Fix

The fix is minimal and surgical — it introduces a local boolean variable is_dmub_lock_required that stores the lock decision once, then reuses it for both lock and unlock:

```c
bool is_dmub_lock_required = false;
// ...
if (dc->hwss.dmub_hw_control_lock_fast) {
    is_dmub_lock_required = dc_state_is_fams2_in_use(dc, context) ||
                            dmub_hw_lock_mgr_does_link_require_lock(dc,
stream->link);
    // ... lock with is_dmub_lock_required ...
}
// ... later ...
if (dc->hwss.dmub_hw_control_lock_fast) {
    // ... unlock with is_dmub_lock_required (same value!) ...
}
```

This guarantees the lock and unlock always use the same is_required value.

### 5. Scope and Risk Assessment

- **Files changed:** 1 file (dc_hw_sequencer.c)
- **Lines changed:** ~6 lines net (variable declaration + 3 modified lines)
- **Risk:** Extremely low — the fix is purely ensuring consistent behavior between lock/unlock. No new logic, no behavioral changes for correctly-working paths.
- **Subsystem:** AMD display driver (amdgpu/dc), which is widely used on AMD GPUs

### 6. User Impact

- **Severity:** **System hang** — this is a hard hang when the DMUB hardware lock is held permanently. The GPU display hardware becomes unresponsive, likely requiring a reboot.
- **Who is affected:** Users with AMD GPUs using PSR or Replay (eDP laptop panels) on ASICs without FAMS2 support. This is a common laptop configuration.
- **Trigger:** Normal display fast-path updates (page flips) — this is a hot path exercised during normal display operation.

### 7. Stability Indicators

- Reviewed-by: Swapnil Patel — peer reviewed
- Tested-by: Daniel Wheeler — tested by AMD's QA
- The author (Nicholas Kazlauskas) is a key AMD display developer
- The fix is obviously correct by inspection — lock/unlock must use the same condition

### 8. Dependencies

The fix depends on commit 7d041982fe11 ("Extend inbox0 lock to run Replay/PSR") being present. That commit introduced the bug and is in v6.19-rc1 and later. The fix only needs to go to stable trees that contain the buggy commit. The hwss_build_fast_sequence function itself has existed since v6.10 (commit 5324e2b205a2), but the specific bug was only introduced by the inbox0 extension in 6.19-rc1.

Since the buggy commit went into v6.19-rc1, the fix would primarily target the 6.19.y stable tree. If the buggy commit was also backported to earlier stable trees, the fix should follow it.

### 9. Classification

This is a clear **bug fix** for a **system hang** caused by **mismatched lock/unlock logic**. It:
- Fixes a real bug (hardware lock never released → hang)
- Is obviously correct (use the same condition for lock and unlock)
- Is small and surgical (6 lines changed in 1 file)
- Does not introduce any new features or APIs
- Has been reviewed and tested
- Fixes a severe user-visible issue (system hang)

**YES** — this commit should be backported to stable kernel trees.

**YES**

 drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +6 -4
index e2763b60482a0..052d573408c3e 100644
@@ -741,6 +741,7 @@ void hwss_build_fast_sequence(struct dc *dc,
 	struct dce_hwseq *hws = dc->hwseq;
 	struct pipe_ctx *current_pipe = NULL;
 	struct pipe_ctx *current_mpc_pipe = NULL;
+	bool is_dmub_lock_required = false;
 	unsigned int i = 0;
 
 	*num_steps = 0; // Initialize to 0
@@ -763,11 +764,12 @@ void hwss_build_fast_sequence(struct dc *dc,
 		(*num_steps)++;
 	}
 	if (dc->hwss.dmub_hw_control_lock_fast) {
+		is_dmub_lock_required = dc_state_is_fams2_in_use(dc, context) ||
+					dmub_hw_lock_mgr_does_link_require_lock(dc, stream->link);
+
 		block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.dc = dc;
 		block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.lock = true;
-		block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.is_required =
-			dc_state_is_fams2_in_use(dc, context) ||
-			dmub_hw_lock_mgr_does_link_require_lock(dc, stream->link);
+		block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.is_required = is_dmub_lock_required;
 		block_sequence[*num_steps].func = DMUB_HW_CONTROL_LOCK_FAST;
 		(*num_steps)++;
 	}
@@ -906,7 +908,7 @@ void hwss_build_fast_sequence(struct dc *dc,
 	if (dc->hwss.dmub_hw_control_lock_fast) {
 		block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.dc = dc;
 		block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.lock = false;
-		block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.is_required = dc_state_is_fams2_in_use(dc, context);
+		block_sequence[*num_steps].params.dmub_hw_control_lock_fast_params.is_required = is_dmub_lock_required;
 		block_sequence[*num_steps].func = DMUB_HW_CONTROL_LOCK_FAST;
 		(*num_steps)++;
 	}
Signature · 1 line
2.51.0
author maintainer
#96 lore raw

PATCH 1/1 hwmon: (nct6775) Add ASUS Pro WS WRX90E-SAGE SE

In reply to Sasha Levin

From: Denis Pauk <[email protected]>

[ Upstream commit 246167b17c14e8a5142368ac6457e81622055e0a ]

Boards Pro WS WRX90E-SAGE SE has got a nct6775 chip, but by default there's no use of it because of resource conflict with WMI method.

Add the board to the WMI monitoring list.

---

LLM Generated explanations, may be completely bogus:

## Analysis

### Commit Message Analysis
This commit adds a board identifier string ("Pro WS WRX90E-SAGE SE") to the asus_msi_boards[] list in the nct6775 hwmon driver. The commit message explains that this ASUS motherboard has an nct6775 hardware monitoring chip, but it cannot be used by default due to a resource conflict with WMI methods. Adding the board to the WMI monitoring list resolves this conflict and enables hardware monitoring.

### Code Change Analysis
The change is a **single line addition** — inserting one string into an alphabetically sorted list of board names:

```c
"Pro WS WRX90E-SAGE SE",
```

This is inserted between "Pro WS W790E-SAGE SE" and "ProArt B650-CREATOR", maintaining alphabetical order. No logic changes, no new functions, no structural modifications.

### Classification: Hardware Quirk / Device ID Addition
This falls squarely into the **"hardware quirks/workarounds"** exception category for stable backports. The asus_msi_boards[] list is effectively a board-level quirk table that tells the driver to use WMI- based monitoring instead of direct I/O, resolving the resource conflict. Without this entry, users of this specific motherboard cannot use hardware monitoring at all.

### Stability Indicators
- **Tested-by:** Marcus confirmed the fix works on the actual hardware
- **Bug report link:**
https://bugzilla.kernel.org/show_bug.cgi?id=204807 — this is a documented real-world issue
- **Reviewed and merged by:** Guenter Roeck, the hwmon subsystem maintainer
- **Pattern:** Identical to dozens of other board additions in this same file that have been backported to stable

### Risk Assessment
- **Risk: Extremely low.** Adding a string to a board match list cannot affect any other board or any other code path. The match is exact — only the "Pro WS WRX90E-SAGE SE" board is affected.
- **Scope:** Single line in a single file
- **Dependencies:** None — the WMI monitoring infrastructure already exists in stable trees
- **Regression potential:** Essentially zero

### User Impact
Without this fix, users of the ASUS Pro WS WRX90E-SAGE SE motherboard (a workstation-class board) have no hardware monitoring capability. This is a real user-reported bug (kernel bugzilla #204807) with a tested fix.

### Stable Criteria Check
1. **Obviously correct and tested:** Yes — single string addition, tested by user
2. **Fixes a real bug:** Yes — hardware monitoring doesn't work without it
3. **Important issue:** Yes — complete loss of hwmon functionality for this board
4. **Small and contained:** Yes — one line
5. **No new features:** Correct — enables existing functionality on specific hardware
6. **Applies cleanly:** Very likely — it's a simple list insertion

**YES**

 drivers/hwmon/nct6775-platform.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/nct6775-platform.c +1 -0
index c3a719aef1ace..555029dfe713f 100644
@@ -1357,6 +1357,7 @@ static const char * const asus_msi_boards[] = {
 	"Pro WS W680-ACE IPMI",
 	"Pro WS W790-ACE",
 	"Pro WS W790E-SAGE SE",
+	"Pro WS WRX90E-SAGE SE",
 	"ProArt B650-CREATOR",
 	"ProArt B660-CREATOR D4",
 	"ProArt B760-CREATOR D4",
Signature · 1 line
2.51.0
author maintainer
#97 lore raw

PATCH 1/1 hwmon: (nct7363) Fix a resource leak in nct7363_present_pwm_fanin

In reply to Sasha Levin

From: Felix Gu <[email protected]>

[ Upstream commit 4923bbff0bcffe488b3aa76829c829bd15b02585 ]

When calling of_parse_phandle_with_args(), the caller is responsible to call of_node_put() to release the reference of device node. In nct7363_present_pwm_fanin, it does not release the reference, causing a resource leak.

---

LLM Generated explanations, may be completely bogus:

The driver was first included in v6.13. This means it's only available in relatively recent stable trees (6.13.y and later, if those are maintained as stable). It won't be applicable to older LTS trees like 6.6.y or 6.1.y since the driver doesn't exist there.

### User Impact

For systems using the NCT7363Y hardware monitoring chip (common in server/embedded platforms), this leak occurs during driver probe. While a single leak may be small, in systems with deferred probing or module load/unload cycles, it can accumulate. The fix ensures proper cleanup.

### Conclusion

This is a textbook stable backport candidate:
- **Obviously correct**: Standard of_node_put() pattern used thousands of times in the kernel
- **Fixes a real bug**: Resource leak on every probe
- **Minimal risk**: 1 line addition, correctly placed
- **Small and contained**: Single file, single function

The only caveat is that the driver is relatively new (v6.13+), so the backport only applies to recent stable trees. But for those trees where it applies, this is clearly appropriate.

**YES**

 drivers/hwmon/nct7363.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hwmon/nct7363.c +1 -0
index 71cef794835df..47fc1b4a0f3f9 100644
@@ -349,6 +349,7 @@ static int nct7363_present_pwm_fanin(struct device *dev,
 	if (ret)
 		return ret;
 
+	of_node_put(args.np);
 	if (args.args[0] >= NCT7363_PWM_COUNT)
 		return -EINVAL;
 	data->pwm_mask |= BIT(args.args[0]);
Signature · 1 line
2.51.0
author maintainer
#98 lore raw

PATCH 1/1 ASoC: soc-acpi-intel-ptl-match: use aggregated endpoint in ptl_rt722_l0_rt1320_l23

In reply to Sasha Levin

From: Bard Liao <[email protected]>

[ Upstream commit 4fbd3b2ec04dc6ef93090ec24733a5c5671fb71f ]

The rt722 amp and rt1320 amps are aggregated in this case.

---

LLM Generated explanations, may be completely bogus:

## Analysis

### Commit Message Analysis

The commit changes the ptl_rt722_l0_rt1320_l23 configuration to use "aggregated endpoint" instead of "single endpoint" for the RT722 codec on link 0 when paired with RT1320 amplifiers on links 2 and 3. The commit message is brief: "The rt722 amp and rt1320 amps are aggregated in this case."

### Code Change Analysis

The change does two things:

1. **Adds a new static data structure** rt722_0_agg_adr[] which is identical to rt722_0_single_adr[] except it references jack_amp_g1_dmic_endpoints instead of rt_mf_endpoints.

2. **Switches the reference** in ptl_rt722_l0_rt1320_l23[] from rt722_0_single_adr to rt722_0_agg_adr.

The key difference is the endpoint configuration:
jack_amp_g1_dmic_endpoints vs rt_mf_endpoints. Let me understand what this means.

### What Problem Does This Fix?

This is a configuration fix for SoundWire audio topology on Intel Panther Lake (PTL) platforms. When the RT722 codec and RT1320 amplifiers are used together in an aggregated configuration, they need to use aggregated endpoints (with group information) so the SoundWire bus manager can properly synchronize audio streams across multiple links.

Using the wrong endpoint type (single vs aggregated) would cause the audio topology to be incorrectly configured, potentially resulting in:
- Audio not working at all for this hardware combination
- Incorrect stream synchronization between codec and amplifiers
- Possible audio glitches or failures

This is essentially a **hardware configuration fix** - the wrong endpoint descriptors were being used for this specific hardware topology.

### Stable Kernel Criteria Assessment

1. **Fixes a real bug**: Yes - incorrect endpoint configuration for a specific hardware combination would cause audio to not work properly.

2. **Small and contained**: Yes - adds one small data structure and changes two lines to reference it. Very localized to one file.

3. **Obviously correct**: The change is straightforward - using aggregated endpoints when devices are aggregated is the correct behavior.

4. **No new features**: This is a configuration correction, not a new feature.

### Concerns

1. **Platform maturity**: Panther Lake (PTL) is a very new Intel platform. The soc-acpi-intel-ptl-match.c file contains match tables for this new platform. The question is whether this code even exists in current stable trees. PTL support was likely added in very recent kernel versions (6.12 or later), so it may only be relevant to the most recent stable branches.

2. **Dependencies**: The jack_amp_g1_dmic_endpoints and rt_mf_endpoints structures must already exist. Since this file is already using both elsewhere, there shouldn't be dependency issues.

3. **Risk**: Very low. The change only affects one specific hardware configuration (ptl_rt722_l0_rt1320_l23). It cannot affect any other hardware.

### Classification

This falls into the category of a **hardware configuration fix** for audio on a specific platform. It's similar to hardware quirks - it corrects the configuration for a specific hardware combination to make it work properly. Users with this specific hardware (RT722 + RT1320 on Intel PTL) would have broken audio without this fix.

### Risk vs Benefit

- **Risk**: Extremely low - only affects one specific hardware topology table entry
- **Benefit**: Makes audio work correctly for users with this hardware combination

### Decision

This is a small, well-contained fix that corrects incorrect audio hardware configuration data for Intel Panther Lake platforms. It's similar in nature to device ID additions or hardware quirks - it makes specific hardware work correctly. The change is low risk and high value for affected users. However, PTL is a very new platform, and this fix is only relevant to kernel versions that already have PTL audio support. For those versions, it should be backported.

**YES**

 sound/soc/intel/common/soc-acpi-intel-ptl-match.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
sound/soc/intel/common/soc-acpi-intel-ptl-match.c +11 -2
index e297c8ecedb72..1055fb4838f61 100644
@@ -383,6 +383,15 @@ static const struct snd_soc_acpi_link_adr ptl_rt721_l3[] = {
 	{},
 };
 
+static const struct snd_soc_acpi_adr_device rt722_0_agg_adr[] = {
+	{
+		.adr = 0x000030025d072201ull,
+		.num_endpoints = ARRAY_SIZE(jack_amp_g1_dmic_endpoints),
+		.endpoints = jack_amp_g1_dmic_endpoints,
+		.name_prefix = "rt722"
+	}
+};
+
 static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {
 	{
 		.adr = 0x000030025d072201ull,
@@ -536,8 +545,8 @@ static const struct snd_soc_acpi_link_adr ptl_rt722_l3[] = {
 static const struct snd_soc_acpi_link_adr ptl_rt722_l0_rt1320_l23[] = {
 	{
 		.mask = BIT(0),
-		.num_adr = ARRAY_SIZE(rt722_0_single_adr),
-		.adr_d = rt722_0_single_adr,
+		.num_adr = ARRAY_SIZE(rt722_0_agg_adr),
+		.adr_d = rt722_0_agg_adr,
 	},
 	{
 		.mask = BIT(2),
Signature · 1 line
2.51.0
author maintainer
#99 lore raw

PATCH 1/1 gpio: pca953x: Add support for TCAL6408 TCAL6416

In reply to Sasha Levin

From: Jan Remmet <[email protected]>

[ Upstream commit a30a9cb9bca4296d25f253619883e7013b6be158 ]

TCAL6408 and TCAL6416 supports latchable inputs and maskable interrupt. Tested on a TCAL6416, checked datasheets for the TCAL6408.

They use the same programming model ad the NXP PCAL64xx, but support a lower supply power (1.08V to 3.6V) compared to PCAL (1.65V to 5.5V)

Datasheet: https://www.ti.com/lit/ds/symlink/tcal6408.pdf
Datasheet: https://www.ti.com/lit/ds/symlink/tcal6416.pdf

---

LLM Generated explanations, may be completely bogus:

Good - there's no fallback compatible mechanism here. Each chip gets its own compatible string.

## Complete Analysis

### 1. Commit Message Analysis

The commit message is clear and well-structured:
- Explicitly states the chips use "the same programming model as the NXP PCAL64xx"
- Only difference is supply voltage range (1.08V-3.6V vs 1.65V-5.5V)
- References both datasheets for verification
- States it was "Tested on a TCAL6416" — author has real hardware
- The author (from phytec.de, an embedded hardware company) has a clear use case

### 2. Code Change Analysis

The changes are **purely table additions**:

**I2C device ID table** (pca953x_id[]): Adds 2 entries:
- { "tcal6408", 8 | PCA953X_TYPE | PCA_LATCH_INT, } — 8-bit GPIO expander with PCAL features
- { "tcal6416", 16 | PCA953X_TYPE | PCA_LATCH_INT, } — 16-bit GPIO expander with PCAL features

These use the exact same type flags (PCA953X_TYPE | PCA_LATCH_INT) as the already-supported pcal6408 and pcal6416, confirming identical register layout handling.

**OF match table** (pca953x_dt_ids[]): Adds 2 entries:
- { .compatible = "ti,tcal6408", .data = OF_953X(8, PCA_LATCH_INT), }
- { .compatible = "ti,tcal6416", .data = OF_953X(16, PCA_LATCH_INT), }

**Kconfig**: Updates help text to list the new chip names (purely cosmetic).

**No new code paths**, no new functions, no new registers, no new logic. The PCA_LATCH_INT flag (PCA_PCAL | PCA_INT) already enables all the extended PCAL register handling throughout the driver (input latching, interrupt masking, pull-up/down config, interrupt status).

### 3. Classification

This is a textbook **new device ID** addition to an existing driver. The analysis guidelines explicitly call this out:

Quoted 1 line

NEW DEVICE IDs (Very Common): Adding PCI IDs, USB IDs, ACPI IDs, etc.

to existing drivers. These are trivial one-line additions that enable hardware support. Rule: The driver must already exist in stable; only the ID is new.

The pca953x driver exists in all stable trees (it's been in the kernel for over 15 years). The TCAL chips use the exact same PCAL register model that's already fully supported.

### 4. Scope and Risk Assessment

- **Lines changed**: ~10 lines across 2 files (Kconfig help text + device tables)
- **Files touched**: 2 (Kconfig, gpio-pca953x.c)
- **Risk**: Essentially zero. Table entries can only affect systems with these specific chips. No existing functionality is modified.
- **Merge conflicts**: The entries are added at the end of their respective groups, so conflicts are unlikely unless another chip was added in the same spot.

### 5. User Impact

- Users with TCAL6408 or TCAL6416 on their boards (embedded systems, industrial boards) cannot use these chips without this patch
- Without this patch, the hardware is completely non-functional for these users
- Phytec (the author's company) ships embedded modules that likely use these chips

### 6. Dependencies

- The DT binding YAML update (patch 1-2 of the series) is needed for dt_binding_check but is NOT needed for the driver to function. A device tree using compatible = "ti,tcal6408" or compatible = "ti,tcal6416" will be matched by the driver with just this patch.
- No code dependencies on other patches.

### 7. Precedent

The exact same pattern has been used many times for this driver. For example:
- 82466bb622e92 "gpio: pca953x: Add support for TI TCA9535 variant" — same pattern, same situation (lower voltage TI variant of NXP chip)
- 6c99a046edfac "gpio: pca953x: Add support for TI TCA6418"
- a9e49635e263b "gpio: pca953xx: Add support for pca6408"

### Summary

This is a pure device ID addition to a well-established, widely-used GPIO expander driver. The TCAL6408/TCAL6416 are Texas Instruments chips that are register-compatible with the already-supported NXP PCAL6408/PCAL6416. The change adds only table entries (I2C device IDs and OF compatible strings) and zero new code logic. It enables real hardware for real users (tested on actual hardware), with effectively zero risk of regression to existing users. This is precisely the kind of "device ID addition" that stable kernel guidelines explicitly allow as an exception.

**YES**

 drivers/gpio/Kconfig        | 4 ++--
 drivers/gpio/gpio-pca953x.c | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/gpio/Kconfig +2 -2
index bd185482a7fdf..3439e025ba1c6 100644
@@ -1193,11 +1193,11 @@ config GPIO_PCA953X
 
 	  8 bits:       max7310, max7315, pca6107, pca9534, pca9538, pca9554,
 	                pca9556, pca9557, pca9574, tca6408, tca9554, xra1202,
-			pcal6408, pcal9554b, tca9538
+			pcal6408, pcal9554b, tca9538, tcal6408
 
 	  16 bits:      max7312, max7313, pca9535, pca9539, pca9555, pca9575,
 	                tca6416, pca6416, pcal6416, pcal9535, pcal9555a, max7318,
-			tca9539
+			tca9539, tcal6416
 
 	  18 bits:	tca6418
 
drivers/gpio/gpio-pca953x.c +6 -0
index f93a3dbb2daaf..52e96cc5f67bb 100644
@@ -126,6 +126,9 @@ static const struct i2c_device_id pca953x_id[] = {
 	{ "tca9539", 16 | PCA953X_TYPE | PCA_INT, },
 	{ "tca9554", 8  | PCA953X_TYPE | PCA_INT, },
 	{ "xra1202", 8  | PCA953X_TYPE },
+
+	{ "tcal6408", 8  | PCA953X_TYPE | PCA_LATCH_INT, },
+	{ "tcal6416", 16 | PCA953X_TYPE | PCA_LATCH_INT, },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, pca953x_id);
@@ -1469,6 +1472,9 @@ static const struct of_device_id pca953x_dt_ids[] = {
 	{ .compatible = "ti,tca9538", .data = OF_953X( 8, PCA_INT), },
 	{ .compatible = "ti,tca9539", .data = OF_953X(16, PCA_INT), },
 
+	{ .compatible = "ti,tcal6408", .data = OF_953X( 8, PCA_LATCH_INT), },
+	{ .compatible = "ti,tcal6416", .data = OF_953X(16, PCA_LATCH_INT), },
+
 	{ .compatible = "onnn,cat9554", .data = OF_953X( 8, PCA_INT), },
 	{ .compatible = "onnn,pca9654", .data = OF_953X( 8, PCA_INT), },
 	{ .compatible = "onnn,pca9655", .data = OF_953X(16, PCA_INT), },
Signature · 1 line
2.51.0
author maintainer
#100 lore raw

PATCH 1/1 media: chips-media: wave5: Process ready frames when CMD_STOP sent to Encoder

In reply to Sasha Levin

From: Brandon Brnich <[email protected]>

[ Upstream commit 5da0380de41439ed64ed9a5218850db38544e315 ]

CMD_STOP being sent to encoder before last job is executed by device_run can lead to an occasional dropped frame. Ensure that remaining ready buffers are drained by making a call to v4l2_m2m_try_schedule.

---

LLM Generated explanations, may be completely bogus:

Here is my complete analysis:

---

## Analysis of: "media: chips-media: wave5: Process ready frames when CMD_STOP sent to Encoder"

### 1. COMMIT MESSAGE ANALYSIS

The commit message clearly describes a bug: **CMD_STOP being sent to the encoder before the last job is executed by device_run can lead to an occasional dropped frame.** The fix is to call v4l2_m2m_try_schedule() to ensure remaining ready buffers are drained. This is a data integrity issue - users lose the last frame of their encoded video.

### 2. CODE CHANGE ANALYSIS

The change is a **two-line addition** (one blank line + one function call) in wave5_vpu_enc_encoder_cmd():

```653:654:drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
                m2m_ctx->is_draining = true;

                v4l2_m2m_try_schedule(m2m_ctx);
```

**The bug mechanism:**

When userspace sends V4L2_ENC_CMD_STOP, the driver:
1. Sets m2m_ctx->last_src_buf to the last queued source buffer
2. Sets m2m_ctx->is_draining = true
3. Returns - **without triggering the m2m scheduler**

The problem is a race: if CMD_STOP arrives between when the last buffer is queued and when device_run picks it up, the m2m framework has no trigger to schedule the remaining work. The wave5_vpu_enc_job_ready() callback (line 1542) checks is_draining and returns true to indicate the encoder is ready for a drain job - but nobody calls the scheduler to check this.

v4l2_m2m_try_schedule() simply calls __v4l2_m2m_try_queue() + v4l2_m2m_try_run() - it checks if there's work ready and runs it. It's completely safe - if there's nothing to do, it returns without side effects.

### 3. COMPARISON WITH OTHER DRIVERS

This is an **inconsistency bug** that's obvious when comparing with other m2m codec drivers:

- **wave5 decoder** (wave5_vpu_dec_decoder_cmd, line 888): Already calls v4l2_m2m_try_schedule(m2m_ctx) after DEC_CMD_STOP, with the comment "Just in case we don't have anything to decode anymore"
- **MediaTek encoder** (vidioc_encoder_cmd in mtk_vcodec_enc.c, line 734): Calls v4l2_m2m_try_schedule(ctx->m2m_ctx) after ENC_CMD_STOP
- **MediaTek decoder** (stateful_decoder_cmd, line 116): Same pattern
- **CODA decoder** (coda_decoder_cmd, line 1268): Same pattern

The wave5 encoder was the **only** m2m encoder/decoder driver that set is_draining = true without calling v4l2_m2m_try_schedule(). This is clearly a bug present since the driver's initial submission.

### 4. CLASSIFICATION

**Bug fix** - fixes dropped frames (data loss) during video encoding drain. Not a feature, not cleanup.

### 5. SCOPE AND RISK ASSESSMENT

- **Lines changed**: 2 (1 blank + 1 function call)
- **Files touched**: 1
- **Risk**: Extremely low. v4l2_m2m_try_schedule() is the standard V4L2 m2m API for triggering job scheduling. It's called in every other similar driver. It's safe to call at any time - if conditions aren't met for scheduling a job, it simply returns.
- **Subsystem**: media/chips-media/wave5 - a hardware video encoder driver for Chips&Media Wave5 IP used on TI platforms

### 6. USER IMPACT

Users encoding video with the Wave5 hardware encoder (e.g., on TI AM62x/AM62Ax platforms) can **lose the last frame** when stopping encoding. This is a real data integrity issue for anyone doing video encoding with this hardware. The symptom is intermittent, making it harder to diagnose.

### 7. STABILITY INDICATORS

- **Reviewed-by**: Nicolas Dufresne (Collabora - well-known V4L2/GStreamer developer)
- **Signed-off-by**: Hans Verkuil (media subsystem co-maintainer)
- **Author**: Brandon Brnich from TI (the SoC vendor that ships this IP)
- The fix follows established patterns from other drivers

### 8. DEPENDENCY CHECK

**No dependencies.** This is a self-contained one-line fix that adds a call to an existing exported V4L2 m2m API function. The v4l2_m2m_try_schedule() function has been available since long before the wave5 driver was added.

### 9. STABLE TREE APPLICABILITY

The wave5 driver was added in v6.8-rc1 (commit 9707a6254a8a6). It exists in stable trees 6.8.y and later. The fix should apply cleanly since the wave5_vpu_enc_encoder_cmd function hasn't changed significantly since it was added.

### Summary

This is a textbook stable-worthy fix:
- **Small**: 2 lines added
- **Obviously correct**: Matches the pattern used by every other V4L2 m2m encoder/decoder driver
- **Fixes a real bug**: Dropped frames during encoding drain (data loss)
- **Low risk**: Uses standard API, no side effects if conditions aren't met
- **Well-reviewed**: By V4L2 experts and the media subsystem maintainer
- **Self-contained**: No dependencies on other patches

**YES**

 drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c +2 -0
index bca881a0a1617..8e3dd9e34abc3 100644
@@ -649,6 +649,8 @@ static int wave5_vpu_enc_encoder_cmd(struct file *file, void *fh, struct v4l2_en
 
 		m2m_ctx->last_src_buf = v4l2_m2m_last_src_buf(m2m_ctx);
 		m2m_ctx->is_draining = true;
+
+		v4l2_m2m_try_schedule(m2m_ctx);
 		break;
 	case V4L2_ENC_CMD_START:
 		break;
Signature · 1 line
2.51.0
author maintainer
#101 lore raw

PATCH 1/1 ASoC: SOF: ipc4: Support for sending payload along with LARGE_CONFIG_GET

In reply to Sasha Levin

From: Peter Ujfalusi <[email protected]>

[ Upstream commit d96cb0b86d6e8bbbbfa425771606f6c1aebc318e ]

There are message types when we would need to send a payload along with the LARGE_CONFIG_GET message to provide information to the firmware on what data is requested.
Such cases are the ALSA Kcontrol related messages when the high level param_id tells only the type of the control, but the ID/index of the exact control is specified in the payload area.

The caller must place the payload for TX before calling the set_get_data() and this payload will be sent alongside with the message to the firmware.

The data area will be overwritten by the received data from firmware.

---

LLM Generated explanations, may be completely bogus:

Now I have a complete understanding. Here's my analysis:

---

## Comprehensive Analysis

### 1. COMMIT MESSAGE ANALYSIS

The subject is "ASoC: SOF: ipc4: Support for sending payload along with LARGE_CONFIG_GET". The commit message says:

Quoted 1 line

"There are message types when we would need to send a payload along

with the LARGE_CONFIG_GET message to provide information to the firmware on what data is requested."

The specific case it mentions is for ALSA Kcontrol-related messages where the param_id only tells the type of control (switch or enum), but the **ID/index of the exact control is specified in the payload area**. Without this patch, the firmware **cannot know which control** is being queried.

The message also says: "The data area will be overwritten by the received data from firmware." This explains the kmemdup approach — the TX payload needs to be saved before it's overwritten by the RX response.

### 2. CODE CHANGE ANALYSIS

**The Bug:**

In sof_ipc4_refresh_generic_control() (in ipc4-control.c, line 243-285), the caller:
1. Allocates sof_ipc4_control_msg_payload
2. Sets data->id = cdata->index and data->num_elems = scontrol->num_channels
3. Points msg->data_ptr = data and msg->data_size = data_size
4. Calls sof_ipc4_set_get_kcontrol_data(scontrol, false, true) (set=false → GET operation)

This flows into sof_ipc4_set_get_data(). In the **old code** (before this patch), when set=false (GET), the code did:

```c
tx_size = 0;
rx_size = chunk_size;
```

This means tx_size = 0 — **the payload containing id and num_elems is NEVER sent to the firmware**. The firmware receives a LARGE_CONFIG_GET request without knowing which specific switch/enum control is being queried. For switch and enum controls (param_ids 200 and 201), the param_id alone is not enough — the firmware needs the control ID in the payload to know which specific control to return data for.

**The Fix:**

The patch adds a helper function sof_ipc4_tx_payload_for_get_data() that checks if the message is for switch or enum controls (param_id 200 or 201). If so, it:

1. Uses kmemdup() to save the TX payload (because data_ptr will be overwritten by the response)
2. Sets tx_size and tx.data_ptr in the GET path so the payload IS sent
3. Properly frees the backup buffer on all code paths (error and success)

**What happens without the fix:**
When firmware sends a notification that a switch/enum control changed, the comp_data_dirty flag is set. On the next sof_ipc4_switch_get() or sof_ipc4_enum_get() call, sof_ipc4_refresh_generic_control() tries to fetch the new control values from firmware, but **fails** because the firmware can't identify which control to return data for (it receives no payload with the GET request). This means ALSA mixer applications (like alsamixer, PulseAudio/PipeWire) get **wrong or stale control values** — a functional bug for real audio users.

### 3. CLASSIFICATION

This is a **functional bug fix**. Without it, reading switch/enum kcontrol values from SOF firmware after a notification fails to return correct data. The commit message frames it as "support for" but it is really fixing broken functionality — the sof_ipc4_refresh_generic_control function was already calling set_get_data with a payload expecting it to be sent, but the lower layer was silently discarding it.

It is NOT a new feature — the switch/enum control GET path already exists (since v6.7). The payload was already being prepared by the caller. The bug is that the IPC layer was not transmitting it.

### 4. SCOPE AND RISK ASSESSMENT

- **Files changed:** 1 (sound/soc/sof/ipc4.c)
- **Lines added:** ~50 (new helper function + modifications to existing function)
- **Complexity:** Moderate — adds a kmemdup/kfree for specific param_ids
- **Risk:** Low — the change only affects the GET path for switch/enum controls (param_ids 200, 201). All other GET operations continue to behave exactly as before (sof_ipc4_tx_payload_for_get_data returns false, no change in behavior).
- **Memory management:** The kmemdup buffer is properly freed on all paths (early error return, normal exit).
- **Self-contained:** Yes, the patch only modifies ipc4.c and adds an include for constants that already exist in the tree.

### 5. USER IMPACT

- **Who is affected:** All Intel SOF audio users with switch or enum kcontrols that receive firmware notifications (this is common for hardware-managed controls on modern Intel platforms like Meteor Lake and newer).
- **Symptom:** ALSA kcontrols report stale/wrong values after firmware changes them (e.g., mic privacy hardware switches, audio routing enums).
- **Severity:** Medium-high — incorrect audio control states affect real audio functionality.

### 6. STABILITY INDICATORS

- **4 Reviewed-by tags** from Intel SOF team members (Seppo Ingalsuo, Ranjani Sridharan, Bard Liao, Kai Vehmanen)
- **Accepted by Mark Brown** (ASoC subsystem maintainer)
- **Author is subsystem maintainer** (Peter Ujfalusi is a SOF maintainer)

### 7. DEPENDENCY CHECK

- Requires SOF_IPC4_SWITCH_CONTROL_PARAM_ID and SOF_IPC4_ENUM_CONTROL_PARAM_ID from ipc4-topology.h — these were added in v6.7 (commit 4a2fd607b7ca)
- Requires sof_ipc4_refresh_generic_control which was added in v6.8 (commit f5eb9945cf9c)
- The patch adds #include "ipc4-topology.h" to ipc4.c — this is a trivial include addition
- The SOF_IPC4_MOD_EXT_MSG_PARAM_ID_MASK is in include/sound/sof/ipc4/header.h (available in all relevant stable trees)
- **Self-contained:** The patch applies cleanly without other dependencies beyond what's already in stable trees ≥6.7

### 8. CONCERNS

- This is part of a larger patch series (patch 7 of N), but examining the code shows it is **self-contained** — it modifies only sof_ipc4_set_get_data() in ipc4.c, not the callers
- The commit message says "Support for sending payload" which sounds like a feature, but the analysis shows it's fixing an existing broken GET path for switch/enum controls
- The sof_ipc4_tx_payload_for_get_data helper uses a switch statement that currently only matches 2 param_ids — if future param_ids need this treatment, they'd need to be added, but that's expected for an explicitly enumerated list

### CONCLUSION

This commit fixes a real functional bug where ALSA switch and enum kcontrol GET operations from SOF firmware fail to send the required payload (control ID/index) to the firmware, causing the firmware to not know which control is being queried. This results in incorrect/stale control values being reported to userspace audio applications. The fix is small (~50 lines in one file), self-contained, well-reviewed by 4 domain experts, low-risk (only affects 2 specific param_ids in the GET path), and fixes a real user-visible audio issue. It applies cleanly to stable trees v6.7+.

However, the critical concern is that this is labeled as "patch 7" of a series, and the remaining patches in the series likely depend on this behavior. Without knowing if the other patches add callers that depend on this, the standalone value is limited to fixing sof_ipc4_refresh_generic_control() which was already sending payloads that were being silently dropped. The existing caller (sof_ipc4_refresh_generic_control) does set data->id and data->num_elems before calling the GET, expecting it to be sent — so this IS fixing existing broken functionality, not just enabling future functionality.

The fix addresses a real bug for SOF audio users and meets stable criteria.

**YES**

 sound/soc/sof/ipc4.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 42 insertions(+), 2 deletions(-)
sound/soc/sof/ipc4.c +42 -2
index a4a090e6724a6..20d723f48fff0 100644
@@ -15,6 +15,7 @@
 #include "sof-audio.h"
 #include "ipc4-fw-reg.h"
 #include "ipc4-priv.h"
+#include "ipc4-topology.h"
 #include "ipc4-telemetry.h"
 #include "ops.h"
 
@@ -433,6 +434,23 @@ static int sof_ipc4_tx_msg(struct snd_sof_dev *sdev, void *msg_data, size_t msg_
 	return ret;
 }
 
+static bool sof_ipc4_tx_payload_for_get_data(struct sof_ipc4_msg *tx)
+{
+	/*
+	 * Messages that require TX payload with LARGE_CONFIG_GET.
+	 * The TX payload is placed into the IPC message data section by caller,
+	 * which needs to be copied to temporary buffer since the received data
+	 * will overwrite it.
+	 */
+	switch (tx->extension & SOF_IPC4_MOD_EXT_MSG_PARAM_ID_MASK) {
+	case SOF_IPC4_MOD_EXT_MSG_PARAM_ID(SOF_IPC4_SWITCH_CONTROL_PARAM_ID):
+	case SOF_IPC4_MOD_EXT_MSG_PARAM_ID(SOF_IPC4_ENUM_CONTROL_PARAM_ID):
+		return true;
+	default:
+		return false;
+	}
+}
+
 static int sof_ipc4_set_get_data(struct snd_sof_dev *sdev, void *data,
 				 size_t payload_bytes, bool set)
 {
@@ -444,6 +462,8 @@ static int sof_ipc4_set_get_data(struct snd_sof_dev *sdev, void *data,
 	struct sof_ipc4_msg tx = {{ 0 }};
 	struct sof_ipc4_msg rx = {{ 0 }};
 	size_t remaining = payload_bytes;
+	void *tx_payload_for_get = NULL;
+	size_t tx_data_size = 0;
 	size_t offset = 0;
 	size_t chunk_size;
 	int ret;
@@ -469,10 +489,20 @@ static int sof_ipc4_set_get_data(struct snd_sof_dev *sdev, void *data,
 
 	tx.extension |= SOF_IPC4_MOD_EXT_MSG_FIRST_BLOCK(1);
 
+	if (sof_ipc4_tx_payload_for_get_data(&tx)) {
+		tx_data_size = min(ipc4_msg->data_size, payload_limit);
+		tx_payload_for_get = kmemdup(ipc4_msg->data_ptr, tx_data_size,
+					     GFP_KERNEL);
+		if (!tx_payload_for_get)
+			return -ENOMEM;
+	}
+
 	/* ensure the DSP is in D0i0 before sending IPC */
 	ret = snd_sof_dsp_set_power_state(sdev, &target_state);
-	if (ret < 0)
+	if (ret < 0) {
+		kfree(tx_payload_for_get);
 		return ret;
+	}
 
 	/* Serialise IPC TX */
 	mutex_lock(&sdev->ipc->tx_mutex);
@@ -506,7 +536,15 @@ static int sof_ipc4_set_get_data(struct snd_sof_dev *sdev, void *data,
 			rx.data_size = chunk_size;
 			rx.data_ptr = ipc4_msg->data_ptr + offset;
 
-			tx_size = 0;
+			if (tx_payload_for_get) {
+				tx_size = tx_data_size;
+				tx.data_size = tx_size;
+				tx.data_ptr = tx_payload_for_get;
+			} else {
+				tx_size = 0;
+				tx.data_size = 0;
+				tx.data_ptr = NULL;
+			}
 			rx_size = chunk_size;
 		}
 
@@ -553,6 +591,8 @@ static int sof_ipc4_set_get_data(struct snd_sof_dev *sdev, void *data,
 
 	mutex_unlock(&sdev->ipc->tx_mutex);
 
+	kfree(tx_payload_for_get);
+
 	return ret;
 }
 
Signature · 1 line
2.51.0
author maintainer
#102 lore raw

PATCH 1/1 ALSA: hda/conexant: Add headset mic fix for MECHREVO Wujie 15X Pro

In reply to Sasha Levin

From: gongqi <[email protected]>

[ Upstream commit f2581ea2d9f30844c437e348a462027ea25c12e9 ]

The headset microphone on the MECHREVO Wujie 15X Pro requires the CXT_FIXUP_HEADSET_MIC quirk to function properly. Add the PCI SSID (0x1d05:0x3012) to the quirk table.

---

LLM Generated explanations, may be completely bogus:

## Analysis

### Commit Message Analysis

This commit adds a hardware quirk (CXT_FIXUP_HEADSET_MIC) for the MECHREVO Wujie 15X Pro laptop, identified by PCI SSID 0x1d05:0x3012. The headset microphone does not function without this quirk entry. This is a straightforward audio codec quirk addition.

### Code Change Analysis

The change is a single line addition:

```c
SND_PCI_QUIRK(0x1d05, 0x3012, "MECHREVO Wujie 15X Pro",
CXT_FIXUP_HEADSET_MIC),
```

This adds a PCI SSID entry to the cxt5066_fixups[] quirk table in the Conexant HDA codec driver. The CXT_FIXUP_HEADSET_MIC fixup already exists in the driver — this just associates a new device's PCI subsystem ID with that existing fixup.

### Classification

This falls squarely into the **hardware quirk** exception category. As documented in the stable kernel rules analysis:

- **Audio codec quirks** (SND_PCI_QUIRK entries for specific laptop models) are explicitly listed as YES for stable
- The quirk type (CXT_FIXUP_HEADSET_MIC) already exists in the driver
- Only the device identification (PCI SSID) is new
- This fixes a real user-facing problem: the headset microphone doesn't work at all without it

### Scope and Risk Assessment

- **Lines changed**: 1 (single line addition)
- **Files changed**: 1 (sound/hda/codecs/conexant.c)
- **Risk**: Essentially zero. The SND_PCI_QUIRK macro only matches the specific PCI SSID 0x1d05:0x3012. It cannot affect any other hardware.
- **Dependencies**: None. The CXT_FIXUP_HEADSET_MIC fixup code already exists in the driver.

### User Impact

Without this quirk, the headset microphone on the MECHREVO Wujie 15X Pro laptop is completely non-functional. This is a real hardware enablement issue affecting actual users of this specific laptop model. Audio input is a basic expected functionality.

### Stability Indicators

- Accepted by Takashi Iwai, the ALSA subsystem maintainer
- The pattern is identical to dozens of other quirk entries in the same table
- The fixup mechanism (CXT_FIXUP_HEADSET_MIC) is well-tested and used for other devices

### Conclusion

This is a textbook example of a stable-worthy hardware quirk addition: a single-line SND_PCI_QUIRK entry that enables existing functionality for a specific device. Zero risk of regression, fixes a real hardware issue, trivially small, and completely self-contained.

**YES**

 sound/hda/codecs/conexant.c | 1 +
 1 file changed, 1 insertion(+)
sound/hda/codecs/conexant.c +1 -0
index 5fcbc1312c697..2384e64eada36 100644
@@ -1123,6 +1123,7 @@ static const struct hda_quirk cxt5066_fixups[] = {
 	SND_PCI_QUIRK_VENDOR(0x17aa, "Thinkpad/Ideapad", CXT_FIXUP_LENOVO_XPAD_ACPI),
 	SND_PCI_QUIRK(0x1c06, 0x2011, "Lemote A1004", CXT_PINCFG_LEMOTE_A1004),
 	SND_PCI_QUIRK(0x1c06, 0x2012, "Lemote A1205", CXT_PINCFG_LEMOTE_A1205),
+	SND_PCI_QUIRK(0x1d05, 0x3012, "MECHREVO Wujie 15X Pro", CXT_FIXUP_HEADSET_MIC),
 	HDA_CODEC_QUIRK(0x2782, 0x12c3, "Sirius Gen1", CXT_PINCFG_TOP_SPEAKER),
 	HDA_CODEC_QUIRK(0x2782, 0x12c5, "Sirius Gen2", CXT_PINCFG_TOP_SPEAKER),
 	{}
Signature · 1 line
2.51.0
author maintainer
#103 lore raw

PATCH 1/1 accel/amdxdna: Fix tail-pointer polling in mailbox_get_msg()

In reply to Sasha Levin

From: Lizhi Hou <[email protected]>

[ Upstream commit cd77d5a4aaf8c5c1d819f47cf814bf7d4920b0a2 ]

In mailbox_get_msg(), mailbox_reg_read_non_zero() is called to poll for a non-zero tail pointer. This assumed that a zero value indicates an error. However, certain corner cases legitimately produce a zero tail pointer. To handle these cases, remove mailbox_reg_read_non_zero(). The zero tail pointer will be treated as a valid rewind event.

---

LLM Generated explanations, may be completely bogus:

Good - mailbox_get_tailptr() already exists in v6.14 and the fix uses it. No dependency issues.

## Comprehensive Analysis

### 1. Commit Message Analysis

The commit title explicitly says "Fix" and the message clearly describes the bug: mailbox_reg_read_non_zero() polls for a non-zero tail pointer, **incorrectly assuming that a zero value indicates an error**. However, zero is a legitimate tail pointer value in certain corner cases (ring buffer rewind events). The fix removes the flawed polling function and instead uses a simple direct read via the existing mailbox_get_tailptr().

### 2. Code Change Analysis - The Bug Mechanism

The bug is in mailbox_reg_read_non_zero():

```115:129:/home/sasha/linux-
autosel/drivers/accel/amdxdna/amdxdna_mailbox.c
static int mailbox_reg_read_non_zero(struct mailbox_channel *mb_chann,
u32 mbox_reg, u32 *val)
{
        struct xdna_mailbox_res *mb_res = &mb_chann->mb->res;
        void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg;
        int ret, value;

        /* Poll till value is not zero */
        ret = readx_poll_timeout(readl, ringbuf_addr, value,
                                 value, 1 /* us */, 100);
        if (ret < 0)
                return ret;

        *val = value;
        return 0;
}
```

This function uses readx_poll_timeout() with value as both the variable AND the condition (the condition is just value, i.e., truthy/non-zero). It polls every 1us for up to 100us. If the tail pointer register is zero after 100us, it returns -ETIMEDOUT.

The call site in mailbox_get_msg():

```289:290:/home/sasha/linux-
autosel/drivers/accel/amdxdna/amdxdna_mailbox.c
        if (mailbox_reg_read_non_zero(mb_chann,
mb_chann->res[CHAN_RES_I2X].mb_tail_ptr_reg, &tail))
                return -EINVAL;
```

When the function times out (tail is legitimately zero), mailbox_get_msg() returns -EINVAL.

**The catastrophic consequence** is in mailbox_rx_worker() (in v6.14):

```377:386:/home/sasha/linux-
autosel/drivers/accel/amdxdna/amdxdna_mailbox.c
                /* Other error means device doesn't look good, disable
irq. */
                if (unlikely(ret)) {
                        MB_ERR(mb_chann, "Unexpected ret %d, disable
irq", ret);
                        WRITE_ONCE(mb_chann->bad_state, true);
                        disable_irq(mb_chann->msix_irq);
                        break;
                }
```

Any return other than 0 or -ENOENT causes:
1. bad_state = true is set **permanently** (never reset)
2. disable_irq() is called (in v6.14)
3. All future work items check bad_state and immediately return
4. The mailbox channel is **permanently dead** - no more firmware communication is possible
5. The AMD AI Engine accelerator becomes non-functional

**When does tail=0 legitimately occur?** The ring buffer protocol uses a TOMBSTONE marker when wrapping. After the writer (firmware, for the I2X channel) writes a TOMBSTONE at the end of the buffer and wraps to the start, the tail pointer can be zero briefly or permanently depending on the firmware's message scheduling. The commit describes this as a "valid rewind event."

### 3. Fix Correctness

The fix replaces the flawed polling function with a direct register read:

```c
tail = mailbox_get_tailptr(mb_chann, CHAN_RES_I2X);
```

This is obviously correct because the existing validation in mailbox_get_msg() properly handles a zero tail:
- tail > ringbuf_size || !IS_ALIGNED(tail, 4) → 0 passes (aligned and within bounds)
- head == tail → if head is also 0, returns -ENOENT (empty buffer, which is the correct behavior)
- If head != 0 and tail == 0, the function processes messages normally (rewind scenario)

### 4. Scope and Risk Assessment

- **Size**: 1 file changed, 1 insertion, 18 deletions (net -17 lines)
- **Scope**: Entirely self-contained within the mailbox driver
- **Risk**: Very low - the fix removes a polling function and replaces it with a simple direct read, relying on already-existing validation code
- **Regression potential**: Near zero - all the defensive checks (bounds validation, alignment, empty-buffer check) remain intact

### 5. Dependencies

- No dependencies on other commits
- mailbox_get_tailptr() already exists in v6.14 (line 152)
- The patch applies cleanly to v6.14.y stable (surrounding code is identical)

### 6. User Impact

- Affects users of AMD AI Engine (XDNA) accelerators (Ryzen AI NPUs)
- The bug causes the accelerator to become permanently non-functional when the tail pointer is legitimately zero
- This is a **device-killing bug** that requires driver reload/reboot to recover
- The amdxdna driver exists in stable trees starting from v6.14

### 7. Stability Indicators

- Has Reviewed-by: Maciej Falkowski <[email protected]>
- Author is Lizhi Hou <[email protected]> - an AMD engineer and the primary amdxdna driver developer
- The fix was accepted via the drm subsystem merge path

### Conclusion

This commit fixes a real, severe bug where a false positive error detection (treating zero tail pointer as invalid) permanently kills the mailbox communication channel in the AMD XDNA accelerator driver. The consequence is the accelerator device becoming completely non-functional until driver reload/reboot. The fix is small (net -17 lines), obviously correct (removes incorrect assumption, relies on existing validation), self-contained (single file, no dependencies), and applies cleanly to the v6.14 stable tree. It meets all stable kernel criteria.

**YES**

 drivers/accel/amdxdna/amdxdna_mailbox.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
drivers/accel/amdxdna/amdxdna_mailbox.c +1 -18
index 858df97cd3fbd..a60a85ce564cb 100644
@@ -112,22 +112,6 @@ static u32 mailbox_reg_read(struct mailbox_channel *mb_chann, u32 mbox_reg)
 	return readl(ringbuf_addr);
 }
 
-static int mailbox_reg_read_non_zero(struct mailbox_channel *mb_chann, u32 mbox_reg, u32 *val)
-{
-	struct xdna_mailbox_res *mb_res = &mb_chann->mb->res;
-	void __iomem *ringbuf_addr = mb_res->mbox_base + mbox_reg;
-	int ret, value;
-
-	/* Poll till value is not zero */
-	ret = readx_poll_timeout(readl, ringbuf_addr, value,
-				 value, 1 /* us */, 100);
-	if (ret < 0)
-		return ret;
-
-	*val = value;
-	return 0;
-}
-
 static inline void
 mailbox_set_headptr(struct mailbox_channel *mb_chann, u32 headptr_val)
 {
@@ -286,8 +270,7 @@ static int mailbox_get_msg(struct mailbox_channel *mb_chann)
 	u32 start_addr;
 	int ret;
 
-	if (mailbox_reg_read_non_zero(mb_chann, mb_chann->res[CHAN_RES_I2X].mb_tail_ptr_reg, &tail))
-		return -EINVAL;
+	tail = mailbox_get_tailptr(mb_chann, CHAN_RES_I2X);
 	head = mb_chann->i2x_head;
 	ringbuf_size = mailbox_get_ringbuf_size(mb_chann, CHAN_RES_I2X);
 	start_addr = mb_chann->res[CHAN_RES_I2X].rb_start_addr;
Signature · 1 line
2.51.0
author maintainer
#104 lore raw

PATCH 1/1 drm/panel-edp: Add CSW MNE007QB3-1

In reply to Sasha Levin

From: Langyan Ye <[email protected]>

[ Upstream commit b1ea3babb67dcb8b0881c2ab49dfba88b1445856 ]

Add support for the CSW MNE007QB3-1, pleace the EDID here for subsequent reference.

00 ff ff ff ff ff ff 00 0e 77 7c 14 00 00 00 00
00 23 01 04 a5 1e 13 78 07 ee 95 a3 54 4c 99 26
0f 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 35 3c 80 a0 70 b0 23 40 30 20
36 00 2d bc 10 00 00 18 2b 30 80 a0 70 b0 23 40
30 20 36 00 2d bc 10 00 00 18 00 00 00 fd 00 28
3c 4a 4a 0f 01 0a 20 20 20 20 20 20 00 00 00 fc
00 4d 4e 45 30 30 37 51 42 33 2d 31 0a 20 01 5b

70 20 79 02 00 21 00 1d c8 0b 5d 07 80 07 b0 04
00 3d 8a 54 cd a4 99 66 62 0f 02 45 54 40 5e 40
5e 00 44 12 78 2e 00 06 00 44 40 5e 40 5e 81 00
20 74 1a 00 00 03 01 28 3c 00 00 00 00 00 00 3c
00 00 00 00 8d 00 e3 05 04 00 e6 06 01 00 60 60
ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 68 90

---

LLM Generated explanations, may be completely bogus:

All the analysis is complete. Here is my detailed assessment:

---

## Analysis: drm/panel-edp: Add CSW MNE007QB3-1

### 1. Commit Message Analysis

The commit adds support for a new revision of the CSW MNE007QB3-1 eDP panel. The EDID data is included for reference. The panel name "MNE007QB3-1" already exists in the driver with product ID 0x146e (added in commit 490b30fbaca2a), but this adds a *new variant* of the same panel identified by product ID 0x147c with different timing requirements. The author is from Huaqin (a major Chromebook ODM), and the commit was reviewed/applied by Douglas Anderson (the panel-edp subsystem maintainer).

### 2. Code Change Analysis

The change is a **single line addition**:

```c
EDP_PANEL_ENTRY('C', 'S', 'W', 0x147c, &delay_200_500_e50_d100,
"MNE007QB3-1"),
```

This adds a new entry to the edp_panels[] table, which is a static lookup table mapping EDID panel IDs to timing delay parameters. The new entry:
- Vendor: CSW ('C', 'S', 'W')
- Product ID: 0x147c (distinct from the existing 0x146e)
- Delay: delay_200_500_e50_d100 (hpd_absent=200ms, unprepare=500ms, enable=50ms, disable=100ms)
- Name: "MNE007QB3-1"

The delay structure delay_200_500_e50_d100 already exists in the source (line 1839-1844) and is used by other panels (MNB601LS1-4, TL140VDMS03-01). No new code, structures, or functionality is added.

### 3. Classification: New Device ID

This falls squarely into the **"New Device IDs"** exception category for stable backports. The panel-edp.c driver is a well-established driver that uses a table-driven approach to match eDP panels by their EDID identifiers and apply the correct power sequencing timings. Adding a new entry to this table is functionally equivalent to adding a new PCI/USB device ID to an existing driver.

Without this entry, a device using this specific panel revision (EDID product ID 0x147c) would not have proper power sequencing timings. This can result in:
- Display initialization failures
- Screen flickering or artifacts
- Panel damage from incorrect power sequencing
- The panel being treated as unknown and potentially not working at all

### 4. Scope and Risk Assessment

- **Lines changed**: 1 (one line added)
- **Files touched**: 1 (drivers/gpu/drm/panel/panel-edp.c)
- **Complexity**: Trivially low
- **Risk of regression**: Effectively zero. The new entry is a static table addition matched only by a specific panel ID (0x147c). It cannot affect any existing panel or any other code path. The delay structure it references already exists and is used by other panels.
- **Dependencies**: None. The EDP_PANEL_ENTRY macro and delay_200_500_e50_d100 structure exist in all recent stable kernels that have the panel-edp driver.

### 5. User Impact

This panel is used in Chromebooks (the commit comes from Huaqin, a Chromebook manufacturer, with the corp-partner.google.com email address). Chromebooks frequently use stable/LTS kernels (especially ChromeOS). Without this backport, Chromebooks using this specific panel revision would have display issues. This is a **real hardware enablement** issue for production devices.

### 6. Stability Indicators

- Applied by Douglas Anderson ([email protected]), the well-known panel-edp maintainer
- The pattern is identical to dozens of other panel additions that are routinely backported
- The referenced delay structure has been in the kernel for a long time
- Zero risk of runtime regression

### 7. Dependency Check

No dependencies. The commit is completely self-contained. The delay_200_500_e50_d100 structure and the EDP_PANEL_ENTRY macro exist in all stable kernels that have this driver.

### Conclusion

This is a textbook example of a stable-appropriate device ID addition. It is a single-line, zero-risk table entry that enables a specific hardware panel variant used in production Chromebook devices. The driver already exists in stable, the delay structure already exists, and the change cannot affect any other hardware. It meets all stable kernel
criteria: obviously correct, fixes a real issue (hardware not working), small and contained, no new features.

**YES**

 drivers/gpu/drm/panel/panel-edp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/panel/panel-edp.c +1 -0
index 415b894890ad7..023fbbb10eb4f 100644
@@ -2033,6 +2033,7 @@ static const struct edp_panel_entry edp_panels[] = {
 	EDP_PANEL_ENTRY('C', 'S', 'W', 0x1462, &delay_200_500_e50, "MNE007QS5-2"),
 	EDP_PANEL_ENTRY('C', 'S', 'W', 0x1468, &delay_200_500_e50, "MNE007QB2-2"),
 	EDP_PANEL_ENTRY('C', 'S', 'W', 0x146e, &delay_80_500_e50_d50, "MNE007QB3-1"),
+	EDP_PANEL_ENTRY('C', 'S', 'W', 0x147c, &delay_200_500_e50_d100, "MNE007QB3-1"),
 	EDP_PANEL_ENTRY('C', 'S', 'W', 0x1519, &delay_200_500_e80_d50, "MNF601BS1-3"),
 
 	EDP_PANEL_ENTRY('E', 'T', 'C', 0x0000, &delay_50_500_e200_d200_po2e335, "LP079QX1-SP0V"),
Signature · 1 line
2.51.0
author maintainer
#105 lore raw

PATCH 1/1 cgroup/cpuset: Don't fail cpuset.cpus change in v2

In reply to Sasha Levin

From: Waiman Long <[email protected]>

[ Upstream commit 6e6f13f6d5095f3a432da421e78f4d7d51ef39c8 ]

Commit fe8cd2736e75 ("cgroup/cpuset: Delay setting of CS_CPU_EXCLUSIVE until valid partition") introduced a new check to disallow the setting of a new cpuset.cpus.exclusive value that is a superset of a sibling's cpuset.cpus value so that there will at least be one CPU left in the sibling in case the cpuset becomes a valid partition root. This new check does have the side effect of failing a cpuset.cpus change that make it a subset of a sibling's cpuset.cpus.exclusive value.

With v2, users are supposed to be allowed to set whatever value they want in cpuset.cpus without failure. To maintain this rule, the check is now restricted to only when cpuset.cpus.exclusive is being changed not when cpuset.cpus is changed.

The cgroup-v2.rst doc file is also updated to reflect this change.

---

LLM Generated explanations, may be completely bogus:

This is important. The cpus_excl_conflict() helper function was only introduced in v6.18-rc1 (commit 8daab66eb329). The current fix **modifies this helper**. This means the fix as-is only applies cleanly to v6.18+. For earlier stable trees (6.11.y through 6.17.y), the bug exists but the code structure is different — the fix would need to be adapted to the inline code in validate_change() directly.

### 8. SUMMARY

**What the bug is**: In cgroup v2, changing cpuset.cpus to a value that happens to be a subset of a sibling's cpuset.cpus.exclusive incorrectly fails with -EINVAL. This violates the cgroup v2 API contract that cpuset.cpus can be set to any value without failure.

**Who is affected**: Any cgroup v2 user (containers, Kubernetes, systemd) who has cpusets with cpuset.cpus.exclusive set and tries to change cpuset.cpus on a sibling.

**Severity**: Medium-high. It's a regression that breaks expected behavior — operations that should succeed are failing. While not a crash or data corruption, it can break container orchestration workflows.

**Fix quality**: The fix is small, well-understood, and correctly targeted. It adds a boolean guard (xcpus_changed) so the restrictive check only applies when cpuset.cpus.exclusive is being changed, not when cpuset.cpus is being changed.

**Risk**: Low. The change makes validation less restrictive in a controlled way. It's authored by the cgroup/cpuset maintainer and reviewed.

**Dependencies**: The fix as written depends on the cpus_excl_conflict() helper introduced in v6.18-rc1 (8daab66eb329). For stable trees before 6.18, the fix would need adaptation. However, the underlying bug exists since v6.11.

### Decision

This is a clear regression fix for a user-visible behavioral change in cgroup v2. It's small, well-scoped, fixes a real API contract violation that affects container workloads, authored by the subsystem maintainer, and reviewed. The only concern is the dependency on the helper refactoring commit for clean backporting to pre-6.18 stable trees, but that's a mechanical backporting issue, not a reason to reject. The fix meets all stable kernel criteria.

**YES**

 Documentation/admin-guide/cgroup-v2.rst |  8 +++----
 kernel/cgroup/cpuset.c                  | 30 ++++++++++++-------------
 2 files changed, 19 insertions(+), 19 deletions(-)
Documentation/admin-guide/cgroup-v2.rst +4 -4
index 7f5b59d95fce5..510df2461aff2 100644
@@ -2561,10 +2561,10 @@ Cpuset Interface Files
 	Users can manually set it to a value that is different from
 	"cpuset.cpus".	One constraint in setting it is that the list of
 	CPUs must be exclusive with respect to "cpuset.cpus.exclusive"
-	of its sibling.  If "cpuset.cpus.exclusive" of a sibling cgroup
-	isn't set, its "cpuset.cpus" value, if set, cannot be a subset
-	of it to leave at least one CPU available when the exclusive
-	CPUs are taken away.
+	and "cpuset.cpus.exclusive.effective" of its siblings.	Another
+	constraint is that it cannot be a superset of "cpuset.cpus"
+	of its sibling in order to leave at least one CPU available to
+	that sibling when the exclusive CPUs are taken away.
 
 	For a parent cgroup, any one of its exclusive CPUs can only
 	be distributed to at most one of its child cgroups.  Having an
kernel/cgroup/cpuset.c +15 -15
index c06e2e96f79dc..dc3ac38c5d160 100644
@@ -603,33 +603,31 @@ static inline bool cpusets_are_exclusive(struct cpuset *cs1, struct cpuset *cs2)
 
 /**
  * cpus_excl_conflict - Check if two cpusets have exclusive CPU conflicts
- * @cs1: first cpuset to check
- * @cs2: second cpuset to check
+ * @trial:	the trial cpuset to be checked
+ * @sibling:	a sibling cpuset to be checked against
+ * @xcpus_changed: set if exclusive_cpus has been set
  *
  * Returns: true if CPU exclusivity conflict exists, false otherwise
  *
  * Conflict detection rules:
  * 1. If either cpuset is CPU exclusive, they must be mutually exclusive
  * 2. exclusive_cpus masks cannot intersect between cpusets
- * 3. The allowed CPUs of one cpuset cannot be a subset of another's exclusive CPUs
+ * 3. The allowed CPUs of a sibling cpuset cannot be a subset of the new exclusive CPUs
  */
-static inline bool cpus_excl_conflict(struct cpuset *cs1, struct cpuset *cs2)
+static inline bool cpus_excl_conflict(struct cpuset *trial, struct cpuset *sibling,
+				      bool xcpus_changed)
 {
 	/* If either cpuset is exclusive, check if they are mutually exclusive */
-	if (is_cpu_exclusive(cs1) || is_cpu_exclusive(cs2))
-		return !cpusets_are_exclusive(cs1, cs2);
+	if (is_cpu_exclusive(trial) || is_cpu_exclusive(sibling))
+		return !cpusets_are_exclusive(trial, sibling);
 
 	/* Exclusive_cpus cannot intersect */
-	if (cpumask_intersects(cs1->exclusive_cpus, cs2->exclusive_cpus))
+	if (cpumask_intersects(trial->exclusive_cpus, sibling->exclusive_cpus))
 		return true;
 
-	/* The cpus_allowed of one cpuset cannot be a subset of another cpuset's exclusive_cpus */
-	if (!cpumask_empty(cs1->cpus_allowed) &&
-	    cpumask_subset(cs1->cpus_allowed, cs2->exclusive_cpus))
-		return true;
-
-	if (!cpumask_empty(cs2->cpus_allowed) &&
-	    cpumask_subset(cs2->cpus_allowed, cs1->exclusive_cpus))
+	/* The cpus_allowed of a sibling cpuset cannot be a subset of the new exclusive_cpus */
+	if (xcpus_changed && !cpumask_empty(sibling->cpus_allowed) &&
+	    cpumask_subset(sibling->cpus_allowed, trial->exclusive_cpus))
 		return true;
 
 	return false;
@@ -666,6 +664,7 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
 {
 	struct cgroup_subsys_state *css;
 	struct cpuset *c, *par;
+	bool xcpus_changed;
 	int ret = 0;
 
 	rcu_read_lock();
@@ -722,10 +721,11 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
 	 * overlap. exclusive_cpus cannot overlap with each other if set.
 	 */
 	ret = -EINVAL;
+	xcpus_changed = !cpumask_equal(cur->exclusive_cpus, trial->exclusive_cpus);
 	cpuset_for_each_child(c, css, par) {
 		if (c == cur)
 			continue;
-		if (cpus_excl_conflict(trial, c))
+		if (cpus_excl_conflict(trial, c, xcpus_changed))
 			goto out;
 		if (mems_excl_conflict(trial, c))
 			goto out;
Signature · 1 line
2.51.0
author maintainer
#106 lore raw

PATCH 1/1 drm/amd/display: only power down dig on phy endpoints

In reply to Sasha Levin

From: Dmytro Laktyushkin <[email protected]>

[ Upstream commit 0839d8d24e6f1fc2587c4a976f44da9fa69ae3d0 ]

This avoids any issues with dpia endpoints

---

LLM Generated explanations, may be completely bogus:

Now I have a comprehensive understanding. Let me summarize the full analysis.

---

## Comprehensive Analysis

### 1. COMMIT MESSAGE ANALYSIS

The subject "drm/amd/display: only power down dig on phy endpoints" and body "This avoids any issues with dpia endpoints" clearly indicate this is a bug fix. The commit skips DIG (Digital Interface Group) power-down for DPIA (DisplayPort Interface Adapter / USB4 DP tunnel) endpoints, which shouldn't be processed in this context.

### 2. CODE CHANGE ANALYSIS

The fix adds exactly 2 lines to dcn401_init_hw():

```c
if (link->ep_type != DISPLAY_ENDPOINT_PHY)
    continue;
```

This guard is placed in the "headless boot" DIG power-down loop, which iterates all links when no eDP links are found. The loop accesses link->link_enc->funcs->is_dig_enabled without first checking if the link is a physical endpoint.

**The Bug Mechanism: NULL Pointer Dereference**

From my investigation of the link construction code in link_factory.c:

- DPIA links are created via construct_dpia() (line 814), which **never assigns link->link_enc**. There's even a /* TODO: Create link encoder */ comment at line 870.
- PHY links are created via construct_phy() (line 676), which **does** assign link->link_enc.
- Since links are allocated with kzalloc(), link->link_enc is NULL for DPIA links.
- The buggy code dereferences link->link_enc->funcs->is_dig_enabled — a **NULL pointer dereference** when the link is DPIA.

The enum display_endpoint_type from dc_types.h defines:
- DISPLAY_ENDPOINT_PHY = 0 — Physical connector
- DISPLAY_ENDPOINT_USB4_DPIA — USB4 DisplayPort tunnel

### 3. CONSISTENCY WITH OTHER DCN GENERATIONS

The first loop in dcn401_init_hw() (line 206 at HEAD) **already has** this exact ep_type check, added by commit d7f5a61e1b04 ("increase max link count and fix link->enc NULL pointer access"). That commit explicitly states: "*hw_init() access null LINK_ENC for dpia non display_endpoint*".

Both dcn31_hwseq.c (line 163) and dcn35_hwseq.c (line 196) have this same check in their first link iteration loops, confirming this is a well-established pattern.

### 4. DEPENDENCY ANALYSIS

There are **two** crash points in dcn401_init_hw() for DPIA links:
1. **First loop** (~line 209):
link->link_enc->funcs->hw_init(link->link_enc) — Fixed by d7f5a61e1b04
2. **Second loop** (~line 290): link->link_enc->funcs->is_dig_enabled — Fixed by the commit under analysis

In v6.12 stable, **neither** check exists (verified by examining the v6.12 code). Both commits need to be backported for complete protection. The commit under analysis is self-contained for the second code path, but the first crash path would be hit before reaching the second one unless d7f5a61e1b04 is also backported.

### 5. AFFECTED VERSIONS AND HARDWARE

- DCN 4.0.1 was added in v6.11 (commit 70839da636050), present in v6.11+, including LTS 6.12.y
- DCN 4.0.1 targets AMD RDNA 4 GPUs (e.g., RX 9070 series)
- DPIA endpoints occur on systems with USB4/Thunderbolt with DisplayPort tunneling
- The bug triggers during hardware init (boot/resume) on systems with DPIA endpoints in a headless configuration

### 6. RISK ASSESSMENT

- **Size**: 2 lines added — minimal
- **Scope**: Only affects the specific DIG power-down code path during init
- **Pattern**: Identical to established practice in dcn31/dcn35
- **Side effects**: None — the guard only skips endpoints that should never have been processed
- **Review**: Reviewed by Charlene Liu (the author of the companion fix), Tested by Dan Wheeler (AMD)
- **Risk**: Extremely low

### 7. USER IMPACT

Without this fix, AMD RDNA 4 GPU users with USB4/Thunderbolt displays in a headless boot scenario would hit a **kernel crash** (NULL pointer dereference → oops/panic). This is a fatal initialization failure.

### 8. VERDICT

This is a clear, surgical fix for a NULL pointer dereference that causes a kernel crash during hardware initialization. It follows an established pattern used across multiple DCN generations, is 2 lines with zero risk of regression, and was reviewed and tested by AMD engineers. It does require companion commit d7f5a61e1b04 for complete coverage of all crash paths, but both should be backported together. The fix applies to hardware present in stable kernels from v6.11 onward.

**YES**

 drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +2 -0
index f04cbdb3d3814..1ce61f0570201 100644
@@ -287,6 +287,8 @@ void dcn401_init_hw(struct dc *dc)
 			for (i = 0; i < dc->link_count; i++) {
 				struct dc_link *link = dc->links[i];
 
+				if (link->ep_type != DISPLAY_ENDPOINT_PHY)
+					continue;
 				if (link->link_enc->funcs->is_dig_enabled &&
 						link->link_enc->funcs->is_dig_enabled(link->link_enc) &&
 						hws->funcs.power_down) {
Signature · 1 line
2.51.0
author maintainer
#107 lore raw

PATCH 1/1 media: pvrusb2: fix URB leak in pvr2_send_request_ex

In reply to Sasha Levin

From: Szymon Wilczek <[email protected]>

[ Upstream commit a8333c8262aed2aedf608c18edd39cf5342680a7 ]

When pvr2_send_request_ex() submits a write URB successfully but fails to submit the read URB (e.g. returns -ENOMEM), it returns immediately without waiting for the write URB to complete. Since the driver reuses the same URB structure, a subsequent call to pvr2_send_request_ex() attempts to submit the still-active write URB, triggering a 'URB submitted while active' warning in usb_submit_urb().

Fix this by ensuring the write URB is unlinked and waited upon if the read URB submission fails.

---

LLM Generated explanations, may be completely bogus:

## Analysis of pvrusb2 URB Leak Fix

### 1. Commit Message Analysis

The commit message is clear and well-structured:
- **Subject**: Explicitly says "fix URB leak" — this is a bug fix
- **Problem**: When the write URB is submitted successfully but the read URB submission fails, the function returns without waiting for the write URB to complete. The URB structure is reused, so a subsequent call tries to submit a still-active URB.
- **Symptom**: Triggers a 'URB submitted while active' warning in usb_submit_urb(), which is a well-known USB core warning indicating a real bug.
- **Reporter**: syzbot — fuzzer-found, reproducible bug
- **Acked-by**: Mike Isely (pvrusb2 maintainer) — subsystem maintainer approved
- **Signed-off-by**: Hans Verkuil (media subsystem maintainer) — proper review chain

### 2. Code Change Analysis

The fix adds 5 lines of code in a single error path:

```c
if (hdw->ctl_write_pend_flag) {
    usb_unlink_urb(hdw->ctl_write_urb);
    while (hdw->ctl_write_pend_flag)
        wait_for_completion(&hdw->ctl_done);
}
```

**What it does**: When the read URB submission fails (status < 0), but the write URB was already submitted and is pending (ctl_write_pend_flag set), the fix:
1. Unlinks (cancels) the still-active write URB
2. Waits for the write URB completion callback to fire (which clears ctl_write_pend_flag)

This is the correct pattern — it mirrors what the existing code already does in the normal path (the while (hdw->ctl_write_pend_flag || hdw->ctl_read_pend_flag) loop further down), but adapted for this specific error path.

### 3. Bug Classification

- **Type**: Resource leak / URB lifecycle mismanagement
- **Trigger**: Read URB submission failure (e.g., -ENOMEM) after successful write URB submission
- **Consequence**:
- Active URB left dangling
- Next call to the same function triggers 'URB submitted while active' warning
- Could lead to undefined behavior with the USB subsystem, potential data corruption or crashes
- **Reproducibility**: syzbot found it — reproducible with a concrete trigger

### 4. Scope and Risk Assessment

- **Lines changed**: +5 lines added in a single file
- **Files affected**: 1 file (drivers/media/usb/pvrusb2/pvrusb2-hdw.c)
- **Complexity**: Very low — straightforward error path cleanup
- **Risk**: Minimal. The fix uses standard USB patterns (usb_unlink_urb + wait for completion) that are well-established throughout the kernel. The ctl_write_pend_flag check ensures we only unlink if the write URB is actually active.
- **Regression potential**: Very low. This code path only executes when read URB submission fails, and the fix ensures proper cleanup before proceeding — strictly better than the current behavior.

### 5. User Impact

- **Affected users**: Anyone using pvrusb2 USB TV capture devices
- **Severity**: Medium-high — while pvrusb2 is not a widely-used driver, submitting a still-active URB can cause USB core issues, kernel warnings, and potentially crashes
- **Trigger likelihood**: Moderate — memory pressure situations can cause -ENOMEM from usb_submit_urb()

### 6. Stability and Trust Indicators

- **Reported-by**: syzbot (automated, reproducible)
- **Acked-by**: Subsystem maintainer (Mike Isely)
- **Merged by**: Media subsystem maintainer (Hans Verkuil)
- **Fix pattern**: Standard, well-understood USB cleanup pattern

### 7. Dependencies

The fix is self-contained — it uses existing infrastructure (usb_unlink_urb, wait_for_completion, existing flags) that has been present in the pvrusb2 driver for years. No dependency on other recent commits.

### 8. Stable Kernel Criteria

| Criterion | Met? |
|-----------|------|
| Obviously correct and tested | Yes — syzbot-reported, maintainer-acked
|
| Fixes a real bug | Yes — URB leak, 'URB submitted while active' |
| Important issue | Yes — can cause USB subsystem issues and warnings |
| Small and contained | Yes — 5 lines, 1 file |
| No new features | Correct — pure bug fix |
| Applies cleanly | Likely — the pvrusb2 code is stable and rarely
changed |

### Conclusion

This is a textbook stable backport candidate: a small, surgical fix for a syzbot-reported URB lifecycle bug in a USB driver. It's maintainer- acked, uses established patterns, has minimal regression risk, and fixes a real bug that can cause kernel warnings and potential instability. The fix is self-contained with no dependencies.

**YES**

 drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/media/usb/pvrusb2/pvrusb2-hdw.c +5 -0
index b32bb906a9de2..5807734ae26c6 100644
@@ -3709,6 +3709,11 @@ status);
 				   "Failed to submit read-control URB status=%d",
 status);
 			hdw->ctl_read_pend_flag = 0;
+			if (hdw->ctl_write_pend_flag) {
+				usb_unlink_urb(hdw->ctl_write_urb);
+				while (hdw->ctl_write_pend_flag)
+					wait_for_completion(&hdw->ctl_done);
+			}
 			goto done;
 		}
 	}
Signature · 1 line
2.51.0
author maintainer
#108 lore raw

PATCH 1/1 power: sequencing: fix missing state_lock in pwrseq_power_on() error path

In reply to Sasha Levin

From: Ziyi Guo <[email protected]>

[ Upstream commit e1dccb485c2876ac1318f36ccc0155416c633a48 ]

pwrseq_power_on() calls pwrseq_unit_disable() when the post_enable callback fails. However, this call is outside the scoped_guard(mutex, &pwrseq->state_lock) block that ends.

pwrseq_unit_disable() has lockdep_assert_held(&pwrseq->state_lock), which will fail when called from this error path.

Add the scoped_guard block to cover the post_enable callback and its error handling to ensure the lock is held when pwrseq_unit_disable() is called.

---

LLM Generated explanations, may be completely bogus:

The power sequencing core was introduced in v6.11. So this fix is relevant for stable trees v6.11.y and later (6.12.y, 6.13.y, etc.).

### 8. SELF-CONTAINEDNESS

This is a completely self-contained fix. It doesn't depend on any other patches. It simply wraps two existing lines of code with the appropriate lock scope.

### VERDICT

**Meets stable criteria:**
- **Obviously correct**: Yes — the lock is required (enforced by lockdep_assert_held), and it was missing.
- **Fixes a real bug**: Yes — lockdep assertion failure and potential race condition.
- **Small and contained**: Yes — 6 lines changed in 1 file.
- **No new features**: Correct — purely a locking fix.
- **Low regression risk**: Adding a lock that was already required by the callee.

The fix is small, surgical, obviously correct, and fixes a real locking bug that would trigger lockdep warnings and could lead to race conditions. It meets all stable kernel criteria.

**YES**

 drivers/power/sequencing/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/power/sequencing/core.c +4 -2
index 190564e559885..1fcf0af7cc0bb 100644
@@ -914,8 +914,10 @@ int pwrseq_power_on(struct pwrseq_desc *desc)
 	if (target->post_enable) {
 		ret = target->post_enable(pwrseq);
 		if (ret) {
-			pwrseq_unit_disable(pwrseq, unit);
-			desc->powered_on = false;
+			scoped_guard(mutex, &pwrseq->state_lock) {
+				pwrseq_unit_disable(pwrseq, unit);
+				desc->powered_on = false;
+			}
 		}
 	}
 
Signature · 1 line
2.51.0
author maintainer
#109 lore raw

PATCH 1/1 media: dvb-core: dmxdevfilter must always flush bufs

In reply to Sasha Levin

From: Hans Verkuil <[email protected]>

[ Upstream commit c4e620eccbef76aa5564ebb295e23d6540e27215 ]

Currently the buffers are being filled until full, which works fine for the transport stream, but not when reading sections, those have to be returned to userspace immediately, otherwise dvbv5-scan will just wait forever.

Add a 'flush' argument to dvb_vb2_fill_buffer to indicate whether the buffer must be flushed or wait until it is full.

---

LLM Generated explanations, may be completely bogus:

## Analysis

### 1. Commit Message Analysis

The commit clearly describes a functional bug: DVB section data is buffered until the VB2 buffer is completely full, but sections are discrete units that must be delivered immediately. The result is that dvbv5-scan (a standard DVB channel scanning utility from v4l-utils) **hangs forever** when using the VB2 mmap path.

### 2. Code Change Analysis

The bug is in dvb_vb2_fill_buffer() at line 309 of dvb_vb2.c:

```309:309:drivers/media/dvb-core/dvb_vb2.c
        if (ctx->nonblocking && ctx->buf) {
```

This condition flushes partially-filled buffers only when the file descriptor was opened with O_NONBLOCK. The nonblocking field is set during dvb_vb2_init() from file->f_flags & O_NONBLOCK:

```819:820:drivers/media/dvb-core/dmxdev.c
        dvb_vb2_init(&dmxdevfilter->vb2_ctx, "demux_filter",
                     file->f_flags & O_NONBLOCK);
```

**The fundamental problem**: The decision to flush a partially-filled buffer should depend on the **type of data** (section vs. transport stream), not on the **blocking mode** of the file descriptor. DVB sections are discrete protocol data units that must be returned to userspace immediately. Transport streams are continuous, so waiting until the buffer is full is correct.

**Bug mechanism**:
1. Application opens demux device in blocking mode (normal, no O_NONBLOCK)
2. ctx->nonblocking is set to 0
3. Section callback delivers a complete section to dvb_vb2_fill_buffer()
4. Section data is smaller than the full VB2 buffer, so ctx->remain > 0
5. The if (ctx->nonblocking && ctx->buf) check fails (nonblocking=0)
6. Buffer is NOT flushed to userspace
7. Application blocks forever waiting for data that's already been received

**The fix** adds a bool flush parameter to dvb_vb2_fill_buffer():
- dvb_dmxdev_section_callback() passes flush=true (sections: flush immediately)
- dvb_dmxdev_ts_callback() passes flush=false (transport stream:
wait until full)
- The condition becomes if (flush && ctx->buf) - semantically correct

The nonblocking field is NOT removed - it's still used in dvb_vb2_dqbuf() (line 415) for its legitimate purpose of controlling blocking dequeue behavior.

### 3. Classification

This is a **clear bug fix** - it fixes a condition where a standard userspace application (dvbv5-scan) hangs indefinitely. The existing behavior was simply wrong: flushing decisions were tied to an unrelated flag.

### 4. Scope and Risk Assessment

- **Files changed**: 3 (dmxdev.c, dvb_vb2.c, dvb_vb2.h)
- **Lines changed**: ~15 (very small)
- **Only 2 callers** of dvb_vb2_fill_buffer(), both updated
- **Internal API only** - no userspace-visible changes
- **TS path unchanged** - flush=false preserves existing behavior for transport streams
- **Section path fixed** - flush=true ensures proper delivery
- **CONFIG_DVB_MMAP only** - behind experimental Kconfig (default N), limiting blast radius
- **Risk**: Very low - the change cannot regress TS behavior, and section behavior goes from "broken" to "working"

### 5. User Impact

For users who have CONFIG_DVB_MMAP enabled and use dvbv5-scan or similar section-reading applications via the VB2 path in blocking mode, this is a **complete showstopper** - the application hangs forever. Without this fix, the VB2 mmap path is fundamentally broken for section data.

### 6. Stability Indicators

- **Author**: Hans Verkuil - V4L2/DVB subsystem maintainer, extremely well-known and trusted
- **Sign-off**: Mauro Carvalho Chehab - overall media subsystem maintainer
- **Self-contained**: No dependencies on other patches
- **Bug exists since**: The DVB VB2 feature was introduced in kernel 4.20 (commit 57868acc369a), and this bug has existed since then

### 7. Dependency Check

The patch applies cleanly to the current tree. There are no dependencies on other uncommitted patches. All callers are updated within the same patch.

### Conclusion

This commit fixes a real, user-impacting bug where DVB section data is never delivered to userspace through the VB2 mmap path when the file descriptor is opened in blocking mode. The fix is small, self-contained, obviously correct, and authored by the subsystem maintainer. The risk of regression is minimal since the TS path behavior is preserved unchanged and the section path goes from "broken" to "correct." While it only affects CONFIG_DVB_MMAP (experimental), for users who enable it, the bug is a complete showstopper.

**YES**

 drivers/media/dvb-core/dmxdev.c  | 8 ++++----
 drivers/media/dvb-core/dvb_vb2.c | 5 +++--
 include/media/dvb_vb2.h          | 6 ++++--
 3 files changed, 11 insertions(+), 8 deletions(-)
drivers/media/dvb-core/dmxdev.c +4 -4
index 8c6f5aafda1d6..17184b3674904 100644
@@ -397,11 +397,11 @@ static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len,
 	if (dvb_vb2_is_streaming(&dmxdevfilter->vb2_ctx)) {
 		ret = dvb_vb2_fill_buffer(&dmxdevfilter->vb2_ctx,
 					  buffer1, buffer1_len,
-					  buffer_flags);
+					  buffer_flags, true);
 		if (ret == buffer1_len)
 			ret = dvb_vb2_fill_buffer(&dmxdevfilter->vb2_ctx,
 						  buffer2, buffer2_len,
-						  buffer_flags);
+						  buffer_flags, true);
 	} else {
 		ret = dvb_dmxdev_buffer_write(&dmxdevfilter->buffer,
 					      buffer1, buffer1_len);
@@ -452,10 +452,10 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len,
 
 	if (dvb_vb2_is_streaming(ctx)) {
 		ret = dvb_vb2_fill_buffer(ctx, buffer1, buffer1_len,
-					  buffer_flags);
+					  buffer_flags, false);
 		if (ret == buffer1_len)
 			ret = dvb_vb2_fill_buffer(ctx, buffer2, buffer2_len,
-						  buffer_flags);
+						  buffer_flags, false);
 	} else {
 		if (buffer->error) {
 			spin_unlock(&dmxdevfilter->dev->lock);
drivers/media/dvb-core/dvb_vb2.c +3 -2
index 29edaaff7a5c9..7444bbc2f24d9 100644
@@ -249,7 +249,8 @@ int dvb_vb2_is_streaming(struct dvb_vb2_ctx *ctx)
 
 int dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx,
 			const unsigned char *src, int len,
-			enum dmx_buffer_flags *buffer_flags)
+			enum dmx_buffer_flags *buffer_flags,
+			bool flush)
 {
 	unsigned long flags = 0;
 	void *vbuf = NULL;
@@ -306,7 +307,7 @@ int dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx,
 		}
 	}
 
-	if (ctx->nonblocking && ctx->buf) {
+	if (flush && ctx->buf) {
 		vb2_set_plane_payload(&ctx->buf->vb, 0, ll);
 		vb2_buffer_done(&ctx->buf->vb, VB2_BUF_STATE_DONE);
 		list_del(&ctx->buf->list);
include/media/dvb_vb2.h +4 -2
index 8cb88452cd6c2..0fbbfc65157e6 100644
@@ -124,7 +124,7 @@ static inline int dvb_vb2_release(struct dvb_vb2_ctx *ctx)
 	return 0;
 };
 #define dvb_vb2_is_streaming(ctx) (0)
-#define dvb_vb2_fill_buffer(ctx, file, wait, flags) (0)
+#define dvb_vb2_fill_buffer(ctx, file, wait, flags, flush) (0)
 
 static inline __poll_t dvb_vb2_poll(struct dvb_vb2_ctx *ctx,
 				    struct file *file,
@@ -166,10 +166,12 @@ int dvb_vb2_is_streaming(struct dvb_vb2_ctx *ctx);
  * @buffer_flags:
  *		pointer to buffer flags as defined by &enum dmx_buffer_flags.
  *		can be NULL.
+ * @flush:	flush the buffer, even if it isn't full.
  */
 int dvb_vb2_fill_buffer(struct dvb_vb2_ctx *ctx,
 			const unsigned char *src, int len,
-			enum dmx_buffer_flags *buffer_flags);
+			enum dmx_buffer_flags *buffer_flags,
+			bool flush);
 
 /**
  * dvb_vb2_poll - Wrapper to vb2_core_streamon() for Digital TV
Signature · 1 line
2.51.0
author maintainer
#110 lore raw

PATCH 1/1 media: mediatek: vcodec: Don't try to decode 422/444 VP9

In reply to Sasha Levin

From: Nicolas Dufresne <[email protected]>

[ Upstream commit 3e92d7e4935084ecdbdc88880cc4688618ae1557 ]

This is not supported by the hardware and trying to decode these leads to LAT timeout errors.

---

LLM Generated explanations, may be completely bogus:

## Analysis

### 1. Commit Message Analysis

The commit message is clear and direct: "Don't try to decode 422/444 VP9" with the explanation that "this is not supported by the hardware and trying to decode these leads to LAT timeout errors." This describes a real hardware limitation that causes a user-visible failure (decode timeout).

### 2. Code Change Analysis

The change adds exactly 6 lines of code to the V4L2_CID_STATELESS_VP9_FRAME case in mtk_vdec_s_ctrl():

```496:505:drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec
_stateless.c
        case V4L2_CID_STATELESS_VP9_FRAME:
                frame = (struct v4l2_ctrl_vp9_frame *)hdr_ctrl->p_new.p;

                if (frame->bit_depth == 10) {
                        ctx->is_10bit_bitstream = true;
                } else if (frame->bit_depth != 8) {
                        mtk_v4l2_vdec_err(ctx, "VP9: bit_depth:%d",
frame->bit_depth);
                        return -EINVAL;
                }
                break;
```

The new code, inserted between the bit_depth check and the break, checks the VP9 frame's subsampling flags. Both V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING and V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING must be set (indicating 4:2:0). If either is missing, it means the stream uses 4:2:2, 4:4:0, or 4:4:4 — all unsupported.

### 3. The Bug Mechanism (Detailed)

The critical path that allows unsupported VP9 streams to reach the hardware:

**Step 1**: The V4L2 core validates VP9 frame data in validate_vp9_frame() (in v4l2-ctrls-core.c). This validates *VP9 spec compliance* — e.g., profile 0/2 must be 4:2:0, profile 1/3 must be non-4:2:0. It does NOT enforce driver-specific hardware limitations.

```606:616:drivers/media/v4l2-core/v4l2-ctrls-core.c
        /* Profile 0 and 2 only accept YUV 4:2:0. */
        if ((frame->profile == 0 || frame->profile == 2) &&
            (!(frame->flags & V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING) ||
             !(frame->flags & V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING)))
                return -EINVAL;

        /* Profile 1 and 3 only accept YUV 4:2:2, 4:4:0 and 4:4:4. */
        if ((frame->profile == 1 || frame->profile == 3) &&
            ((frame->flags & V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING) &&
             (frame->flags & V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING)))
                return -EINVAL;
```

**Step 2**: The VP9 PROFILE menu control and the VP9 FRAME compound control are **separate, independent V4L2 controls**. The profile field inside the FRAME control is not cross-validated against the PROFILE menu control. So userspace can submit a VP9 frame with profile=1 even if the PROFILE control only advertises support for profiles 0 and 2.

**Step 3**: The driver's s_ctrl handler only checked bit_depth, not subsampling. So a valid VP9 spec frame with profile 1 and 4:2:2 subsampling would pass all checks and reach the hardware.

**Step 4**: The MediaTek hardware decoder only supports 4:2:0. The VP9 LAT decoder has a struct vdec_vp9_slice_reference with subsampling_x and subsampling_y fields that get passed to firmware/hardware. Attempting to decode non-4:2:0 causes a LAT hardware timeout (1000ms via WAIT_INTR_TIMEOUT_MS).

### 4. Impact on Stable Trees

**v6.6** is especially affected. I verified that:
- The file and the mtk_vdec_s_ctrl function exist in v6.6 (added via commit 9d86be9bda6cd)
- In v6.6, the VP9 profile control allows ALL profiles 0-3 (max = V4L2_MPEG_VIDEO_VP9_PROFILE_3) with **no skip mask**. This means profiles 1 and 3 (which require non-4:2:0 subsampling) are explicitly advertised as supported, making the bug trivially reproducible with any VP9 4:2:2 content.
- The code context at the insertion point in v6.6 is identical to the diff context, so the patch applies cleanly.

**v6.12** already has the profile restriction (menu_skip_mask = BIT(V4L2_MPEG_VIDEO_VP9_PROFILE_1), max = PROFILE_2), which reduces the attack surface, but the bug still exists because the FRAME control's profile field is not validated against the PROFILE control.

**v6.1 and earlier**: The s_ctrl handler doesn't exist, so the patch doesn't apply.

### 5. Patch Characteristics

- **Size**: 6 new lines
- **Self-contained**: No dependencies on any other commits
- **Pattern**: Follows the exact same validation pattern as the bit_depth check immediately above it
- **Error handling**: Standard -EINVAL return with diagnostic error message
- **Risk**: Extremely low — only rejects invalid configurations that the hardware cannot handle
- **Reviewed-by**: AngeloGioacchino Del Regno (Collabora, MediaTek subsystem maintainer)

### 6. Conclusion

This commit fixes a real, user-visible hardware bug. Without this fix, attempting to decode VP9 4:2:2 or 4:4:4 content on MediaTek SoCs causes a 1-second hardware timeout, resulting in decode errors. The fix is small (6 lines), surgical, self-contained, follows existing code patterns exactly, and has zero risk of regression (it only rejects configurations that will always fail). It's especially important for v6.6 where the profile control doesn't even restrict non-4:2:0 profiles.

**YES**

 .../mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c      | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_stateless.c +6 -0
index d873159b9b306..9eef3ff2b1278 100644
@@ -502,6 +502,12 @@ static int mtk_vdec_s_ctrl(struct v4l2_ctrl *ctrl)
 			mtk_v4l2_vdec_err(ctx, "VP9: bit_depth:%d", frame->bit_depth);
 			return -EINVAL;
 		}
+
+		if (!(frame->flags & V4L2_VP9_FRAME_FLAG_X_SUBSAMPLING) ||
+		    !(frame->flags & V4L2_VP9_FRAME_FLAG_Y_SUBSAMPLING)) {
+			mtk_v4l2_vdec_err(ctx, "VP9: only 420 subsampling is supported");
+			return -EINVAL;
+		}
 		break;
 	case V4L2_CID_STATELESS_AV1_SEQUENCE:
 		seq = (struct v4l2_ctrl_av1_sequence *)hdr_ctrl->p_new.p;
Signature · 1 line
2.51.0
author maintainer
#111 lore raw

PATCH 1/1 drm/panthor: Always wait after sending a command to an AS

In reply to Sasha Levin

From: Boris Brezillon <[email protected]>

[ Upstream commit d2c6fde56d451ca48a5e03428535ce3dbc8fc910 ]

There's currently no situation where we want to issue a command to an AS and not wait for this command to complete. The wait is either explicitly done (LOCK, UNLOCK) or it's missing (UPDATE). So let's turn write_cmd() into as_send_cmd_and_wait() that has the wait after a command is sent.

v2:
- New patch

v3:
- Collect R-b

v4:
- No changes

---

LLM Generated explanations, may be completely bogus:

## Comprehensive Analysis

### 1. COMMIT MESSAGE ANALYSIS

The commit message states: *"There's currently no situation where we want to issue a command to an AS and not wait for this command to complete. The wait is either explicitly done (LOCK, UNLOCK) or it's missing (UPDATE)."*

This is a clear admission that the AS_COMMAND_UPDATE command paths are **missing a required wait** for command completion. The commit author (Boris Brezillon, the panthor subsystem author) explicitly identifies this as a bug: the hardware requires waiting for every AS command to complete, but UPDATE commands were missing this wait.

### 2. CODE CHANGE ANALYSIS - THE BUG

#### Before the fix:

The original write_cmd() function at line 513-523 only:
1. Waits for the MMU to be ready to accept a command (wait_ready() before writing)
2. Writes the command to the AS_COMMAND register
3. **Does NOT wait for the command to complete**

```507:523:drivers/gpu/drm/panthor/panthor_mmu.c
static int wait_ready(struct panthor_device *ptdev, u32 as_nr)
{
        // ...polls AS_STATUS for AS_ACTIVE to clear...
}

static int write_cmd(struct panthor_device *ptdev, u32 as_nr, u32 cmd)
{
        int status;
        status = wait_ready(ptdev, as_nr);  // Wait BEFORE sending
        if (!status)
                gpu_write(ptdev, AS_COMMAND(as_nr), cmd);
        return status;  // Returns IMMEDIATELY - no wait AFTER
}
```

#### The inconsistent callers:

- **lock_region()** (line 556): Calls write_cmd(AS_COMMAND_LOCK) — the subsequent call to wait_ready() exists at line 591 in mmu_hw_do_operation_locked(). So LOCK effectively waited, but in a fragmented way.
- **mmu_hw_do_operation_locked()** (line 604): Calls write_cmd(AS_COMMAND_UNLOCK) followed by wait_ready() at line 607. So UNLOCK explicitly waited.
- **panthor_mmu_as_enable()** (line 636): Calls write_cmd(AS_COMMAND_UPDATE) — **NO subsequent wait_ready()!** The function returns immediately.
- **panthor_mmu_as_disable()** (line 651): Calls write_cmd(AS_COMMAND_UPDATE) — **NO subsequent wait_ready()!** Same bug.

#### What this means:

When the MMU address space is enabled or disabled via AS_COMMAND_UPDATE, the code does not wait for the GPU hardware to finish processing the command. This is a **hardware protocol violation** — the software proceeds to use the address space (or assume it's been disabled) before the GPU has actually completed the operation.

#### The consequences of this bug:

1. **panthor_mmu_as_enable()**: Called when activating a VM's address space for GPU usage (line 792 in panthor_vm_active). After this returns, the code sets refcount_set(&vm->as.active_cnt, 1) and unlocks the mutex. Subsequent GPU operations may start using this address space **before the UPDATE command has completed on the hardware**, potentially causing GPU faults, page translation failures, or data corruption.

2. **panthor_mmu_as_disable()**: Called in multiple critical paths:
- MMU fault handler (line 1694): Disabling a faulting AS. If the UPDATE hasn't completed, subsequent fault handling may race.
- Device suspend/reset (lines 1723, 2687): During orderly shutdown. If UPDATE doesn't complete, cleanup may be incomplete.
- VM idle path (line 1843): Normal VM deactivation.

#### Cross-reference with panfrost driver:

The older panfrost driver (for earlier Mali GPUs) has the **exact same bug pattern** at lines 188 and 204 — panfrost_mmu_enable() and panfrost_mmu_disable() also call write_cmd(AS_COMMAND_UPDATE) without waiting. This confirms it's a long-standing inherited bug from the original code.

### 3. CLASSIFICATION

This is a **real bug fix**: it adds a missing hardware synchronization wait after sending a command to the GPU's MMU address space hardware. The fix ensures the software doesn't proceed until the hardware has actually processed the address space configuration change.

However, the commit message is written more as a "cleanup/consolidation" rather than explicitly calling out the bug's user-visible symptoms. The author says the wait is "missing" for UPDATE, confirming it's a bug, but doesn't describe specific symptoms (crashes, GPU faults, etc.).

### 4. SCOPE AND RISK ASSESSMENT

- **Lines changed**: ~30 lines across 1 file
- **Files touched**: 1 (drivers/gpu/drm/panthor/panthor_mmu.c)
- **Subsystem**: GPU driver (drm/panthor) — affects only Mali CSF GPUs (Valhall/5th Gen)
- **Risk**: LOW — The change adds a wait_ready() call (a 100μs timeout poll) that was already being done for all other AS commands. This is the correct hardware protocol.
- **Regression risk**: Very low. The only negative effect could be a very slight latency increase on the AS enable/disable path (up to 100μs per operation), which is negligible.

### 5. USER IMPACT

- Panthor driver was introduced in kernel v6.10, so stable trees 6.10.y through 6.18.y would be affected
- Users of Mali Valhall (G710, G610) and 5th Gen (G720, G620) GPUs are affected
- This includes some Chromebook models, RK3588-based boards, and MediaTek platforms
- Without this fix, users may experience intermittent GPU faults, translation errors, or subtle corruption when VMs are activated/deactivated rapidly (e.g., during context switches, suspend/resume)

### 6. DEPENDENCY CHECK

The commit applies on top of 24f028b91ed3 ("drm/panthor: Simplify mmu_hw_do_operation_locked"), which is already in the tree. The current code in the tree already has the simplified mmu_hw_do_operation_locked() with the switch statement that the diff's context matches. The commit appears self-contained and doesn't require other patches from its series.

However, the diff context shows it changes lock_region() to also error-check and use the new combined as_send_cmd_and_wait(), and mmu_hw_do_operation_locked() removes a now-redundant wait_ready(). This is all within one function/file and is self-contained.

### 7. STABILITY INDICATORS

- **Reviewed-by: Steven Price** — ARM Mali kernel developer/maintainer
- The patch went through 4 revisions (v1 through v4), indicating careful review
- The author (Boris Brezillon) is the original panthor driver author

### 8. CONCERNS

- The commit is patch 2 of a series. We should check if the series has other critical patches. However, this specific commit is self- contained in its fix.
- The commit message frames this as consolidation rather than urgent bugfix. But the actual code change fixes a real, documented missing wait.
- The bug may be hard to trigger in practice if the hardware is fast enough to process UPDATE commands before subsequent operations happen. But under load or on slower hardware, it could manifest as intermittent GPU faults.

### VERDICT

This commit fixes a **real hardware synchronization bug** — a missing wait_ready() after AS_COMMAND_UPDATE in the MMU address space management. The fix is:
- Small and contained (1 file, ~30 lines)
- Obviously correct (all other AS commands already waited; this makes UPDATE consistent)
- Fixes a potential race between software and hardware that could cause GPU faults
- Low regression risk (just adds a hardware completion poll)
- Self-contained (no external dependencies beyond what's already in stable)
- Reviewed by the ARM Mali maintainer

While the bug may be hard to trigger in practice, the consequences (GPU translation faults, potential data corruption) are serious when it does trigger, and the fix is minimal and safe.

**YES**

 drivers/gpu/drm/panthor/panthor_mmu.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)
drivers/gpu/drm/panthor/panthor_mmu.c +12 -15
index f6339963e4960..d70acff33d41e 100644
@@ -510,27 +510,29 @@ static int wait_ready(struct panthor_device *ptdev, u32 as_nr)
 	return ret;
 }
 
-static int write_cmd(struct panthor_device *ptdev, u32 as_nr, u32 cmd)
+static int as_send_cmd_and_wait(struct panthor_device *ptdev, u32 as_nr, u32 cmd)
 {
 	int status;
 
 	/* write AS_COMMAND when MMU is ready to accept another command */
 	status = wait_ready(ptdev, as_nr);
-	if (!status)
+	if (!status) {
 		gpu_write(ptdev, AS_COMMAND(as_nr), cmd);
+		status = wait_ready(ptdev, as_nr);
+	}
 
 	return status;
 }
 
-static void lock_region(struct panthor_device *ptdev, u32 as_nr,
-			u64 region_start, u64 size)
+static int lock_region(struct panthor_device *ptdev, u32 as_nr,
+		       u64 region_start, u64 size)
 {
 	u8 region_width;
 	u64 region;
 	u64 region_end = region_start + size;
 
 	if (!size)
-		return;
+		return 0;
 
 	/*
 	 * The locked region is a naturally aligned power of 2 block encoded as
@@ -553,7 +555,7 @@ static void lock_region(struct panthor_device *ptdev, u32 as_nr,
 
 	/* Lock the region that needs to be updated */
 	gpu_write64(ptdev, AS_LOCKADDR(as_nr), region);
-	write_cmd(ptdev, as_nr, AS_COMMAND_LOCK);
+	return as_send_cmd_and_wait(ptdev, as_nr, AS_COMMAND_LOCK);
 }
 
 static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr,
@@ -586,9 +588,7 @@ static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr,
 	 * power it up
 	 */
 
-	lock_region(ptdev, as_nr, iova, size);
-
-	ret = wait_ready(ptdev, as_nr);
+	ret = lock_region(ptdev, as_nr, iova, size);
 	if (ret)
 		return ret;
 
@@ -601,10 +601,7 @@ static int mmu_hw_do_operation_locked(struct panthor_device *ptdev, int as_nr,
 	 * at the end of the GPU_CONTROL cache flush command, unlike
 	 * AS_COMMAND_FLUSH_MEM or AS_COMMAND_FLUSH_PT.
 	 */
-	write_cmd(ptdev, as_nr, AS_COMMAND_UNLOCK);
-
-	/* Wait for the unlock command to complete */
-	return wait_ready(ptdev, as_nr);
+	return as_send_cmd_and_wait(ptdev, as_nr, AS_COMMAND_UNLOCK);
 }
 
 static int mmu_hw_do_operation(struct panthor_vm *vm,
@@ -633,7 +630,7 @@ static int panthor_mmu_as_enable(struct panthor_device *ptdev, u32 as_nr,
 	gpu_write64(ptdev, AS_MEMATTR(as_nr), memattr);
 	gpu_write64(ptdev, AS_TRANSCFG(as_nr), transcfg);
 
-	return write_cmd(ptdev, as_nr, AS_COMMAND_UPDATE);
+	return as_send_cmd_and_wait(ptdev, as_nr, AS_COMMAND_UPDATE);
 }
 
 static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr)
@@ -648,7 +645,7 @@ static int panthor_mmu_as_disable(struct panthor_device *ptdev, u32 as_nr)
 	gpu_write64(ptdev, AS_MEMATTR(as_nr), 0);
 	gpu_write64(ptdev, AS_TRANSCFG(as_nr), AS_TRANSCFG_ADRMODE_UNMAPPED);
 
-	return write_cmd(ptdev, as_nr, AS_COMMAND_UPDATE);
+	return as_send_cmd_and_wait(ptdev, as_nr, AS_COMMAND_UPDATE);
 }
 
 static u32 panthor_mmu_fault_mask(struct panthor_device *ptdev, u32 value)
Signature · 1 line
2.51.0
author maintainer
#112 lore raw

PATCH 1/1 drm/panel: edp: add BOE NV140WUM-T08 panel

In reply to Sasha Levin

From: Hans de Goede <[email protected]>

[ Upstream commit 349d4efadc1f831ebc0b872ba1e3a2b7dd58b72b ]

Add powerseq timing info for the BOE NV140WUM-T08 panel used on Lenovo Thinkpad T14s gen 6 (Snapdragon X1 Elite) laptops.

edid-decode (hex):

00 ff ff ff ff ff ff 00 09 e5 26 0c 00 00 00 00
0a 21 01 04 a5 1e 13 78 03 d6 62 99 5e 5a 8e 27
25 53 58 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 33 3f 80 dc 70 b0 3c 40 30 20
36 00 2e bc 10 00 00 1a 00 00 00 fd 00 28 3c 4c
4c 10 01 0a 20 20 20 20 20 20 00 00 00 fe 00 42
4f 45 20 43 51 0a 20 20 20 20 20 20 00 00 00 fe
00 4e 56 31 34 30 57 55 4d 2d 54 30 38 0a 00 fa

---

LLM Generated explanations, may be completely bogus:

Now I have a complete picture. Here's my detailed analysis:

## Commit Analysis: drm/panel: edp: add BOE NV140WUM-T08 panel

### 1. COMMIT MESSAGE ANALYSIS

The commit adds power sequencing timing information for the BOE NV140WUM-T08 eDP panel, which is used in the **Lenovo ThinkPad T14s gen 6 (Snapdragon X1 Elite)**. The message includes the full EDID hex dump, which is the standard practice for new panel entries. The commit was authored by Hans de Goede (a very well-known and prolific kernel developer, especially for laptop hardware) and reviewed by Douglas Anderson (the panel-edp.c maintainer).

### 2. CODE CHANGE ANALYSIS

The diff introduces exactly two additions:

**a) New panel_delay struct** (delay_200_500_p2e200):

```c
static const struct panel_delay delay_200_500_p2e200 = {
        .hpd_absent = 200,
        .unprepare = 500,
        .prepare_to_enable = 200,
};
```

This is a new timing combination: hpd_absent=200, unprepare=500, prepare_to_enable=200. It follows the exact naming convention of existing structs. There are already similar ones like delay_200_500_p2e80 (prepare_to_enable=80) and delay_200_500_p2e100 (prepare_to_enable=100). The existing delay_200_500_e50_d50_p2e200 also has prepare_to_enable=200 but includes enable=50 and disable=50 fields that this panel doesn't need.

**b) New EDP_PANEL_ENTRY**:

```c
EDP_PANEL_ENTRY('B', 'O', 'E', 0x0c26, &delay_200_500_p2e200,
"NV140WUM-T08"),
```

This adds the panel's EDID product code (0x0c26) to the sorted table of BOE panels, with the correct timing struct. The entry is placed in the correct sorted order between 0x0c20 and 0x0c93.

### 3. CLASSIFICATION

This is squarely in the **"NEW DEVICE IDs"** exception category for stable backporting. It adds a panel identification entry and associated timing data to an existing, well-established driver (panel-edp.c). It does **not** add a new feature, API, or behavior change. It simply ensures that when the kernel encounters this specific panel's EDID, it knows the correct power sequencing timings.

### 4. SCOPE AND RISK ASSESSMENT

- **Lines changed**: ~7 lines of pure const data additions
- **Files touched**: 1 (drivers/gpu/drm/panel/panel-edp.c)
- **Risk**: Essentially **zero**. Both additions are const data that only take effect when the kernel matches the exact EDID panel ID 0x0c26 from a BOE vendor. No existing code paths are modified. No existing panel entries are changed. Systems without this panel are completely unaffected.
- **Subsystem maturity**: The panel-edp.c driver has been present since v5.16 (September 2021) and exists in all currently maintained stable trees (6.1.y, 6.6.y, 6.12.y).

### 5. USER IMPACT

- **Who is affected**: Owners of the Lenovo ThinkPad T14s gen 6 (Snapdragon X1 Elite) laptops. This is a current, widely-available business laptop.
- **Without this fix**: The panel either won't be recognized (falling back to generic timing which may cause display flickering, blank screen on boot, or other initialization issues) or the display may not work correctly at all.
- **Severity**: Display not working properly on a shipping laptop model is a high-impact user-facing issue.

### 6. STABILITY INDICATORS

- **Author**: Hans de Goede — extremely well-known kernel developer, Qualcomm contributor, known for laptop hardware enablement
- **Reviewer**: Douglas Anderson — the maintainer of panel-edp.c, who also committed the patch
- **Pattern**: This is identical in structure to dozens of other panel additions that are routinely backported to stable (the git log shows 20 similar commits just recently)

### 7. DEPENDENCY CHECK

- **No dependencies**: The commit is entirely self-contained. It adds new const data and references only existing infrastructure (struct panel_delay, EDP_PANEL_ENTRY macro).
- **Clean backport**: The patch should apply cleanly to any stable tree that has panel-edp.c, with at worst minor context adjustments for differing surrounding panel entries (which is trivially resolvable).

### Conclusion

This is a textbook example of a panel ID / device data addition to an existing driver — one of the explicitly enumerated exceptions that qualifies for stable backporting. It adds timing data for a display panel used in a currently shipping Lenovo ThinkPad model. The change is:
- Purely const data (zero runtime risk to other systems)
- Self-contained (no dependencies)
- Written by a trusted author and reviewed by the subsystem maintainer
- Identical in pattern to hundreds of previously backported panel entries
- Fixes a real user-facing issue (display functionality on a current laptop)

**YES**

 drivers/gpu/drm/panel/panel-edp.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/panel/panel-edp.c +7 -0
index 85dd3f4cb8e1c..679f4af5246d8 100644
@@ -1730,6 +1730,12 @@ static const struct panel_delay delay_200_500_p2e100 = {
 	.prepare_to_enable = 100,
 };
 
+static const struct panel_delay delay_200_500_p2e200 = {
+	.hpd_absent = 200,
+	.unprepare = 500,
+	.prepare_to_enable = 200,
+};
+
 static const struct panel_delay delay_200_500_e50 = {
 	.hpd_absent = 200,
 	.unprepare = 500,
@@ -1977,6 +1983,7 @@ static const struct edp_panel_entry edp_panels[] = {
 	EDP_PANEL_ENTRY('B', 'O', 'E', 0x0b56, &delay_200_500_e80, "NT140FHM-N47"),
 	EDP_PANEL_ENTRY('B', 'O', 'E', 0x0b66, &delay_200_500_e80, "NE140WUM-N6G"),
 	EDP_PANEL_ENTRY('B', 'O', 'E', 0x0c20, &delay_200_500_e80, "NT140FHM-N47"),
+	EDP_PANEL_ENTRY('B', 'O', 'E', 0x0c26, &delay_200_500_p2e200, "NV140WUM-T08"),
 	EDP_PANEL_ENTRY('B', 'O', 'E', 0x0c93, &delay_200_500_e200, "Unknown"),
 	EDP_PANEL_ENTRY('B', 'O', 'E', 0x0cb6, &delay_200_500_e200, "NT116WHM-N44"),
 	EDP_PANEL_ENTRY('B', 'O', 'E', 0x0cf2, &delay_200_500_e200, "NV156FHM-N4S"),
Signature · 1 line
2.51.0
author maintainer
#113 lore raw

PATCH 1/1 ASoC: soc-acpi-intel-arl-match: change rt722 amp endpoint to aggregated

In reply to Sasha Levin

From: Bard Liao <[email protected]>

[ Upstream commit 08c09899960118ffb01417242e659eb6cc067d6a ]

rt722 is aggregated with rt1320 amp in arl_rt722_l0_rt1320_l2 and it is the only audio configuration in the ARL platform. Set .aggregated = 1 to represent the fact and avoid unexpected issue.

---

LLM Generated explanations, may be completely bogus:

So the RT722+RT1320 support was added in v6.13. This means stable trees 6.13.y and potentially 6.12.y (if it was backported) could be affected.

### Assessment

**What the commit fixes**: The RT722 codec's amplifier endpoint was incorrectly configured as non-aggregated (.aggregated = 0) when it is actually aggregated with the RT1320 amplifier. This mismatch between the software description and the actual hardware topology could cause audio initialization or routing issues on ARL platforms with this specific codec configuration.

**Is this a real bug fix?** Yes, but it's borderline. The commit message uses the vague "avoid unexpected issue" rather than describing a specific observed failure. However, incorrectly describing the hardware topology is objectively wrong — it's like having wrong device tree data. Getting the aggregation flag wrong could cause the SoundWire bus manager to incorrectly handle stream synchronization between the RT722 amp and RT1320.

**Meets stable criteria?**
- Obviously correct: Yes — the commit sets the aggregation flag to match reality
- Fixes a real bug: The hardware description was wrong; this is a correctness fix
- Small and contained: Yes — just a few struct field changes in one file
- No new features: Correct — just fixes existing configuration data

**Risk**: Very low. This only affects ARL platforms with the specific RT722+RT1320 configuration. The change is purely to endpoint metadata and is reviewed by Intel audio maintainers.

**Concern**: The commit message's vagueness about what "unexpected issue" means makes it somewhat uncertain whether this causes an actual user-visible failure or is a proactive correctness fix. However, wrong aggregation settings in SoundWire can realistically cause audio failures (amplifier not playing, stream synchronization issues).

This is a hardware configuration correctness fix — similar to a quirk or device tree fix. It's small, well-reviewed, low-risk, and fixes an objectively wrong hardware description that could cause audio issues on ARL platforms.

**YES**

 .../intel/common/soc-acpi-intel-arl-match.c   | 23 +++++++++----------
 1 file changed, 11 insertions(+), 12 deletions(-)
sound/soc/intel/common/soc-acpi-intel-arl-match.c +11 -12
index 6bf7a6250ddc3..c952f7d2b2c0e 100644
@@ -45,23 +45,22 @@ static const struct snd_soc_acpi_endpoint spk_3_endpoint = {
 	.group_id = 1,
 };
 
-/*
- * RT722 is a multi-function codec, three endpoints are created for
- * its headset, amp and dmic functions.
- */
-static const struct snd_soc_acpi_endpoint rt722_endpoints[] = {
+static const struct snd_soc_acpi_endpoint jack_amp_g1_dmic_endpoints[] = {
+	/* Jack Endpoint */
 	{
 		.num = 0,
 		.aggregated = 0,
 		.group_position = 0,
 		.group_id = 0,
 	},
+	/* Amp Endpoint, work as spk_l_endpoint */
 	{
 		.num = 1,
-		.aggregated = 0,
+		.aggregated = 1,
 		.group_position = 0,
-		.group_id = 0,
+		.group_id = 1,
 	},
+	/* DMIC Endpoint */
 	{
 		.num = 2,
 		.aggregated = 0,
@@ -229,11 +228,11 @@ static const struct snd_soc_acpi_adr_device rt711_sdca_0_adr[] = {
 	}
 };
 
-static const struct snd_soc_acpi_adr_device rt722_0_single_adr[] = {
+static const struct snd_soc_acpi_adr_device rt722_0_agg_adr[] = {
 	{
 		.adr = 0x000030025D072201ull,
-		.num_endpoints = ARRAY_SIZE(rt722_endpoints),
-		.endpoints = rt722_endpoints,
+		.num_endpoints = ARRAY_SIZE(jack_amp_g1_dmic_endpoints),
+		.endpoints = jack_amp_g1_dmic_endpoints,
 		.name_prefix = "rt722"
 	}
 };
@@ -394,8 +393,8 @@ static const struct snd_soc_acpi_link_adr arl_rt711_l0_rt1316_l3[] = {
 static const struct snd_soc_acpi_link_adr arl_rt722_l0_rt1320_l2[] = {
 	{
 		.mask = BIT(0),
-		.num_adr = ARRAY_SIZE(rt722_0_single_adr),
-		.adr_d = rt722_0_single_adr,
+		.num_adr = ARRAY_SIZE(rt722_0_agg_adr),
+		.adr_d = rt722_0_agg_adr,
 	},
 	{
 		.mask = BIT(2),
Signature · 1 line
2.51.0
author maintainer
#114 lore raw

PATCH 1/1 drm/amd/display: Adjust PHY FSM transition to TX_EN-to-PLL_ON for TMDS on DCN35

In reply to Sasha Levin

From: Nicholas Kazlauskas <[email protected]>

[ Upstream commit 75372d75a4e23783583998ed99d5009d555850da ]

[Why]
A backport of the change made for DCN401 that addresses an issue where we turn off the PHY PLL when disabling TMDS output, which causes the OTG to remain stuck.

The OTG being stuck can lead to a hang in the DCHVM's ability to ACK invalidations when it thinks the HUBP is still on but it's not receiving global sync.

The transition to PLL_ON needs to be atomic as there's no guarantee that the thread isn't pre-empted or is able to complete before the IOMMU watchdog times out.

[How]
Backport the implementation from dcn401 back to dcn35.

There's a functional difference in when the eDP output is disabled in dcn401 code so we don't want to utilize it directly.

---

LLM Generated explanations, may be completely bogus:

Here is my complete analysis:

---

## Detailed Analysis

### 1. COMMIT MESSAGE ANALYSIS

The commit subject states: "Adjust PHY FSM transition to TX_EN-to-PLL_ON for TMDS on DCN35." The body explains this is a backport of a fix originally made for DCN401 that addresses a critical issue: **when disabling TMDS output, the PHY PLL is turned off, causing the OTG (Output Timing Generator) to get stuck**. The stuck OTG leads to a hang in DCHVM (Display Controller Host Virtual Memory) because the HUBP (Hub Pre-processor) is perceived as still active but doesn't receive global sync, causing IOMMU watchdog timeouts.

Key phrases: "OTG being stuck", "hang", "IOMMU watchdog times out" — this is describing a **system hang** scenario.

The original DCN401 commit 9b68445eb657d states more explicitly: "If two monitors with TMDS signals were timing synced and one was disconnected, the stream would go out of sync too early due to the PLL turning off and **the system could hang**."

### 2. CODE CHANGE ANALYSIS

The core change is replacing dcn32_disable_link_output with a new dcn35_disable_link_output in the DCN35 hardware sequencer function table.

**Old behavior (dcn32_disable_link_output):**
1. Disable the link output via link_hwss->disable_link_output() — this turns off the PHY **completely** (SYMCLK_OFF_TX_OFF)
2. Set state to SYMCLK_OFF_TX_OFF
3. Call apply_symclk_on_tx_off_wa() — this is a **workaround** that detects if SYMCLK is still needed by OTG, and if so, **re-enables the PHY** and programs it to SYMCLK_ON_TX_OFF

The old approach has a **race window**: between step 1 (PHY fully off) and step 3 (PHY re-enabled with PLL on), there's a window where SYMCLK is off but OTG still needs it. The comment in apply_symclk_on_tx_off_wa itself acknowledges this: *"In future dcn generations, we plan to rework transmitter control interface so that we could have an option to set SYMCLK ON TX OFF state in one step without this workaround."*

**New behavior (dcn35_disable_link_output):**
1. **Before** calling link_hwss->disable_link_output(), check if this is a TMDS signal AND the OTG still references SYMCLK (symclk_ref_cnts.otg > 0)
2. If yes: **instead of fully disabling**, call disable_link_output_symclk_on_tx_off() which goes directly to the SYMCLK_ON_TX_OFF state via program_pix_clk() — **atomically**, without the intermediate SYMCLK_OFF state
3. If no: proceed with full disable as before

This eliminates the race window entirely. The transition is atomic — there's never a point where SYMCLK is off while OTG still needs it.

### 3. BUG CLASSIFICATION

This fixes a **system hang / lockup**:
- The OTG gets stuck when SYMCLK disappears while it's still in use
- The stuck OTG prevents DCHVM from ACKing IOMMU invalidations
- The IOMMU watchdog eventually times out, which can cause a **system hang**
- This is a race condition — the thread performing the disable can be preempted between the PHY-off and re-enable steps

This is a clear bug fix for a **race condition** that causes a **system hang**.

### 4. SCOPE AND RISK

**Size:** ~72 lines added across 3 files. The new function dcn35_disable_link_output is a self-contained implementation, plus the helper disable_link_output_symclk_on_tx_off, and one line changed in the function table.

**Risk assessment:**
- The new code is a near-exact copy of dcn401_disable_link_output which has been in mainline since the DCN401 commit (v6.12 timeframe)
- The only intentional difference from DCN401 is in the eDP handling:
DCN401 has a second edp_power_control() call after the TMDS check, while DCN35 keeps the unlock_phy pattern from DCN32 — the commit message explicitly acknowledges this ("There's a functional difference in when the eDP output is disabled in dcn401 code so we don't want to utilize it directly")
- The change is purely in DCN35-specific code, so it cannot affect other display controller generations
- The function has been **Reviewed-by** (Yihan Zhu) and **Tested-by** (Dan Wheeler, AMD's test engineer)

**Risk is LOW**: The pattern is proven on DCN401 and is a surgical fix to a specific DCN35 function table entry.

### 5. USER IMPACT

DCN35 is AMD's display controller in Ryzen 8000 series (Phoenix/Hawk Point) APUs — widely deployed in consumer laptops and desktops. Users with TMDS (HDMI/DVI) displays connected to DCN35-based systems can hit this hang, especially in multi-monitor configurations where one monitor is disconnected. This is a **real user-facing hang** scenario.

### 6. DEPENDENCY CHECK

- dc_is_tmds_signal(): inline function in signal_types.h — available in all relevant stable trees
- get_link_hwss(): defined in dc_resource.c and declared in link_hwss.h (already included)
- DP_UNKNOWN_ENCODING: enum in dc_dp_types.h — available
- SYMCLK_ON_TX_OFF, SYMCLK_OFF_TX_OFF: enums in dc_hw_types.h — available since DCN32
- DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY: available in dpcd_defs

DCN35 code exists in stable kernels starting from **v6.8**. All current active stable trees that include DCN35 (6.12.y, 6.13.y, 6.14.y) currently use dcn32_disable_link_output and would benefit from this fix.

The commit is **self-contained** — it adds a new function and wires it up. No dependency on other patches.

### 7. STABILITY INDICATORS

- **Reviewed-by: Yihan Zhu** — reviewed by AMD display team member
- **Tested-by: Dan Wheeler** — AMD's display test lead
- The original DCN401 implementation has been in mainline since ~v6.12
- The author (Nicholas Kazlauskas) is a well-known AMD display developer

### Summary

This commit fixes a **system hang / lockup** caused by a **race condition** in the PHY state machine transition for TMDS outputs on DCN35 (AMD Phoenix/Hawk Point display controllers). The old dcn32_disable_link_output had a race window where SYMCLK could be off while the OTG still needed it, causing the OTG to get stuck and eventually triggering an IOMMU watchdog timeout leading to a system hang. The fix makes the transition atomic by checking the TMDS/OTG condition upfront and going directly to SYMCLK_ON_TX_OFF instead of the two-step off-then-on workaround.

The fix is small (~72 lines), self-contained, well-tested by AMD, based on proven DCN401 code, and addresses a real user-facing system hang on widely deployed hardware. It meets all stable kernel criteria: obviously correct (modeled after DCN401), fixes a real bug (system hang), small scope (DCN35-only), and introduces no new features.

**YES**

 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c   | 52 +++++++++++++++++++
 .../amd/display/dc/hwss/dcn35/dcn35_hwseq.h   |  3 ++
 .../amd/display/dc/hwss/dcn35/dcn35_init.c    |  2 +-
 3 files changed, 56 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +52 -0
index cb2dfd34b5e2e..88542ca715573 100644
@@ -1726,3 +1726,55 @@ void dcn35_program_cursor_offload_now(struct dc *dc, const struct pipe_ctx *pipe
 {
 	dc_dmub_srv_program_cursor_now(dc, pipe);
 }
+
+static void disable_link_output_symclk_on_tx_off(struct dc_link *link, enum dp_link_encoding link_encoding)
+{
+	struct dc *dc = link->ctx->dc;
+	struct pipe_ctx *pipe_ctx = NULL;
+	uint8_t i;
+
+	for (i = 0; i < MAX_PIPES; i++) {
+		pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i];
+		if (pipe_ctx->stream && pipe_ctx->stream->link == link && pipe_ctx->top_pipe == NULL) {
+			pipe_ctx->clock_source->funcs->program_pix_clk(
+					pipe_ctx->clock_source,
+					&pipe_ctx->stream_res.pix_clk_params,
+					link_encoding,
+					&pipe_ctx->pll_settings);
+			break;
+		}
+	}
+}
+
+void dcn35_disable_link_output(struct dc_link *link,
+		const struct link_resource *link_res,
+		enum signal_type signal)
+{
+	struct dc *dc = link->ctx->dc;
+	const struct link_hwss *link_hwss = get_link_hwss(link, link_res);
+	struct dmcu *dmcu = dc->res_pool->dmcu;
+
+	if (signal == SIGNAL_TYPE_EDP &&
+			link->dc->hwss.edp_backlight_control &&
+			!link->skip_implict_edp_power_control)
+		link->dc->hwss.edp_backlight_control(link, false);
+	else if (dmcu != NULL && dmcu->funcs->lock_phy)
+		dmcu->funcs->lock_phy(dmcu);
+
+	if (dc_is_tmds_signal(signal) && link->phy_state.symclk_ref_cnts.otg > 0) {
+		disable_link_output_symclk_on_tx_off(link, DP_UNKNOWN_ENCODING);
+		link->phy_state.symclk_state = SYMCLK_ON_TX_OFF;
+	} else {
+		link_hwss->disable_link_output(link, link_res, signal);
+		link->phy_state.symclk_state = SYMCLK_OFF_TX_OFF;
+	}
+	/*
+	 * Add the logic to extract BOTH power up and power down sequences
+	 * from enable/disable link output and only call edp panel control
+	 * in enable_link_dp and disable_link_dp once.
+	 */
+	if (dmcu != NULL && dmcu->funcs->unlock_phy)
+		dmcu->funcs->unlock_phy(dmcu);
+
+	dc->link_srv->dp_trace_source_sequence(link, DPCD_SOURCE_SEQ_AFTER_DISABLE_LINK_PHY);
+}
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.h +3 -0
index 1ff41dba556c0..e3459546a908a 100644
@@ -108,5 +108,8 @@ void dcn35_update_cursor_offload_pipe(struct dc *dc, const struct pipe_ctx *pipe
 void dcn35_notify_cursor_offload_drr_update(struct dc *dc, struct dc_state *context,
 					    const struct dc_stream_state *stream);
 void dcn35_program_cursor_offload_now(struct dc *dc, const struct pipe_ctx *pipe);
+void dcn35_disable_link_output(struct dc_link *link,
+		const struct link_resource *link_res,
+		enum signal_type signal);
 
 #endif /* __DC_HWSS_DCN35_H__ */
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_init.c +1 -1
index 5a66c9db26709..81bd36f3381db 100644
@@ -113,7 +113,7 @@ static const struct hw_sequencer_funcs dcn35_funcs = {
 	.enable_lvds_link_output = dce110_enable_lvds_link_output,
 	.enable_tmds_link_output = dce110_enable_tmds_link_output,
 	.enable_dp_link_output = dce110_enable_dp_link_output,
-	.disable_link_output = dcn32_disable_link_output,
+	.disable_link_output = dcn35_disable_link_output,
 	.z10_restore = dcn35_z10_restore,
 	.z10_save_init = dcn31_z10_save_init,
 	.set_disp_pattern_generator = dcn30_set_disp_pattern_generator,
Signature · 1 line
2.51.0
author maintainer
#115 lore raw

PATCH 1/1 ALSA: usb-audio: Add iface reset and delay quirk for AB13X USB Audio

In reply to Sasha Levin

From: Lianqin Hu <[email protected]>

[ Upstream commit ac656d7d7c70f7c352c7652bc2bb0c1c8c2dde08 ]

Setting up the interface when suspended/resumeing fail on this card. Adding a reset and delay quirk will eliminate this problem.

usb 1-1: New USB device found, idVendor=001f, idProduct=0b21 usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 1-1: Product: AB13X USB Audio
usb 1-1: Manufacturer: Generic
usb 1-1: SerialNumber: 20210926172016

---

LLM Generated explanations, may be completely bogus:

## Analysis of ALSA: usb-audio: Add iface reset and delay quirk for AB13X USB Audio

### Commit Message Analysis

The commit message clearly describes a **suspend/resume failure** on the AB13X USB Audio device (vendor 0x001f, product 0x0b21). The fix adds two quirk flags (QUIRK_FLAG_FORCE_IFACE_RESET and QUIRK_FLAG_IFACE_DELAY) to work around the hardware's broken behavior during interface setup on suspend/resume cycles.

### Code Change Analysis

The change is a **two-line addition** (plus a comment) to the quirk_flags_table[] array in sound/usb/quirks.c:

```c
DEVICE_FLG(0x001f, 0x0b21, /* AB13X USB Audio */
           QUIRK_FLAG_FORCE_IFACE_RESET | QUIRK_FLAG_IFACE_DELAY),
```

This is inserted in the correct sorted position (by vendor ID) in the existing quirk flags table. The quirk flags QUIRK_FLAG_FORCE_IFACE_RESET and QUIRK_FLAG_IFACE_DELAY are pre- existing flags already used by other devices in the table — no new infrastructure is introduced.

### Classification: Hardware Quirk

This falls squarely into the **hardware quirks/workarounds** exception category for stable backporting:

- **It uses existing quirk infrastructure** — the flags and the table mechanism already exist in the kernel
- **It targets a specific device** (USB vendor 0x001f, product 0x0b21) — zero risk to any other device
- **It fixes a real user-facing bug** — suspend/resume failure means the audio device stops working after a laptop suspends and resumes, which is a common operation for laptop users
- **The pattern is identical to many other entries** in the same table (e.g., the HP 320 FHD Webcam, Creative SB Extigy, MS USB Link headset, etc.)

### Scope and Risk Assessment

- **Lines changed**: 2 (plus comment) — trivially small
- **Files touched**: 1 (sound/usb/quirks.c)
- **Risk**: Essentially zero — this only activates for the specific USB device ID 0x001f:0x0b21, and the quirk flags are well-tested mechanisms used by many other devices
- **Dependencies**: None — the quirk flags and table infrastructure have existed for a long time in stable kernels

### User Impact

- **Who is affected**: Users with the AB13X USB Audio device (Generic brand, manufactured 2021+)
- **Severity without fix**: Audio device fails on suspend/resume — a significant usability problem for laptop users
- **Severity of fix**: Adds a reset and delay during interface setup, which is a standard workaround for USB audio devices with timing issues

### Stability Indicators

- Accepted by Takashi Iwai (ALSA maintainer) — the subsystem maintainer reviewed and merged this
- The same quirk pattern is used by dozens of other devices in the same table with no issues
- The change is data-only (adding an entry to a table) with no logic changes

### Conclusion

This is a textbook example of a **hardware quirk addition** that belongs in stable trees. It:
1. Fixes a real bug (suspend/resume failure)
2. Is obviously correct (uses existing, well-tested quirk infrastructure)
3. Is tiny and self-contained (2-line table entry addition)
4. Has zero risk of regression (device-specific, no logic changes)
5. Has no dependencies on other commits

**YES**

 sound/usb/quirks.c | 2 ++
 1 file changed, 2 insertions(+)
sound/usb/quirks.c +2 -0
index d550c84e7752f..9fb823b11caaa 100644
@@ -2147,6 +2147,8 @@ struct usb_audio_quirk_flags_table {
 
 static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
 	/* Device matches */
+	DEVICE_FLG(0x001f, 0x0b21, /* AB13X USB Audio */
+		   QUIRK_FLAG_FORCE_IFACE_RESET | QUIRK_FLAG_IFACE_DELAY),
 	DEVICE_FLG(0x03f0, 0x654a, /* HP 320 FHD Webcam */
 		   QUIRK_FLAG_GET_SAMPLE_RATE | QUIRK_FLAG_MIC_RES_16),
 	DEVICE_FLG(0x041e, 0x3000, /* Creative SB Extigy */
Signature · 1 line
2.51.0
author maintainer
#116 lore raw

PATCH 1/1 ALSA: hda/realtek: add HP Victus 16-e0xxx mute LED quirk

In reply to Sasha Levin

From: Bharat Dev Burman <[email protected]>

[ Upstream commit 72919c57a055f6d7b79d66731dc398e9b433f47c ]

HP Victus 16-e0xxx with ALC245 codec does not handle the toggling of the mute LED.
This patch adds a quirk entry for subsystem ID 0x88eb using a new ALC245_FIXUP_HP_MUTE_LED_V2_COEFBIT fixup, enabling correct mute LED behavior.

---

LLM Generated explanations, may be completely bogus:

## Analysis

### Commit Message Analysis

This commit adds a hardware quirk for the HP Victus 16-e0xxx laptop with ALC245 codec. The mute LED does not toggle correctly without this quirk. It adds a new SND_PCI_QUIRK entry (subsystem ID 0x103c:0x88eb) and a new fixup function alc245_fixup_hp_mute_led_v2_coefbit.

### Code Change Analysis

The change has three parts:

1. **New fixup function alc245_fixup_hp_mute_led_v2_coefbit** (~16 lines): This is nearly identical to the existing alc245_fixup_hp_mute_led_v1_coefbit, differing only in the mask field:
- v1: spec->mute_led_coef.mask = 3 << 2; (bits 2-3)
- v2: spec->mute_led_coef.mask = 1 << 3; (bit 3 only)

The on value (1 << 3) and all other fields are the same. This is
a trivial variation of an existing pattern for a different hardware configuration.

2. **New enum value ALC245_FIXUP_HP_MUTE_LED_V2_COEFBIT**: Added to the fixup enum, standard boilerplate.

3. **New quirk table entry**: SND_PCI_QUIRK(0x103c, 0x88eb, "HP Victus 16-e0xxx", ALC245_FIXUP_HP_MUTE_LED_V2_COEFBIT) — a single-line addition to the quirk table.

### Classification

This is a **hardware quirk / workaround** — one of the explicitly allowed exception categories for stable backports. Audio codec quirks in patch_realtek.c are extremely common in stable trees. The SND_PCI_QUIRK mechanism is designed exactly for this purpose: matching specific hardware by PCI subsystem ID and applying device-specific fixups.

### Scope and Risk Assessment

- **Size**: Small — ~20 lines of new code, all following well- established patterns
- **Risk**: Very low — the new quirk only activates on the specific subsystem ID 0x103c:0x88eb. It cannot affect any other hardware.
- **Pattern**: The new function is a minor variation of an existing, proven function. The only difference is one bitmask value.
- **No behavioral changes** for any other system.

### User Impact

Users with HP Victus 16-e0xxx laptops currently have a non-functional mute LED indicator. While not a crash or data corruption issue, mute LED behavior is important for usability — users need visual feedback to know whether their microphone/speakers are muted. This is a real hardware issue affecting real users.

### Stability Indicators

- Accepted by the HDA subsystem maintainer (Takashi Iwai)
- Follows an extremely well-established pattern in the Realtek HDA driver
- The quirk mechanism has been stable for many years

### Dependency Check

No dependencies on other commits. The base infrastructure (coef_mute_led_set, alc_update_coef_led, struct coef_fw for LED coefficients) has existed in stable trees for a long time. The new function uses only existing helpers and structures.

### Verdict

This is a textbook audio codec quirk addition — a new SND_PCI_QUIRK entry with a minor variation fixup function for a specific HP laptop model. These are among the most common and safest stable backport candidates. The change is small, self-contained, risk-free to other hardware, and fixes a real user-facing issue (broken mute LED).

**YES**

 sound/hda/codecs/realtek/alc269.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
sound/hda/codecs/realtek/alc269.c +22 -0
index da71237d2ccb0..0924dbf1ed334 100644
@@ -1551,6 +1551,22 @@ static void alc245_fixup_hp_mute_led_v1_coefbit(struct hda_codec *codec,
 	}
 }
 
+static void alc245_fixup_hp_mute_led_v2_coefbit(struct hda_codec *codec,
+					  const struct hda_fixup *fix,
+					  int action)
+{
+	struct alc_spec *spec = codec->spec;
+
+	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+		spec->mute_led_polarity = 0;
+		spec->mute_led_coef.idx = 0x0b;
+		spec->mute_led_coef.mask = 1 << 3;
+		spec->mute_led_coef.on = 1 << 3;
+		spec->mute_led_coef.off = 0;
+		snd_hda_gen_add_mute_led_cdev(codec, coef_mute_led_set);
+	}
+}
+
 /* turn on/off mic-mute LED per capture hook by coef bit */
 static int coef_micmute_led_set(struct led_classdev *led_cdev,
 				enum led_brightness brightness)
@@ -3828,6 +3844,7 @@ enum {
 	ALC287_FIXUP_YOGA7_14ARB7_I2C,
 	ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
 	ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT,
+	ALC245_FIXUP_HP_MUTE_LED_V2_COEFBIT,
 	ALC245_FIXUP_HP_X360_MUTE_LEDS,
 	ALC287_FIXUP_THINKPAD_I2S_SPK,
 	ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD,
@@ -6165,6 +6182,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc245_fixup_hp_mute_led_v1_coefbit,
 	},
+	[ALC245_FIXUP_HP_MUTE_LED_V2_COEFBIT] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc245_fixup_hp_mute_led_v2_coefbit,
+	},
 	[ALC245_FIXUP_HP_X360_MUTE_LEDS] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc245_fixup_hp_mute_led_coefbit,
@@ -6654,6 +6675,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
 	SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
 	SND_PCI_QUIRK(0x103c, 0x88dd, "HP Pavilion 15z-ec200", ALC285_FIXUP_HP_MUTE_LED),
+	SND_PCI_QUIRK(0x103c, 0x88eb, "HP Victus 16-e0xxx", ALC245_FIXUP_HP_MUTE_LED_V2_COEFBIT),
 	SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
 	SND_PCI_QUIRK(0x103c, 0x890e, "HP 255 G8 Notebook PC", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2),
 	SND_PCI_QUIRK(0x103c, 0x8919, "HP Pavilion Aero Laptop 13-be0xxx", ALC287_FIXUP_HP_GPIO_LED),
Signature · 1 line
2.51.0
author maintainer
#117 lore raw

PATCH 1/1 drm/xe/xe3_lpg: Apply Wa_16028005424

In reply to Sasha Levin

From: Balasubramani Vivekanandan <[email protected]>

[ Upstream commit 9d94c1cf6ef938abd4b849b66f8eab11e3c537ef ]

Applied Wa_16028005424 to Graphics version from 30.00 to 30.05

---

LLM Generated explanations, may be completely bogus:

Here is my complete analysis:

## Commit Analysis: drm/xe/xe3_lpg: Apply Wa_16028005424

### 1. Commit Message Analysis

The commit adds hardware workaround Wa_16028005424 for Intel Xe3_LPG GPUs targeting graphics versions 30.00 through 30.05. The commit message is sparse (typical for Intel HW workaround additions), referencing only the internal workaround number. It has Reviewed-by: Matt Roper (a senior Intel GPU developer), which provides confidence in its correctness.

### 2. Code Change Analysis

The change is small and consists of three parts:

**a) Register definition** (regs/xe_guc_regs.h): Adds GUC_INTR_CHICKEN register at offset 0xc50c and defines DISABLE_SIGNALING_ENGINES as bit 1. This is a GuC (Graphics microController) interrupt "chicken register" - Intel terminology for a hardware debug/workaround register.

**b) Include addition** (xe_wa.c): Adds #include "regs/xe_guc_regs.h" so the new register definition is accessible.

**c) Workaround entry** (xe_wa.c in gt_was[] table):

```c
{ XE_RTP_NAME("16028005424"),
  XE_RTP_RULES(GRAPHICS_VERSION_RANGE(3000, 3005)),
  XE_RTP_ACTIONS(SET(GUC_INTR_CHICKEN, DISABLE_SIGNALING_ENGINES))
},
```

This uses the well-tested xe_rtp_entry_sr workaround infrastructure to set the chicken bit during GT initialization. This is the exact same infrastructure used by every other GT-level workaround in the driver.

### 3. Classification: Hardware Workaround / Quirk

This is a textbook hardware workaround. Intel's numbered "Wa_XXXXXXXX" entries represent documented hardware errata tracked in their internal systems. The name "DISABLE_SIGNALING_ENGINES" in the "GUC_INTR_CHICKEN" register indicates this disables incorrect engine-to-GuC interrupt signaling behavior. Without this workaround, Xe3_LPG GPUs could experience:
- GPU hangs from incorrect GuC interrupt handling
- Spurious engine interrupts causing instability
- Work completion notification failures

### 4. Scope and Risk Assessment

- **Lines changed**: ~10 total (3 register defs, 1 include, 4 workaround entry lines)
- **Files touched**: 2 (xe_guc_regs.h, xe_wa.c)
- **Affected hardware**: Only Xe3_LPG GPUs (graphics versions 30.00-30.05)
- **Risk**: Very low - uses established infrastructure, hardware- specific, no behavioral change for other platforms
- **Self-contained**: Yes - no dependencies on other patches

### 5. Platform Availability in Stable Trees

Xe3_LPG (graphics version 3000) was introduced in kernel 6.13 (800d75bf20ae). Versions 3004/3005 were added in 6.19 (4fde66699f1c). The workaround's GRAPHICS_VERSION_RANGE(3000, 3005) covers all variants. In older stable trees (6.13-6.18), it would still correctly match the supported versions (3000, 3001, 3003).

### 6. Pattern Consistency

Numerous similar Xe3_LPG workaround additions have been merged into stable trees:
- Wa_15016589081 for xe3lpg
- Wa_14023061436 for Xe3
- WA_14024681466 for Xe3_LPG
- Wa_18041344222 for Xe3 30.00/30.01
- Wa_13012615864 for xe3lpg
- Wa_16024792527 for xe3lpg
- Wa_14022293748, Wa_22019794406 for xe3lpg (cherry-picked)

All follow the identical pattern of small, self-contained workaround table entries.

### 7. Stability Indicators

- Reviewed-by: Matt Roper (senior Intel GPU developer)
- Well-established infrastructure (gt_was[] table, xe_rtp_entry_sr)
- Follows identical patterns to dozens of other workaround additions
- Commit from Intel internal developers maintaining the driver

### 8. Concerns

- No explicit description of the bug symptom (typical for Intel WA additions)
- No Fixes: tag or Cc: stable (expected - that's why we're reviewing it)
- Xe3_LPG is relatively new hardware (6.13+)

### Decision

This commit is a standard Intel GPU hardware workaround that fits squarely within the "quirks and workarounds" exception for stable kernels. It is small (10 lines total), self-contained, hardware- specific, uses proven infrastructure, and addresses a documented hardware errata in the GuC interrupt subsystem. The risk of regression is near zero because it only affects Xe3_LPG hardware and uses the same mechanism as dozens of other successfully backported workarounds. Without it, Xe3_LPG GPUs may experience interrupt-related issues affecting GPU stability.

**YES**

 drivers/gpu/drm/xe/regs/xe_guc_regs.h | 3 +++
 drivers/gpu/drm/xe/xe_wa.c            | 5 +++++
 2 files changed, 8 insertions(+)
drivers/gpu/drm/xe/regs/xe_guc_regs.h +3 -0
index 2118f7dec287f..87984713dd126 100644
@@ -90,6 +90,9 @@
 #define GUC_SEND_INTERRUPT			XE_REG(0xc4c8)
 #define   GUC_SEND_TRIGGER			REG_BIT(0)
 
+#define GUC_INTR_CHICKEN			XE_REG(0xc50c)
+#define   DISABLE_SIGNALING_ENGINES		REG_BIT(1)
+
 #define GUC_BCS_RCS_IER				XE_REG(0xc550)
 #define GUC_VCS2_VCS1_IER			XE_REG(0xc554)
 #define GUC_WD_VECS_IER				XE_REG(0xc558)
drivers/gpu/drm/xe/xe_wa.c +5 -0
index e32dd2fde6f1c..d606b058d588e 100644
@@ -15,6 +15,7 @@
 
 #include "regs/xe_engine_regs.h"
 #include "regs/xe_gt_regs.h"
+#include "regs/xe_guc_regs.h"
 #include "regs/xe_regs.h"
 #include "xe_device_types.h"
 #include "xe_force_wake.h"
@@ -315,6 +316,10 @@ static const struct xe_rtp_entry_sr gt_was[] = {
 	  XE_RTP_ACTIONS(SET(VDBOX_CGCTL3F10(0), RAMDFTUNIT_CLKGATE_DIS)),
 	  XE_RTP_ENTRY_FLAG(FOREACH_ENGINE),
 	},
+	{ XE_RTP_NAME("16028005424"),
+	  XE_RTP_RULES(GRAPHICS_VERSION_RANGE(3000, 3005)),
+	  XE_RTP_ACTIONS(SET(GUC_INTR_CHICKEN, DISABLE_SIGNALING_ENGINES))
+	},
 };
 
 static const struct xe_rtp_entry_sr engine_was[] = {
Signature · 1 line
2.51.0
author maintainer
#118 lore raw

PATCH 1/1 drm/ast: Swap framebuffer writes on big-endian machines

In reply to Sasha Levin

From: René Rebe <[email protected]>

[ Upstream commit 50c26c301c5176cc8b431044390e10ec862b9b77 ]

Swap the pixel data when writing to framebuffer memory on big-endian machines. Fixes incorrect output. Aspeed graphics does not appear to support big-endian framebuffers after AST2400, although the feature has been documented.

There's a lengthy discussion at [1].

v5:
- avoid restricted cast from __be16 (kernel test robot)

---

LLM Generated explanations, may be completely bogus:

## Analysis

### 1. Commit Message Analysis

The commit fixes **incorrect display output on big-endian machines** when using the AST (Aspeed) DRM graphics driver. The commit message says:

Quoted 1 line

"Swap the pixel data when writing to framebuffer memory on big-endian

machines. Fixes incorrect output. Aspeed graphics does not appear to support big-endian framebuffers after AST2400, although the feature has been documented."

The author is René Rebe, who also authored the analogous `drm/mgag200:
Fix big-endian support commit (6cb31fba137d4), which explicitly carries a Fixes: tag and Cc: [email protected]`. This is the same class of bug fix across two different server BMC graphics drivers. The "v5" iteration marker shows the patch went through multiple rounds of review.

### 2. Code Change Analysis

The patch modifies 2 files with **17 insertions and 5 deletions** — very small and contained.

**ast_cursor.c — cursor plane fix:**
On big-endian, the cursor data is written with byte-swapped 16-bit writes (writew(swab16(...))) instead of the plain memcpy_toio(). This is wrapped in #if defined(__BIG_ENDIAN), making it entirely compiled away on little-endian systems.

**ast_mode.c — primary plane fix:**
On big-endian, ast_handle_damage() calls drm_fb_swab() (an existing DRM helper that byte-swaps pixel data per-pixel) instead of drm_fb_memcpy(). This requires passing the fmtcnv_state from drm_shadow_plane_state through to the function, which is why the function signature is modified to accept a struct drm_format_conv_state * parameter. Again, wrapped in #if defined(__BIG_ENDIAN).

The underlying problem: Aspeed graphics chips (post-AST2400) expect little-endian pixel data in the framebuffer, but on a big-endian host (e.g., PowerPC), memcpy_toio copies the bytes in host order, resulting in byte-swapped (garbled) display output.

### 3. Dependency Analysis

- drm_fb_swab() was introduced in v5.8 (commit bd34cea2a0e4b, May 2020) — available in all active stable trees.
- The current API with struct drm_format_conv_state *state parameter was added in commit 903674588a48d (Oct 2023), present in **v6.10+**.
- fmtcnv_state field in struct drm_shadow_plane_state also from v6.10+.

For **v6.12.y** and **v6.19.y**: All dependencies exist. The patch would apply cleanly.
For **v6.6.y** and earlier: drm_fb_swab has a different signature (no state param), and fmtcnv_state doesn't exist. The patch would need non-trivial adaptation.

### 4. Risk Assessment

**Risk is extremely low:**
- All new code is behind #if defined(__BIG_ENDIAN), so **zero impact on little-endian** (x86, ARM-LE) — the vast majority of systems.
- On big-endian, the fix uses well-established kernel APIs (drm_fb_swab, writew, swab16).
- Reviewed by Thomas Zimmermann, the DRM AST subsystem maintainer.
- The mgag200 version of this same fix was explicitly marked `Cc:
[email protected]`.

### 5. User Impact

AST (Aspeed) graphics chips are **extremely common** in server BMC/IPMI systems (Supermicro, ASUS, Gigabyte, etc.). Big-endian platforms that use these include **PowerPC/POWER servers** (e.g., Raptor Talos II/Blackbird). For these users, the display is completely garbled — effectively making local console unusable. While the affected user base is small (big-endian + AST), for those affected, the system's local display is entirely broken.

### 6. Why the Author Didn't Mark It for Stable

The companion mgag200 fix (6cb31fba137d4) by the same author WAS marked Cc: [email protected] with a Fixes: tag. The AST fix was not, likely because:
1. The AST fix is slightly more invasive (changes function signature, adds fmtcnv_state dependency)
2. The author may have been uncertain about clean backportability
3. The mgag200 fix was pure register programming (simpler)

This doesn't diminish the fix's value — it's the same class of bug.

### 7. Classification

This is a **hardware bug workaround / driver fix** — the Aspeed hardware doesn't support big-endian framebuffers despite documentation suggesting it does (post-AST2400). The fix makes the software compensate. This falls into the "quirks and workarounds for broken hardware" category.

### Summary

| Criterion | Assessment |
|---|---|
| Fixes real bug | Yes — completely broken display on big-endian |
| Small and contained | Yes — 17 insertions, 5 deletions, 2 files |
| Regression risk | Near zero — `#if __BIG_ENDIAN` guards |
| Reviewed | Yes — by subsystem maintainer |
| Dependencies in stable | Yes — for v6.12.y and v6.19.y |
| User impact | Complete display failure for affected users |

The fix is small, surgically targeted, has zero regression risk for the vast majority of users, and resolves a complete display failure for big- endian users. It meets stable criteria for at least v6.12.y and v6.19.y.

**YES**

 drivers/gpu/drm/ast/ast_cursor.c | 11 ++++++++---
 drivers/gpu/drm/ast/ast_mode.c   | 11 +++++++++--
 2 files changed, 17 insertions(+), 5 deletions(-)
drivers/gpu/drm/ast/ast_cursor.c +8 -3
index 2d3ad7610c2e9..7da0a2d463e6c 100644
@@ -92,12 +92,17 @@ static void ast_set_cursor_image(struct ast_device *ast, const u8 *src,
 				 unsigned int width, unsigned int height)
 {
 	u8 __iomem *dst = ast_plane_vaddr(&ast->cursor_plane.base);
-	u32 csum;
-
-	csum = ast_cursor_calculate_checksum(src, width, height);
+	u32 csum = ast_cursor_calculate_checksum(src, width, height);
 
 	/* write pixel data */
+#if defined(__BIG_ENDIAN)
+	unsigned int i;
+
+	for (i = 0; i < AST_HWC_SIZE; i += 2)
+		writew(swab16(*(const __u16 *)&src[i]), &dst[i]);
+#else
 	memcpy_toio(dst, src, AST_HWC_SIZE);
+#endif
 
 	/* write checksum + signature */
 	dst += AST_HWC_SIZE;
drivers/gpu/drm/ast/ast_mode.c +9 -2
index cd08990a10f93..57c6fbc3232b0 100644
@@ -526,12 +526,18 @@ static int ast_primary_plane_helper_atomic_check(struct drm_plane *plane,
 
 static void ast_handle_damage(struct ast_plane *ast_plane, struct iosys_map *src,
 			      struct drm_framebuffer *fb,
-			      const struct drm_rect *clip)
+			      const struct drm_rect *clip,
+			      struct drm_format_conv_state *fmtcnv_state)
 {
 	struct iosys_map dst = IOSYS_MAP_INIT_VADDR_IOMEM(ast_plane_vaddr(ast_plane));
 
 	iosys_map_incr(&dst, drm_fb_clip_offset(fb->pitches[0], fb->format, clip));
+
+#if defined(__BIG_ENDIAN)
+	drm_fb_swab(&dst, fb->pitches, src, fb, clip, !src[0].is_iomem, fmtcnv_state);
+#else
 	drm_fb_memcpy(&dst, fb->pitches, src, fb, clip);
+#endif
 }
 
 static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
@@ -561,7 +567,8 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
 	if (drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE) == 0) {
 		drm_atomic_helper_damage_iter_init(&iter, old_plane_state, plane_state);
 		drm_atomic_for_each_plane_damage(&iter, &damage) {
-			ast_handle_damage(ast_plane, shadow_plane_state->data, fb, &damage);
+			ast_handle_damage(ast_plane, shadow_plane_state->data, fb, &damage,
+					  &shadow_plane_state->fmtcnv_state);
 		}
 
 		drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);
Signature · 1 line
2.51.0
author maintainer
#119 lore raw

PATCH 1/1 spi: geni-qcom: Fix abort sequence execution for serial engine errors

In reply to Sasha Levin

From: Praveen Talari <[email protected]>

[ Upstream commit 96e041647bb0f9d92f95df1d69cb7442d7408b79 ]

The driver currently skips the abort sequence for target mode when serial engine errors occur. This leads to improper error recovery as the serial engine may remain in an undefined state without proper cleanup, potentially causing subsequent operations to fail or behave unpredictably.

Fix this by ensuring the abort sequence and DMA reset always execute during error recovery, as both are required for proper serial engine error handling.

---

LLM Generated explanations, may be completely bogus:

Now I can see the **current code** (before the patch). The issue is clear:

**Before the fix (buggy code):**
- When spi->target is true, the code does goto reset_if_dma, which **skips both**:
1. The cancel command (correct - target mode doesn't support cancel)
2. The abort command (INCORRECT - abort is still needed for proper error recovery)

**After the fix:**
- When spi->target is true, only the cancel command is skipped
- The abort command (geni_se_abort_m_cmd()) and subsequent DMA reset **always execute** regardless of target/controller mode

The logic restructuring:
- The old code: if (spi->target) { goto reset_if_dma; } - skips everything (cancel AND abort)
- The new code: if (!spi->target) { do cancel; if cancel succeeded, goto reset_if_dma; } then **always** falls through to the abort sequence

This is a critical error recovery path fix. Without the abort, the serial engine can remain stuck in an error state.

### 3. CLASSIFICATION

This is clearly a **bug fix** for improper error recovery in the SPI GENI Qualcomm driver:
- Fixes a functional bug where the abort sequence is incorrectly skipped
- The serial engine can get stuck in an undefined state
- Subsequent SPI transactions can fail

### 4. SCOPE AND RISK ASSESSMENT

- **Lines changed:** Small - approximately 10-15 lines of logic restructuring within a single function
- **Files touched:** 1 file (drivers/spi/spi-geni-qcom.c)
- **Subsystem:** SPI driver, specifically Qualcomm GENI SPI
- **Risk:** LOW - The change is well-contained within handle_se_timeout(), only affects error recovery logic, and the abort command is the standard recovery mechanism for the serial engine. The cancel path for controller mode is preserved unchanged.
- **The change is purely a control flow fix** - no new functions, no new variables, no new APIs

### 5. USER IMPACT

- **Who is affected:** Users of Qualcomm platforms (Snapdragon-based devices, many ARM boards/phones) using SPI in target mode
- **Severity:** When the bug triggers, the SPI bus can become stuck, requiring a reboot or causing cascading failures for SPI peripherals
- **Real-world impact:** This affects error recovery - when things go wrong (timeouts, SE errors), the system can't recover properly. This is a significant reliability issue.

### 6. STABILITY INDICATORS

- **Reviewed-by:** Konrad Dybcio (Qualcomm maintainer)
- **Signed-off-by:** Mark Brown (SPI subsystem maintainer)
- The commit is clearly described and the logic is straightforward

### 7. DEPENDENCY CHECK

The fix is self-contained - it restructures control flow within a single function using existing APIs (geni_se_abort_m_cmd, geni_se_cancel_m_cmd). No dependencies on other commits. The affected code has been in the kernel for a while (the spi->target check and the abort/cancel framework).

### Summary

This is a clear, small, well-reviewed bug fix that corrects an error recovery path in the Qualcomm GENI SPI driver. Without this fix, when serial engine errors occur in target mode, the abort sequence is skipped, leaving the hardware in an undefined state. The fix is surgical (single function, single file), low risk, and addresses a real reliability problem on Qualcomm platforms. It meets all stable kernel criteria.

**YES**

 drivers/spi/spi-geni-qcom.c | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)
drivers/spi/spi-geni-qcom.c +10 -14
index 5ab20d7955121..acfcf870efd84 100644
@@ -160,24 +160,20 @@ static void handle_se_timeout(struct spi_controller *spi,
 	xfer = mas->cur_xfer;
 	mas->cur_xfer = NULL;
 
-	if (spi->target) {
-		/*
-		 * skip CMD Cancel sequnece since spi target
-		 * doesn`t support CMD Cancel sequnece
-		 */
+	/* The controller doesn't support the Cancel commnand in target mode */
+	if (!spi->target) {
+		reinit_completion(&mas->cancel_done);
+		geni_se_cancel_m_cmd(se);
+
 		spin_unlock_irq(&mas->lock);
-		goto reset_if_dma;
-	}
 
-	reinit_completion(&mas->cancel_done);
-	geni_se_cancel_m_cmd(se);
-	spin_unlock_irq(&mas->lock);
+		time_left = wait_for_completion_timeout(&mas->cancel_done, HZ);
+		if (time_left)
+			goto reset_if_dma;
 
-	time_left = wait_for_completion_timeout(&mas->cancel_done, HZ);
-	if (time_left)
-		goto reset_if_dma;
+		spin_lock_irq(&mas->lock);
+	}
 
-	spin_lock_irq(&mas->lock);
 	reinit_completion(&mas->abort_done);
 	geni_se_abort_m_cmd(se);
 	spin_unlock_irq(&mas->lock);
Signature · 1 line
2.51.0
author maintainer
#120 lore raw

PATCH 1/1 spi: spi-mem: Protect dirmap_create() with spi_mem_access_start/end

In reply to Sasha Levin

From: Chin-Ting Kuo <[email protected]>

[ Upstream commit 53f826ff5e0e3ecb279862ca7cce1491b94bb017 ]

spi_mem_dirmap_create() may reconfigure controller-wide settings, which can interfere with concurrent transfers to other devices sharing the same SPI controller but using different chip selects.

Wrap the ->dirmap_create() callback with spi_mem_access_start() and spi_mem_access_end() to serialize access and prevent cross-CS interference during dirmap creation.

This patch has been verified on a setup where a SPI TPM is connected to CS0 of a SPI controller, while a SPI NOR flash is connected to CS1 of the same controller. Without this patch, spi_mem_dirmap_create() for the SPI NOR flash interferes with ongoing SPI TPM data transfers, resulting in failure to create the TPM device. This was tested on an ASPEED AST2700 EVB.

---

LLM Generated explanations, may be completely bogus:

### 3. Pattern Consistency

The pattern is **completely consistent** with existing code. Looking at the existing usages:
- exec_op (line 405-413): wrapped with start/end
- dirmap_read (line 849-855): wrapped with start/end
- dirmap_write (line 895-901): wrapped with start/end
- poll_status (line 967-975): wrapped with start/end
- **dirmap_create**: was **NOT** wrapped — this is the bug being fixed

The dirmap_create callback was the only mem_ops callback **missing** this serialization. This is clearly an oversight/bug.

### 4. What the Serialization Does

spi_mem_access_start():
1. Flushes the SPI message queue to prevent preemption of regular transfers
2. Handles runtime PM
3. Acquires bus_lock_mutex and io_mutex

This is the standard mechanism for serializing SPI memory operations against each other and against regular SPI transfers. Without it, dirmap_create can race with:
- Normal SPI transfers to other devices (like the TPM in the test case)
- Other spi-mem operations

### 5. Bug Severity and Impact

- **Concrete failure**: TPM device creation fails, meaning the TPM is completely unusable
- **Real hardware**: Tested on ASPEED AST2700 EVB, but this affects any multi-CS SPI controller setup
- **TPM implications**: TPM is security-critical hardware (used for secure boot, disk encryption, attestation)
- **Multi-CS SPI is common**: Many embedded systems have multiple SPI devices on one controller

### 6. Risk Assessment

**Very low risk:**
- The change adds exactly the same serialization pattern used by all other spi-mem callbacks
- It's a small, surgical change (~12 lines of actual change)
- The error handling is correct (kfree on failure, proper return)
- Reviewed by Paul Menzel, merged by Mark Brown (SPI maintainer)
- Existing code in the file already demonstrates this exact pattern 4 times

**No dependency concerns:**
- spi_mem_access_start() and spi_mem_access_end() have existed since the spi-mem subsystem was created
- No new functions or APIs introduced
- Will apply cleanly to any stable tree that has spi-mem support

### 7. Classification

This is a **race condition fix** — specifically, missing serialization for a controller-wide operation. The dirmap_create callback can modify controller-wide settings (like register configurations for direct mapping) without holding the bus lock, allowing concurrent transfers on other chip selects to see inconsistent state or interfere.

### 8. Stable Criteria Checklist

- **Obviously correct**: Yes — follows the exact pattern of every other callback in the same file
- **Fixes a real bug**: Yes — verified failure on real hardware (TPM device creation failure)
- **Important issue**: Yes — prevents device creation failure, affects security-critical hardware (TPM)
- **Small and contained**: Yes — single file, ~12 lines of change
- **No new features**: Correct — only adds missing serialization
- **No new APIs**: Correct

### Conclusion

This is a textbook stable backport candidate. It fixes a real race condition that causes device creation failure on multi-CS SPI controllers. The fix is small, follows existing patterns exactly, is well-tested on real hardware, and has been reviewed by maintainers. The risk of regression is minimal since it's simply adding the same locking used by all other spi-mem operations.

**YES**

 drivers/spi/spi-mem.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/spi/spi-mem.c +10 -1
index 6c7921469b90b..965673bac98b9 100644
@@ -719,9 +719,18 @@ spi_mem_dirmap_create(struct spi_mem *mem,
 
 	desc->mem = mem;
 	desc->info = *info;
-	if (ctlr->mem_ops && ctlr->mem_ops->dirmap_create)
+	if (ctlr->mem_ops && ctlr->mem_ops->dirmap_create) {
+		ret = spi_mem_access_start(mem);
+		if (ret) {
+			kfree(desc);
+			return ERR_PTR(ret);
+		}
+
 		ret = ctlr->mem_ops->dirmap_create(desc);
 
+		spi_mem_access_end(mem);
+	}
+
 	if (ret) {
 		desc->nodirmap = true;
 		if (!spi_mem_supports_op(desc->mem, &desc->info.op_tmpl))
Signature · 1 line
2.51.0
author maintainer
#121 lore raw

PATCH 1/1 ASoC: wm8962: Don't report a microphone if it's shorted to ground on plug

In reply to Sasha Levin

From: Sebastian Krzyszkowiak <[email protected]>

[ Upstream commit e590752119029d87ce46d725e11245a52d22e1fe ]

This usually means that a TRS plug with no microphone pin has been plugged into a TRRS socket. Cases where a user is plugging in a microphone while pressing a button will be handled via incoming interrupt after the user releases the button, so the microphone will still be detected once it becomes usable.

---

LLM Generated explanations, may be completely bogus:

## Analysis of ASoC: wm8962: Don't report a microphone if it's shorted to ground on plug

### 1. Commit Message Analysis

The commit addresses a hardware detection issue with the WM8962 audio codec. When a TRS (3-pin) plug is inserted into a TRRS (4-pin) socket, the microphone pin gets shorted to ground. The codec's mic detection circuitry sees both MICDET_STS (microphone detected) and MICSHORT_STS (microphone shorted) simultaneously, leading to an incorrect report that a microphone is present along with a button press.

The fix: if a short is detected immediately at plug-in time (before any microphone was previously detected), don't report a microphone. If the user later releases the button (if it really was a microphone + button press), an interrupt will fire and correct the state.

### 2. Code Change Analysis

The change is small and well-contained:

1. **New field mic_status** added to struct wm8962_priv — tracks the previous microphone detection status.

2. **Logic change in wm8962_mic_work()**:
- When MICSHORT_STS is set (short detected), it checks if mic_status previously had MICDET_STS set.
- If no microphone was previously detected (!(wm8962->mic_status & WM8962_MICDET_STS)), it sets status = 0 — suppressing the false microphone + button report.
- After the check, wm8962->mic_status is updated with the current status.

This is a **hardware quirk/workaround** — it handles a real-world scenario where TRS plugs in TRRS sockets cause false microphone detection.

### 3. Classification

This is a **bug fix for incorrect hardware detection behavior**. It falls into the category of hardware quirks/workarounds, which are explicitly allowed in stable trees. The fix prevents:
- False microphone detection when using headphones without a mic
- False button press events on plug insertion
- User-visible incorrect audio routing (system thinks a mic is present when it isn't)

### 4. Scope and Risk Assessment

- **Lines changed**: ~12 lines of logic + 1 new struct field = very small
- **Files touched**: 1 file (sound/soc/codecs/wm8962.c)
- **Complexity**: Low — straightforward state tracking
- **Risk**: Very low. The change only affects the mic detection path. The mic_status field is zero-initialized (struct is kzalloc'd), so on first plug-in, if both MICDET and MICSHORT are set simultaneously, it correctly suppresses the false report. The subsequent interrupt when the short clears will correctly detect the microphone if one is actually present.

### 5. User Impact

- **Who is affected**: Users with WM8962 codec hardware (common in embedded/mobile devices, including Purism Librem 5 based on the author's email domain)
- **Severity**: Medium — incorrect jack detection leads to wrong audio routing, which is a real user-facing issue
- **Reproducibility**: Easily reproducible by plugging TRS headphones into a TRRS jack

### 6. Stability Indicators

- **Reviewed-by**: Charles Keepax (Cirrus Logic engineer, the codec manufacturer's developer) — strong domain expertise review
- **Applied by**: Mark Brown (ASoC maintainer) — subsystem maintainer accepted it
- The fix is logically sound and handles edge cases (subsequent interrupt for real mic+button)

### 7. Dependency Check

The change is self-contained. It only adds a new field to the private data structure and modifies the mic detection work function. No dependencies on other commits. The WM8962 driver has existed in stable trees for many years.

### 8. Risk vs Benefit

- **Benefit**: Fixes incorrect microphone/button detection for TRS plugs in TRRS sockets — a common real-world scenario
- **Risk**: Minimal — small, localized change with expert review. The worst case if the logic were somehow wrong would be a missed initial microphone detection, which would self-correct on the next interrupt.

### Conclusion

This is a small, well-reviewed hardware quirk fix for incorrect jack detection behavior in the WM8962 audio codec. It fixes a real user- facing issue (false microphone detection with TRS headphones), is self- contained, has been reviewed by the codec manufacturer's engineer, and carries minimal regression risk. It meets all stable kernel criteria.

**YES**

 sound/soc/codecs/wm8962.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
sound/soc/codecs/wm8962.c +10 -0
index 1040740fc80f8..bff8644674163 100644
@@ -67,6 +67,8 @@ struct wm8962_priv {
 	struct mutex dsp2_ena_lock;
 	u16 dsp2_ena;
 
+	int mic_status;
+
 	struct delayed_work mic_work;
 	struct snd_soc_jack *jack;
 
@@ -3081,8 +3083,16 @@ static void wm8962_mic_work(struct work_struct *work)
 	if (reg & WM8962_MICSHORT_STS) {
 		status |= SND_JACK_BTN_0;
 		irq_pol |= WM8962_MICSCD_IRQ_POL;
+
+		/* Don't report a microphone if it's shorted right after
+		 * plugging in, as this may be a TRS plug in a TRRS socket.
+		 */
+		if (!(wm8962->mic_status & WM8962_MICDET_STS))
+			status = 0;
 	}
 
+	wm8962->mic_status = status;
+
 	snd_soc_jack_report(wm8962->jack, status,
 			    SND_JACK_MICROPHONE | SND_JACK_BTN_0);
 
Signature · 1 line
2.51.0
author maintainer
#122 lore raw

PATCH 1/1 ASoC: sunxi: sun50i-dmic: Add missing check for devm_regmap_init_mmio

In reply to Sasha Levin

From: Chen Ni <[email protected]>

[ Upstream commit 74823db9ba2e13f3ec007b354759b3d8125e462c ]

Add check for the return value of devm_regmap_init_mmio() and return the error if it fails in order to catch the error.

---

LLM Generated explanations, may be completely bogus:

## Analysis

### Commit Message Analysis

The commit adds a missing error check for devm_regmap_init_mmio() in the sun50i-dmic audio driver's probe function. The message is straightforward - it's adding a return value check that was missing.

### Code Change Analysis

The change is a 3-line addition:

```c
if (IS_ERR(host->regmap))
    return dev_err_probe(&pdev->dev, PTR_ERR(host->regmap),
                         "failed to initialise regmap\n");
```

This is inserted right after devm_regmap_init_mmio() returns into host->regmap. Without this check, if devm_regmap_init_mmio() fails, host->regmap will contain an ERR_PTR value. The driver then continues execution and eventually uses this regmap pointer in subsequent operations (regmap reads/writes), which would cause a NULL pointer dereference or other crash since the ERR_PTR would be interpreted as a valid pointer.

### Bug Mechanism

If devm_regmap_init_mmio() fails (e.g., memory allocation failure inside regmap), the error pointer gets stored in host->regmap. Later, when the driver tries to use regmap APIs with this invalid pointer, it will crash. This is a real bug - a missing error check that leads to use of an error pointer as a valid pointer.

### Severity Assessment

- **Trigger**: devm_regmap_init_mmio() would need to fail, which is uncommon but possible (memory pressure, internal regmap errors)
- **Consequence**: Kernel crash/oops when the invalid regmap pointer is subsequently used
- **Likelihood**: Low probability but non-zero, especially under memory pressure

### Stable Kernel Criteria

1. **Obviously correct and tested**: Yes - this follows the exact same pattern as all surrounding error checks in the same function. It's a textbook missing error check fix.
2. **Fixes a real bug**: Yes - missing error check on a function that can fail, leading to use of an ERR_PTR as a valid pointer.
3. **Important issue**: Moderate - it's a potential NULL deref/crash, though the trigger condition is uncommon.
4. **Small and contained**: Yes - 3 lines added, single file, no behavioral change on success path.
5. **No new features**: Correct - purely defensive error checking.
6. **Applies cleanly**: The change is self-contained with no dependencies.

### Risk Assessment

- **Risk**: Extremely low. The change only affects the error path. On the success path, behavior is identical.
- **Benefit**: Prevents a kernel crash if regmap initialization fails.
- **Pattern**: This is a very common type of stable fix - adding missing error checks in driver probe functions.

### Concerns

This is a fairly minor fix for an uncommon failure path in a specific ARM SoC audio driver. The user base is limited to Allwinner sun50i platforms. However, the fix is trivially correct, has zero risk of regression, and prevents a real (if unlikely) crash.

### Decision

The fix is small, obviously correct, follows existing patterns in the same function, prevents a potential crash from using an ERR_PTR, and has essentially zero regression risk. It meets all stable kernel criteria.

**YES**

 sound/soc/sunxi/sun50i-dmic.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/sunxi/sun50i-dmic.c +3 -0
index bab1e29c99887..eddfebe166169 100644
@@ -358,6 +358,9 @@ static int sun50i_dmic_probe(struct platform_device *pdev)
 
 	host->regmap = devm_regmap_init_mmio(&pdev->dev, base,
 					     &sun50i_dmic_regmap_config);
+	if (IS_ERR(host->regmap))
+		return dev_err_probe(&pdev->dev, PTR_ERR(host->regmap),
+				     "failed to initialise regmap\n");
 
 	/* Clocks */
 	host->bus_clk = devm_clk_get(&pdev->dev, "bus");
Signature · 1 line
2.51.0
author maintainer
#123 lore raw

PATCH 1/1 hwmon: (dell-smm) Add support for Dell OptiPlex 7080

In reply to Sasha Levin

From: Armin Wolf <[email protected]>

[ Upstream commit 46c3e87a79179454f741f797c274dd25f5c6125e ]

The Dell OptiPlex 7080 supports the legacy SMM interface for reading sensors and performing fan control. Whitelist this machine so that this driver loads automatically.

---

LLM Generated explanations, may be completely bogus:

## Analysis

### Commit Message Analysis

This commit adds a DMI whitelist entry for the Dell OptiPlex 7080 to the dell-smm-hwmon driver. The commit message explains that this machine supports the legacy SMM interface for reading sensors and performing fan control, and the whitelist entry enables the driver to load automatically on this hardware.

There's a linked issue (https://github.com/Wer- Wolf/i8kutils/issues/16) showing a real user request for this support.

### Code Change Analysis

The change is a simple addition of a single DMI matching entry to the i8k_dmi_table[] array:

```c
{
    .ident = "Dell OptiPlex 7080",
    .matches = {
        DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
        DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "OptiPlex 7080"),
    },
},
```

This is structurally identical to the existing entries for OptiPlex 7060, 7050, and 7040. The pattern uses DMI_EXACT_MATCH for the product name (matching the convention of other OptiPlex entries), preventing false matches with similarly named models.

### Classification

This falls squarely into the **device ID / hardware quirk / whitelist** exception category. It's adding a machine identifier to an existing driver's whitelist table so the driver auto-loads on that hardware. Without this entry, the Dell OptiPlex 7080 doesn't get hardware monitoring and fan control support from this driver (unless force- loaded).

### Scope and Risk Assessment

- **Lines changed**: +7 lines (a single DMI table entry)
- **Files touched**: 1 (drivers/hwmon/dell-smm-hwmon.c)
- **Risk**: Extremely low. The entry only affects Dell OptiPlex 7080 machines. It cannot affect any other hardware. The matching pattern is well-established and identical in structure to dozens of other entries in the same table.
- **Complexity**: Trivial

### User Impact

Users with Dell OptiPlex 7080 machines running stable kernels would benefit from having hardware monitoring and fan control work automatically. This is a desktop PC used in corporate environments—exactly the kind of hardware that runs stable/LTS kernels.

### Stability Indicators

- **Acked-by**: Pali Rohár (co-maintainer of this driver)
- **Signed-off-by**: Guenter Roeck (hwmon maintainer)
- The existing driver framework is mature and well-tested
- The same pattern is used for many other Dell models already in the table

### Dependency Check

No dependencies. The driver and DMI matching infrastructure exist in all relevant stable trees. This is a self-contained addition to a data table.

### Conclusion

This is a textbook example of a hardware whitelist addition that is appropriate for stable backporting. It enables existing, well-tested driver functionality on a specific hardware platform. The change is trivial, zero-risk to other systems, reviewed by the subsystem maintainers, and benefits real users running stable kernels on Dell OptiPlex 7080 desktops.

**YES**

 drivers/hwmon/dell-smm-hwmon.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/hwmon/dell-smm-hwmon.c +7 -0
index 93143cfc157cf..038edffc1ac74 100644
@@ -1325,6 +1325,13 @@ static const struct dmi_system_id i8k_dmi_table[] __initconst = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "MP061"),
 		},
 	},
+	{
+		.ident = "Dell OptiPlex 7080",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "OptiPlex 7080"),
+		},
+	},
 	{
 		.ident = "Dell OptiPlex 7060",
 		.matches = {
Signature · 1 line
2.51.0
author maintainer
#124 lore raw

PATCH 1/1 drm/amd/display: Don't disable DPCD mst_en if sink connected

In reply to Sasha Levin

From: Peichen Huang <[email protected]>

[ Upstream commit 9aeb31b2456452257ad1ff7ec566f21bab1f3e8a ]

[WHY]
User may connect mst dock with multi monitors and do quick unplug and plug in one of the monitor. This operatioin may create CSN from dock to display driver. Then display driver would disable and then enable mst link and also disable/enable DPCD mst_en bit in dock RX. However, when mst_en bit being disabled, if dock has another CSN message to transmit then the message would be removed because of the disabling of mst_en. In this case, the message is missing and it ends up no display in the replugged monitor.

[HOW]
Don't disable mst_en bit when link still has sink connected.

---

LLM Generated explanations, may be completely bogus:

Now let me analyze the patch fully.

## Comprehensive Analysis

### 1. COMMIT MESSAGE ANALYSIS

The commit message clearly explains a real-world user-facing bug:

**Problem:** When a user has an MST dock (e.g., a USB-C/Thunderbolt dock with multiple DisplayPort outputs) with multiple monitors, and quickly unplugs and re-plugs one monitor, the dock generates a Connection Status Notification (CSN) to the display driver. The driver handles this by disabling and re-enabling the MST link, which includes toggling the DPCD mst_en bit. However, when mst_en is disabled, if the dock has another CSN message to transmit (for the still-connected monitors), that message is discarded. The result is that the re-plugged monitor shows no display.

**Fix:** Don't disable the mst_en bit when there are still sinks connected to the link.

The commit has:
- Reviewed-by: Wenjing Liu (AMD display team member)
- Tested-by: Daniel Wheeler (AMD QA)
- Signed-off-by: Alex Deucher (AMD display subsystem maintainer)

### 2. CODE CHANGE ANALYSIS

The patch has 4 hunks, all in a single file (link_dpms.c), with 11 lines added and 5 removed:

**Hunk 1 (Critical fix - disable_link_dp):**

```c
// Before:
if (signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
    enable_mst_on_sink(link, false);

// After:
if (signal == SIGNAL_TYPE_DISPLAY_PORT_MST && link->sink_count == 0)
    enable_mst_on_sink(link, false);
```

This is the core fix. It adds a single condition link->sink_count == 0 to ensure mst_en is only disabled when all sinks have been disconnected. This prevents the race where a CSN from the dock is lost because mst_en was momentarily disabled while other monitors are still connected.

**Hunk 2 (Complementary fix - enable_link_dp):**

```c
// Before:
if (DP_128b_132b_ENCODING && SST && set_mst_en_for_sst) {
    enable_mst_on_sink(link, true);
}

// After:
if (DP_128b_132b_ENCODING && SST && set_mst_en_for_sst) {
    enable_mst_on_sink(link, true);
} else if (link->dpcd_caps.is_mst_capable && SST) {
    enable_mst_on_sink(link, false);
}
```

This is the complementary change. When re-enabling a link in SST mode on an MST-capable sink, the patch explicitly disables MST mode on the sink. This ensures that if disable_link_dp skipped the mst_en disable (because sink_count > 0), it is properly cleaned up when re-enabling the link in SST mode.

**Hunks 3 & 4 (Debug logging):**
These add sink_count to the debug log messages in link_set_dpms_off and link_set_dpms_on — purely for debugging/observability, zero risk.

### 3. CLASSIFICATION

This is a **bug fix** for a real-world user-visible issue: monitors connected through MST docks failing to display after hot-plug events. This is a common scenario — USB-C docks with multiple monitor outputs are extremely popular.

### 4. SCOPE AND RISK ASSESSMENT

- **Size:** Very small — 11 lines added, 5 removed, 1 file changed
- **Scope:** Localized to MST link enable/disable paths in the AMD display driver
- **Risk:** LOW
- Hunk 1 adds a defensive guard condition that preserves existing behavior when sink_count == 0 (the last sink disconnects) — it's strictly narrowing when mst_en is cleared
- Hunk 2 adds an explicit mst_en disable for SST-on-MST-capable- sink, which is a correct complement to hunk 1
- Debug logging changes have zero risk
- **Subsystem:** AMD display driver — mature, well-tested subsystem
- **Could it break something?** The guard link->sink_count == 0 is correct — if there are still sinks, we should not disable MST mode on the dock. The enable_link_dp complementary change is also sound:
when connecting in SST mode to an MST-capable sink, explicitly disabling MST mode is the correct DPCD protocol behavior.

### 5. USER IMPACT

This affects **anyone using MST docks (USB-C/Thunderbolt docks with multi-monitor support) with AMD GPUs**, which is a very common configuration, especially in:
- Laptops with AMD integrated graphics (Ryzen mobile) connected to docks
- Desktop systems with AMD discrete GPUs using DP MST hubs

The bug manifests as **no display on a re-plugged monitor** after a quick unplug/plug cycle, which is a common user action. The severity is HIGH — a non-functional monitor requires manual intervention (re-plug, driver restart, or reboot) to recover.

### 6. STABILITY INDICATORS

- Reviewed-by from Wenjing Liu (AMD DC team)
- Tested-by from Daniel Wheeler (AMD QA)
- Signed off by Alex Deucher (AMD GPU maintainer who reviews all AMDGPU commits)
- No reverts or follow-up fixes found

### 7. DEPENDENCY CHECK

- link->sink_count exists in all relevant stable trees (v6.1, v6.6, v6.12)
- link->dpcd_caps.is_mst_capable exists in all relevant stable trees
- enable_mst_on_sink() function exists identically in all relevant stable trees
- The disable_link_dp() function's MST handling code is identical across v6.6, v6.12, and mainline
- The enable_link_dp() function's MST workaround block is also present in all stable trees
- **No dependencies on other commits** — this patch is completely self- contained
- The patch should apply cleanly to v6.6 and v6.12 (minor context differences in a distant function signature for dp_set_fec_enable in v6.6 may require a trivial context adjustment, but the key hunks are identical)

### 8. RISK VS BENEFIT

- **Benefit:** Fixes a real, user-hitting bug where monitors go blank through MST docks — a very common hardware configuration
- **Risk:** Minimal — the change is small, surgical, well-understood, and was tested by AMD QA
- The logic is clearly correct: don't clear MST mode when there are still active sinks, and ensure MST mode is cleared when re-enabling in SST mode

The fix is small, surgical, addresses a real user-visible bug with MST docks (a very common configuration), has been reviewed and tested by AMD engineers, has no dependencies, and the affected code exists in all current stable trees.

**YES**

 drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +11 -5
index a6f1b3569f6f5..0b85826c7ea70 100644
@@ -1931,7 +1931,7 @@ static void disable_link_dp(struct dc_link *link,
 			link->dc->hwss.edp_power_control(link, false);
 	}
 
-	if (signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
+	if (signal == SIGNAL_TYPE_DISPLAY_PORT_MST && link->sink_count == 0)
 		/* set the sink to SST mode after disabling the link */
 		enable_mst_on_sink(link, false);
 
@@ -2082,7 +2082,12 @@ static enum dc_status enable_link_dp(struct dc_state *state,
 			pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT &&
 			link->dc->debug.set_mst_en_for_sst) {
 		enable_mst_on_sink(link, true);
+	} else if (link->dpcd_caps.is_mst_capable &&
+		pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT) {
+		/* disable mst on sink */
+		enable_mst_on_sink(link, false);
 	}
+
 	if (pipe_ctx->stream->signal == SIGNAL_TYPE_EDP) {
 		/*in case it is not on*/
 		if (!link->dc->config.edp_no_power_sequencing)
@@ -2368,9 +2373,9 @@ void link_set_dpms_off(struct pipe_ctx *pipe_ctx)
 	if (pipe_ctx->stream->sink) {
 		if (pipe_ctx->stream->sink->sink_signal != SIGNAL_TYPE_VIRTUAL &&
 			pipe_ctx->stream->sink->sink_signal != SIGNAL_TYPE_NONE) {
-			DC_LOG_DC("%s pipe_ctx dispname=%s signal=%x link=%d\n", __func__,
+			DC_LOG_DC("%s pipe_ctx dispname=%s signal=%x link=%d sink_count=%d\n", __func__,
 			pipe_ctx->stream->sink->edid_caps.display_name,
-			pipe_ctx->stream->signal, link->link_index);
+			pipe_ctx->stream->signal, link->link_index, link->sink_count);
 		}
 	}
 
@@ -2484,10 +2489,11 @@ void link_set_dpms_on(
 	if (pipe_ctx->stream->sink) {
 		if (pipe_ctx->stream->sink->sink_signal != SIGNAL_TYPE_VIRTUAL &&
 			pipe_ctx->stream->sink->sink_signal != SIGNAL_TYPE_NONE) {
-			DC_LOG_DC("%s pipe_ctx dispname=%s signal=%x link=%d\n", __func__,
+			DC_LOG_DC("%s pipe_ctx dispname=%s signal=%x link=%d sink_count=%d\n", __func__,
 			pipe_ctx->stream->sink->edid_caps.display_name,
 			pipe_ctx->stream->signal,
-			link->link_index);
+			link->link_index,
+			link->sink_count);
 		}
 	}
 
Signature · 1 line
2.51.0
author maintainer
#125 lore raw

PATCH 1/1 media: omap3isp: isppreview: always clamp in preview_try_format()

In reply to Sasha Levin

From: Hans Verkuil <[email protected]>

[ Upstream commit 17e1e1641f74a89824d4de3aa38c78daa5686cc1 ]

If prev->input != PREVIEW_INPUT_MEMORY the width and height weren't clamped. Just always clamp.

This fixes a v4l2-compliance error:

	fail: v4l2-test-subdevs.cpp(171): fse.max_width == ~0U || fse.max_height == ~0U
	fail: v4l2-test-subdevs.cpp(270): ret && ret != ENOTTY

test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: FAIL

---

LLM Generated explanations, may be completely bogus:

Now I have all the information needed for a thorough analysis.

---

## Detailed Analysis

### 1. Commit Message Analysis

The commit message is clear and direct: when prev->input != PREVIEW_INPUT_MEMORY, the preview_try_format() function was **not clamping** width and height values at all. The fix simply makes the clamping unconditional. The commit explicitly references a v4l2-compliance test failure.

### 2. Code Change Analysis

The change is in preview_try_format(), specifically the PREV_PAD_SINK case:

**Before (buggy):**

```c
if (prev->input == PREVIEW_INPUT_MEMORY) {
    fmt->width = clamp_t(u32, fmt->width, PREV_MIN_IN_WIDTH,
                         preview_max_out_width(prev));
    fmt->height = clamp_t(u32, fmt->height,
                          PREV_MIN_IN_HEIGHT,
                          PREV_MAX_IN_HEIGHT);
}
```

**After (fixed):**

```c
fmt->width = clamp_t(u32, fmt->width, PREV_MIN_IN_WIDTH,
                     preview_max_out_width(prev));
fmt->height = clamp_t(u32, fmt->height,
                      PREV_MIN_IN_HEIGHT,
                      PREV_MAX_IN_HEIGHT);
```

The conditional if (prev->input == PREVIEW_INPUT_MEMORY) is removed, making the clamp apply regardless of input source.

### 3. Bug Mechanism — How the Problem Manifests

The critical caller is preview_enum_frame_size() (line 1892). This function implements VIDIOC_SUBDEV_ENUM_FRAME_SIZE, which userspace applications call to discover supported frame sizes. The function works by:

1. Setting format.width = -1; format.height = -1; (i.e., 0xFFFFFFFF as u32)
2. Calling preview_try_format() to clamp to the maximum
3. Reading back fse->max_width = format.width; fse->max_height = format.height;

When prev->input != PREVIEW_INPUT_MEMORY (i.e., input is from CCDC), the clamp is skipped, so:
- fse->max_width remains ~0U (4294967295)
- fse->max_height remains ~0U (4294967295)

This causes the v4l2-compliance test failure (fse.max_width == ~0U || fse.max_height == ~0U), and more importantly, returns **incorrect, nonsensical values** to any userspace application querying supported frame sizes.

### 4. Beyond Compliance — Real Bug Impact

This isn't just a compliance issue. The unclamped values have real downstream consequences:

**a) Incorrect crop calculations:** In preview_set_format() (line 2042), after calling preview_try_format(), the unclamped format dimensions are used to initialize the crop rectangle:

```c
crop->width = fmt->format.width;   // could be ~0U
crop->height = fmt->format.height; // could be ~0U
```

This then feeds into preview_try_crop(), where sink->width - PREV_MARGIN_RIGHT with sink->width = ~0U would cause an integer wraparound calculation for the right boundary.

**b) Userspace confusion:** Any V4L2 media application that uses frame size enumeration to determine valid dimensions would receive nonsensical maximum values, potentially leading to incorrect format negotiation.

### 5. Scope and Risk Assessment

- **Lines changed:** Net -5 lines (removing the if guard and comment lines, keeping the clamp calls)
- **Files touched:** 1 file (isppreview.c)
- **Risk:** Extremely low. The change makes an existing clamp operation unconditional. Values that were already in-range will remain unchanged after clamping. For the CCDC input path, the original comment said the CCDC already constrains the size — so clamping here is merely defensive, adding an extra safety net. It cannot break the CCDC path.
- **Dependencies:** None — fully self-contained change.

### 6. Stable Tree Applicability

- **Code exists in stable trees:** Confirmed. The identical buggy code is present in v5.15 (old path drivers/media/platform/omap3isp/), v6.1, and v6.6 (new path drivers/media/platform/ti/omap3isp/).
- **Clean backport:** The patch applies cleanly to all stable trees with at most a trivial path adjustment for v5.15.
- **Testing:** Acked by Sakari Ailus (omap3isp maintainer). The fix was tested with v4l2-compliance.

### 7. Classification

This is a **bug fix** that:
- Fixes incorrect V4L2 API behavior (returning ~0U for max frame dimensions)
- Fixes a v4l2-compliance test failure
- Prevents potential integer wraparound in downstream crop calculations
- Is small, obvious, self-contained, and low-risk
- Has no dependencies on other commits

### 8. Verdict

The fix meets all stable kernel criteria:
1. **Obviously correct:** Removing a conditional around a clamp operation is trivially safe.
2. **Fixes a real bug:** Incorrect max frame size values returned to userspace, compliance failure.
3. **Small and contained:** -5 net lines, 1 file, 1 function.
4. **No new features:** Purely a bug fix.
5. **Low regression risk:** Clamping in-range values is a no-op; only out-of-range values (the bug) are affected.

The fix is small, surgical, obviously correct, and fixes a real API correctness bug that affects any userspace application querying frame sizes on the OMAP3 ISP preview engine when connected to the CCDC. It applies cleanly to all active stable trees.

**YES**

 .../media/platform/ti/omap3isp/isppreview.c   | 21 +++++++------------
 1 file changed, 8 insertions(+), 13 deletions(-)
drivers/media/platform/ti/omap3isp/isppreview.c +8 -13
index e383a57654de8..5c492b31b5160 100644
@@ -1742,22 +1742,17 @@ static void preview_try_format(struct isp_prev_device *prev,
 
 	switch (pad) {
 	case PREV_PAD_SINK:
-		/* When reading data from the CCDC, the input size has already
-		 * been mangled by the CCDC output pad so it can be accepted
-		 * as-is.
-		 *
-		 * When reading data from memory, clamp the requested width and
-		 * height. The TRM doesn't specify a minimum input height, make
+		/*
+		 * Clamp the requested width and height.
+		 * The TRM doesn't specify a minimum input height, make
 		 * sure we got enough lines to enable the noise filter and color
 		 * filter array interpolation.
 		 */
-		if (prev->input == PREVIEW_INPUT_MEMORY) {
-			fmt->width = clamp_t(u32, fmt->width, PREV_MIN_IN_WIDTH,
-					     preview_max_out_width(prev));
-			fmt->height = clamp_t(u32, fmt->height,
-					      PREV_MIN_IN_HEIGHT,
-					      PREV_MAX_IN_HEIGHT);
-		}
+		fmt->width = clamp_t(u32, fmt->width, PREV_MIN_IN_WIDTH,
+				     preview_max_out_width(prev));
+		fmt->height = clamp_t(u32, fmt->height,
+				      PREV_MIN_IN_HEIGHT,
+				      PREV_MAX_IN_HEIGHT);
 
 		fmt->colorspace = V4L2_COLORSPACE_SRGB;
 
Signature · 1 line
2.51.0
author maintainer
#126 lore raw

PATCH 1/1 ALSA: hda/realtek - Enable Mute LED for Lenovo platform

In reply to Sasha Levin

From: Kailang Yang <[email protected]>

[ Upstream commit 5de5db35350d9c4def1de2ae273e224a4eee5ed1 ]

Enable SPK Mute Led and Mic Mute Led for Lenovo platform.

---

LLM Generated explanations, may be completely bogus:

Now I have a comprehensive picture. Let me summarize my analysis.

## Detailed Analysis

### 1. COMMIT MESSAGE ANALYSIS

The commit subject is "ALSA: hda/realtek - Enable Mute LED for Lenovo platform" and the body says "Enable SPK Mute Led and Mic Mute Led for Lenovo platform." It's authored by Kailang Yang ([email protected]), who is the Realtek codec maintainer and the primary author of virtually all Realtek HDA quirk additions. The commit was signed off by Takashi Iwai, the ALSA subsystem maintainer.

The commit does **not** have Cc: [email protected] (which is why it's being reviewed here). Notably, a very similar prior commit by the same author (f603b159231b0, "add supported Mic Mute LED for Lenovo platform") **did** have Cc: stable -- suggesting the author considers this type of change appropriate for stable but simply forgot the tag this time.

### 2. CODE CHANGE ANALYSIS

The commit adds three things:

**a) New function alc233_fixup_lenovo_coef_micmute_led()** (lines 1619-1632 in the diff):
- Sets up mic mute LED control via codec coefficient register 0x10, bit 13
- Identical pattern to existing functions like alc285_fixup_hp_coef_micmute_led() and alc236_fixup_hp_coef_micmute_led()
- Uses the established coef_micmute_led_set callback which has been in the driver for years

**b) New function alc233_fixup_lenovo_gpio2_mic_hotkey()** (lines 1903-1919 in the diff):
- Combines the mic mute LED function with GPIO2-based mic mute hotkey detection
- Nearly identical structure to the existing alc280_fixup_hp_gpio2_mic_hotkey() function
- All called functions (alc_update_coef_idx, alc_register_micmute_input_device, snd_hda_codec_write_cache, snd_hda_jack_detect_enable_callback, gpio2_mic_hotkey_event, input_unregister_device) are long-established in the driver

**c) Five SND_PCI_QUIRK entries** for specific Lenovo ThinkCentre models:
- 0x17aa:0x3341 - Lenovo ThinkCentre M90 Gen4
- 0x17aa:0x3342 - Lenovo ThinkCentre M90 Gen4
- 0x17aa:0x3343 - Lenovo ThinkCentre M70 Gen4
- 0x17aa:0x3344 - Lenovo ThinkCentre M70 Gen4
- 0x17aa:0x334f - Lenovo ThinkCentre M90a Gen5

### 3. CLASSIFICATION

This is a **hardware quirk** addition. It falls squarely into the "QUIRKS and WORKAROUNDS" exception category for stable kernels. Without this quirk, the mute LEDs on these specific Lenovo ThinkCentre models do not work, meaning users have no visual feedback for mute/mic-mute status. While not a crash or data corruption, it is a real hardware usability issue for owners of these machines.

The commit is **not** adding a new feature in the software sense -- it's enabling existing LED infrastructure for specific hardware. The LED subsystem, the coef-based LED control, and the GPIO-based mic hotkey handling all already exist. This commit just provides the device- specific parameters.

### 4. SCOPE AND RISK ASSESSMENT

- **Lines changed**: ~80 lines added across one file
- **Files touched**: 1 (sound/hda/codecs/realtek/alc269.c)
- **Complexity**: Low -- the new code follows established patterns exactly
- **Risk**: Very low -- the quirks are only triggered for the specific PCI SSIDs (vendor 0x17aa + specific device IDs). The new functions only execute when those specific devices are detected. No existing functionality is changed.
- **Subsystem maturity**: The Realtek HDA codec driver is one of the most heavily quirked drivers in the kernel, with hundreds of similar entries. This pattern has been proven safe over many years.

### 5. USER IMPACT

Owners of Lenovo ThinkCentre M90 Gen4, M70 Gen4, and M90a Gen5 computers would benefit from having their mute LEDs work correctly. These are business/enterprise desktop computers (ThinkCentre is Lenovo's enterprise line), commonly deployed in corporate environments. Mute LED feedback is an important usability feature, especially for video conferencing.

### 6. STABILITY INDICATORS

- The author (Kailang Yang) is Realtek's own codec engineer and has authored hundreds of similar quirk additions
- The commit was reviewed and signed off by Takashi Iwai, the ALSA maintainer
- The pattern is identical to dozens of other quirk additions that have been in stable for years

### 7. DEPENDENCY CHECK

The commit is self-contained. All functions it calls (coef_micmute_led_set, gpio2_mic_hotkey_event, alc_register_micmute_input_device, alc_update_coef_idx, etc.) exist in all actively supported stable trees. The only backport complication is:

- **File path**: In stable trees (6.6.y, 6.1.y, etc.), the code lives in sound/pci/hda/patch_realtek.c, not sound/hda/codecs/realtek/alc269.c. This is a trivial path adjustment for the backport.
- **Enum ordering**: The new ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY enum must be added at the same relative position or end of the enum (the enum is positional in this driver and changing order would break other fixups). This needs care but is standard for quirk backports.

### 8. COMPARISON WITH SIMILAR COMMITS

The prior commit f603b159231b0 by the same author, doing the same type of change (adding Lenovo ThinkCentre mute LED support), explicitly had Cc: [email protected]. This strongly suggests the author considers this class of change worthy of stable backport and simply omitted the tag this time.

### Conclusion

This is a textbook hardware quirk addition that enables mute LED functionality for specific Lenovo ThinkCentre enterprise desktop models. It follows the exact same pattern as hundreds of other SND_PCI_QUIRK entries in the Realtek driver, uses only existing infrastructure, is self-contained, has essentially zero risk of regression (only activates for specific hardware), and directly benefits real users of these machines. The prior very similar commit by the same author explicitly requested stable backport. The only downside is that it's slightly larger than a pure one-line quirk entry because it needs new fixup functions -- but those functions are trivial copies of existing patterns. The backport will need a file path adjustment due to the driver split.

**YES**

 sound/hda/codecs/realtek/alc269.c | 57 +++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
sound/hda/codecs/realtek/alc269.c +57 -0
index b66965a521076..da71237d2ccb0 100644
@@ -1616,6 +1616,20 @@ static void alc295_fixup_hp_mute_led_coefbit11(struct hda_codec *codec,
 	}
 }
 
+static void alc233_fixup_lenovo_coef_micmute_led(struct hda_codec *codec,
+				const struct hda_fixup *fix, int action)
+{
+	struct alc_spec *spec = codec->spec;
+
+	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+		spec->mic_led_coef.idx = 0x10;
+		spec->mic_led_coef.mask = 1 << 13;
+		spec->mic_led_coef.on = 0;
+		spec->mic_led_coef.off = 1 << 13;
+		snd_hda_gen_add_micmute_led_cdev(codec, coef_micmute_led_set);
+	}
+}
+
 static void alc285_fixup_hp_mute_led(struct hda_codec *codec,
 				const struct hda_fixup *fix, int action)
 {
@@ -1918,6 +1932,39 @@ static void alc280_fixup_hp_gpio2_mic_hotkey(struct hda_codec *codec,
 	}
 }
 
+/* GPIO2 = mic mute hotkey
+ * GPIO3 = mic mute LED
+ */
+static void alc233_fixup_lenovo_gpio2_mic_hotkey(struct hda_codec *codec,
+					     const struct hda_fixup *fix, int action)
+{
+	struct alc_spec *spec = codec->spec;
+
+	alc233_fixup_lenovo_coef_micmute_led(codec, fix, action);
+	if (action == HDA_FIXUP_ACT_PRE_PROBE) {
+		alc_update_coef_idx(codec, 0x10, 1<<2, 1<<2);
+		if (alc_register_micmute_input_device(codec) != 0)
+			return;
+
+		spec->gpio_mask |= 0x04;
+		spec->gpio_dir |= 0x0;
+		snd_hda_codec_write_cache(codec, codec->core.afg, 0,
+					  AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK, 0x04);
+		snd_hda_jack_detect_enable_callback(codec, codec->core.afg,
+						    gpio2_mic_hotkey_event);
+		return;
+	}
+
+	if (!spec->kb_dev)
+		return;
+
+	switch (action) {
+	case HDA_FIXUP_ACT_FREE:
+		input_unregister_device(spec->kb_dev);
+		spec->kb_dev = NULL;
+	}
+}
+
 /* Line2 = mic mute hotkey
  * GPIO2 = mic mute LED
  */
@@ -3816,6 +3863,7 @@ enum {
 	ALC245_FIXUP_HP_TAS2781_I2C_MUTE_LED,
 	ALC288_FIXUP_SURFACE_SWAP_DACS,
 	ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO,
+	ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY,
 };
 
 /* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -6306,6 +6354,10 @@ static const struct hda_fixup alc269_fixups[] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc288_fixup_surface_swap_dacs,
 	},
+        [ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY] = {
+                .type = HDA_FIXUP_FUNC,
+                .v.func = alc233_fixup_lenovo_gpio2_mic_hotkey,
+        },
 };
 
 static const struct hda_quirk alc269_fixup_tbl[] = {
@@ -7211,7 +7263,12 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
 	SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
 	SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC),
 	SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340),
+	SND_PCI_QUIRK(0x17aa, 0x3341, "Lenovo ThinkCentre M90 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
+	SND_PCI_QUIRK(0x17aa, 0x3342, "Lenovo ThinkCentre M90 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
+	SND_PCI_QUIRK(0x17aa, 0x3343, "Lenovo ThinkCentre M70 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
+	SND_PCI_QUIRK(0x17aa, 0x3344, "Lenovo ThinkCentre M70 Gen4", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
 	SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC),
+	SND_PCI_QUIRK(0x17aa, 0x334f, "Lenovo ThinkCentre M90a Gen5", ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY),
 	SND_PCI_QUIRK(0x17aa, 0x3384, "ThinkCentre M90a PRO", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
 	SND_PCI_QUIRK(0x17aa, 0x3386, "ThinkCentre M90a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
 	SND_PCI_QUIRK(0x17aa, 0x3387, "ThinkCentre M70a Gen6", ALC233_FIXUP_LENOVO_L2MH_LOW_ENLED),
Signature · 1 line
2.51.0
author maintainer
#127 lore raw

PATCH 1/1 drm/amd/display: Add signal type check for dcn401 get_phyd32clk_src

In reply to Sasha Levin

From: Dmytro Laktyushkin <[email protected]>

[ Upstream commit c979d8db7b0f293111f2e83795ea353c8ed75de9 ]

Trying to access link enc on a dpia link will cause a crash otherwise

---

LLM Generated explanations, may be completely bogus:

Now I have all the data I need. Let me compile the complete analysis.

---

## Detailed Analysis

### 1. COMMIT MESSAGE ANALYSIS

The commit message is clear and explicit: **"Trying to access link enc on a dpia link will cause a crash otherwise"**. This is a crash fix. The commit has proper review (Reviewed-by: Charlene Liu), was tested (Tested-by: Daniel Wheeler), and was signed off by the AMD display subsystem maintainers.

### 2. CODE CHANGE ANALYSIS

The change is extremely small and surgical — it moves one line of code inside a conditional block.

**The Bug:**
In dcn401_enable_stream_calc(), the function get_phyd32clk_src() was called **unconditionally** for every stream:

```906:942:drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
// BEFORE (buggy):
if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx))
    *dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst;

*phyd32clk = get_phyd32clk_src(pipe_ctx->stream->link);  // Called for
ALL links
```

get_phyd32clk_src() dereferences link->link_enc->transmitter:

```888:904:drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
static enum phyd32clk_clock_source get_phyd32clk_src(struct dc_link
*link)
{
        switch (link->link_enc->transmitter) {  // NULL deref if
link_enc is NULL
        // ...
        }
}
```

For **DPIA (DisplayPort over USB4/Thunderbolt) links**, link->link_enc is NULL because DPIA links use a different path and never create a traditional link encoder. This is confirmed by the DPIA link construction in link_factory.c:

```870:871:drivers/gpu/drm/amd/display/dc/link/link_factory.c
        /* TODO: Create link encoder */
```

The comment confirms no link encoder is created for DPIA endpoints.

**The Fix:**
The fix moves get_phyd32clk_src() inside the
dp_is_128b_132b_signal() conditional:

```c
// AFTER (fixed):
if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) {
    *dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst;
    *phyd32clk = get_phyd32clk_src(pipe_ctx->stream->link);  // Only for
128b/132b
}
```

This is correct because:
- phyd32clk is ONLY used inside a dp_is_128b_132b_signal() guard in the caller dcn401_enable_stream() (lines 966-972), so it only needs to be computed for 128b/132b signals
- DPIA links that are 128b/132b signals *do* have an HPO DP link encoder (checked by dp_is_128b_132b_signal), and they should have the proper link_enc context available in that path
- The dcn20 equivalent (dcn20_enable_stream) already has the **correct pattern** — get_phyd32clk_src() is called inside the dp_is_128b_132b_signal() block (line 3054). The dcn401 code was simply written incorrectly when the calculation was refactored into dcn401_enable_stream_calc.

### 3. CLASSIFICATION

This is a **NULL pointer dereference crash fix**. When a DPIA link is used (USB4/Thunderbolt display tunneling), the code dereferences link->link_enc->transmitter where link_enc is NULL, causing a kernel crash.

### 4. SCOPE AND RISK ASSESSMENT

- **Lines changed:** 4 lines modified (one statement moved inside existing braces)
- **Files touched:** 1 file only
- **Complexity:** Extremely low — just moving a call into an existing conditional block
- **Risk of regression:** Very low. The phyd32clk variable is only consumed inside the same dp_is_128b_132b_signal() check in the caller, so skipping its computation for non-128b/132b signals has no effect. This matches the dcn20 behavior exactly.

### 5. USER IMPACT

- **Who is affected:** Users with AMD DCN4.01 GPUs (RDNA 4 / Radeon RX 9000 series) using USB-C / Thunderbolt displays (DPIA endpoints)
- **Severity:** Kernel crash/NULL pointer dereference — the system would crash when trying to enable a stream on a DPIA link
- **Frequency:** Every time a DPIA display is connected on affected hardware

### 6. STABILITY INDICATORS

- Reviewed-by: Charlene Liu (AMD display team)
- Tested-by: Daniel Wheeler (AMD QA)
- Follows the same pattern already proven correct in dcn20
- Related commit d7f5a61e1b04e also fixed a link->enc NULL pointer access in the same file, indicating this is a known class of bugs for dcn401

### 7. DEPENDENCY CHECK

- This commit is self-contained — no dependencies on other patches
- DCN401 code exists in stable trees from v6.11 onwards
- The code around the change doesn't appear to have changed significantly, so clean application is expected for recent stable branches

### 8. CONCLUSION

This is a textbook stable backport candidate:
- **Fixes a real crash** (NULL pointer dereference)
- **Small and surgical** (4 lines, 1 file)
- **Obviously correct** (matches the pattern already used in dcn20's dcn20_enable_stream)
- **Low regression risk** (the moved statement's output is only consumed inside the same condition)
- **Has proper review and testing**
- **Affects real hardware** (USB4/Thunderbolt displays on RDNA 4 GPUs)
- **Applicable to stable** (dcn401 exists from v6.11 onwards)

**YES**

 drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +3 -3
index e1f5b1a34cde8..f04cbdb3d3814 100644
@@ -916,10 +916,10 @@ static void dcn401_enable_stream_calc(
 			pipe_ctx->stream->link->cur_link_settings.lane_count;
 	uint32_t active_total_with_borders;
 
-	if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx))
+	if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) {
 		*dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst;
-
-	*phyd32clk = get_phyd32clk_src(pipe_ctx->stream->link);
+		*phyd32clk = get_phyd32clk_src(pipe_ctx->stream->link);
+	}
 
 	if (dc_is_tmds_signal(pipe_ctx->stream->signal))
 		dcn401_calculate_dccg_tmds_div_value(pipe_ctx, tmds_div);
Signature · 1 line
2.51.0