Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.18-6.1] ASoC: cs35l45: Corrects ASP_TX5 DAPM widget channel
       [not found] <20260202214643.212290-1-sashal@kernel.org>
@ 2026-02-02 21:46 ` Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2026-02-02 21:46 UTC (permalink / raw)
  To: patches, stable
  Cc: Ricardo Rivera-Matos, Charles Keepax, Mark Brown, Sasha Levin,
	david.rhodes, rf, linux-sound, patches

From: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>

[ Upstream commit 6dd0fdc908c02318c28ec2c0979661846ee0a9f7 ]

ASP_TX5 was incorrectly mapped to a channel value of 3 corrects,
the channel value of 4.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Link: https://patch.msgid.link/20260115192523.1335742-2-rriveram@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---

LLM Generated explanations, may be completely bogus:

## Analysis of ASoC: cs35l45 DAPM Widget Channel Fix

### 1. COMMIT MESSAGE ANALYSIS

The commit message is straightforward: it corrects the ASP_TX5 DAPM
widget channel value from 3 to 4. The message explicitly states this is
a correction of an incorrect mapping. Key observations:
- Uses the word "Corrects" indicating this is a bug fix
- Has a "Reviewed-by:" tag from Charles Keepax (Cirrus Logic engineer)
- No Fixes: tag or Cc: stable tag (expected for commits under review)

### 2. CODE CHANGE ANALYSIS

The change is a single-character fix:
```c
- SND_SOC_DAPM_AIF_OUT("ASP_TX5", NULL, 3, CS35L45_ASP_ENABLES1,
  CS35L45_ASP_TX5_EN_SHIFT, 0),
+ SND_SOC_DAPM_AIF_OUT("ASP_TX5", NULL, 4, CS35L45_ASP_ENABLES1,
CS35L45_ASP_TX5_EN_SHIFT, 0),
```

Looking at the context, the third parameter in `SND_SOC_DAPM_AIF_OUT`
represents the channel number. The pattern in the code is clear:
- ASP_TX1: channel 0
- ASP_TX2: channel 1
- ASP_TX3: channel 2
- ASP_TX4: channel 3
- ASP_TX5: was 3 (duplicate!), should be 4

This is an obvious copy-paste error where ASP_TX5 was accidentally given
the same channel number (3) as ASP_TX4. Each TX widget should have a
unique, sequential channel number.

### 3. CLASSIFICATION

**Bug Fix**: This is clearly fixing an incorrect configuration value,
not adding a feature. The channel parameter is used by the ALSA/ASoC
framework to route audio data correctly. Having two TX widgets with the
same channel number would cause incorrect audio routing behavior.

**Type of Bug**: Data/configuration corruption - audio data intended for
channel 5 would be misrouted.

### 4. SCOPE AND RISK ASSESSMENT

- **Lines changed**: 1 line
- **Files changed**: 1 file (sound/soc/codecs/cs35l45.c)
- **Complexity**: Trivially simple - changing a single integer constant
- **Risk**: Extremely low - this is correcting an obviously wrong value
  to an obviously correct value
- **Subsystem**: ASoC codec driver for Cirrus Logic CS35L45 (audio
  amplifier IC)

The fix cannot introduce any new bugs because:
1. It's correcting a clearly wrong value (duplicate channel number)
2. The correct value (4) follows the obvious sequential pattern
3. No logic changes, just a constant correction

### 5. USER IMPACT

The CS35L45 is an audio amplifier commonly used in:
- Laptops
- Smartphones
- Tablets
- Other mobile/embedded devices

Users with CS35L45 hardware who use ASP_TX5 would experience:
- Incorrect audio routing
- Audio data corruption or loss on channel 5
- Potentially broken audio capture/monitoring functionality

While this may not affect all users of the driver (only those using all
5 TX channels), those who do use TX5 would definitely hit this bug.

### 6. STABILITY INDICATORS

- **Reviewed-by**: Charles Keepax (Cirrus Logic kernel engineer) -
  indicates the fix was reviewed by a domain expert
- **Maintainer sign-off**: Mark Brown (ASoC maintainer) accepted the
  patch
- The fix is trivially correct by inspection

### 7. DEPENDENCY CHECK

- No dependencies on other commits
- The cs35l45 driver exists in stable kernels
- The fix applies to the same code structure that has existed since the
  driver was introduced

### 8. STABLE KERNEL CRITERIA EVALUATION

| Criterion | Assessment |
|-----------|------------|
| Obviously correct | ✅ Yes - sequential channel numbering is obvious |
| Fixes a real bug | ✅ Yes - duplicate channel causes audio routing
issues |
| Important issue | ✅ Moderate - affects audio functionality for
affected users |
| Small and contained | ✅ Yes - 1 line change |
| No new features | ✅ Correct - just fixes misconfiguration |
| No new APIs | ✅ Correct |

### CONCLUSION

This is an ideal stable backport candidate:
1. **Trivially simple**: Single character change (3 → 4)
2. **Obviously correct**: The sequential pattern makes the error and fix
   self-evident
3. **Real bug**: Duplicate channel numbers cause actual audio routing
   problems
4. **Zero risk**: Cannot introduce regressions - it's correcting an
   obvious typo
5. **Well-reviewed**: Has review from Cirrus Logic engineer and ASoC
   maintainer
6. **Self-contained**: No dependencies, applies cleanly

The fix is small, surgical, and meets all stable kernel criteria.

**YES**

 sound/soc/codecs/cs35l45.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c
index d4dcdf37bb709..9b1eff4e9bb71 100644
--- a/sound/soc/codecs/cs35l45.c
+++ b/sound/soc/codecs/cs35l45.c
@@ -455,7 +455,7 @@ static const struct snd_soc_dapm_widget cs35l45_dapm_widgets[] = {
 	SND_SOC_DAPM_AIF_OUT("ASP_TX2", NULL, 1, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX2_EN_SHIFT, 0),
 	SND_SOC_DAPM_AIF_OUT("ASP_TX3", NULL, 2, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX3_EN_SHIFT, 0),
 	SND_SOC_DAPM_AIF_OUT("ASP_TX4", NULL, 3, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX4_EN_SHIFT, 0),
-	SND_SOC_DAPM_AIF_OUT("ASP_TX5", NULL, 3, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX5_EN_SHIFT, 0),
+	SND_SOC_DAPM_AIF_OUT("ASP_TX5", NULL, 4, CS35L45_ASP_ENABLES1, CS35L45_ASP_TX5_EN_SHIFT, 0),
 
 	SND_SOC_DAPM_MUX("ASP_TX1 Source", SND_SOC_NOPM, 0, 0, &cs35l45_asp_muxes[0]),
 	SND_SOC_DAPM_MUX("ASP_TX2 Source", SND_SOC_NOPM, 0, 0, &cs35l45_asp_muxes[1]),
-- 
2.51.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-02 21:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260202214643.212290-1-sashal@kernel.org>
2026-02-02 21:46 ` [PATCH AUTOSEL 6.18-6.1] ASoC: cs35l45: Corrects ASP_TX5 DAPM widget channel Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox