Skip to contentSkip to conversation

ASoC: qcom: lpass-cpu: Fix fallback SD line index handling

PATCH In review Brian Norris 3 participants 3 messages Dec 31, 2022 – Jan 2, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: qcom: lpass-cpu: Fix fallback SD line index handling

These indices should reference the ID placed within the dai_driver array, not the indices of the array itself.

This fixes commit 4ff028f6c108 ("ASoC: qcom: lpass-cpu: Make I2S SD lines configurable"), which among others, broke IPQ8064 audio (sound/soc/qcom/lpass-ipq806x.c) because it uses ID 4 but we'd stop initializing the mi2s_playback_sd_mode and mi2s_capture_sd_mode arrays at ID 0.

Fixes 4ff028f6c108 ("ASoC: qcom: lpass-cpu: Make I2S SD lines configurable")
---
 sound/soc/qcom/lpass-cpu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/qcom/lpass-cpu.c +3 -2
index 54353842dc07..dbdaaa85ce48 100644
@@ -1037,10 +1037,11 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev,
 					struct lpass_data *data)
 {
 	struct device_node *node;
-	int ret, id;
+	int ret, i, id;
 
 	/* Allow all channels by default for backwards compatibility */
-	for (id = 0; id < data->variant->num_dai; id++) {
+	for (i = 0; i < data->variant->num_dai; i++) {
+		id = data->variant->dai_driver[i].id;
 		data->mi2s_playback_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH;
 		data->mi2s_capture_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH;
 	}
Signature · 1 line
2.39.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Brian,

Quoted 3 lines · Brian Norris

These indices should reference the ID placed within the dai_driver array, not the indices of the array itself.

Indeed, thanks for the fix and sorry for breaking IPQ8064 audio. Looks like it's not tested very often because my patch that broke it was merged 2.5 years ago. :-)

Quoted 2 lines

This fixes commit 4ff028f6c108 ("ASoC: qcom: lpass-cpu: Make I2S SD lines configurable"), which among others, broke IPQ8064 audio

FWIW I think it's really just IPQ8064 audio (no others) because the other platforms all happen to have the MI2S ports at the same index as their ID.

Quoted 7 lines

(sound/soc/qcom/lpass-ipq806x.c) because it uses ID 4 but we'd stop initializing the mi2s_playback_sd_mode and mi2s_capture_sd_mode arrays at ID 0.

Fixes 4ff028f6c108 ("ASoC: qcom: lpass-cpu: Make I2S SD lines configurable")

BTW I just found this patch "by accident" while looking for something else on the stable mailing list. Please Cc the original author if you use Fixes (get_maintainer.pl should suggest that automatically if you run it in the kernel tree). :)

Thanks!
Stephan

Quoted 25 lines
---
 sound/soc/qcom/lpass-cpu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/qcom/lpass-cpu.c +3 -2
index 54353842dc07..dbdaaa85ce48 100644
@@ -1037,10 +1037,11 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev,
 					struct lpass_data *data)
 {
 	struct device_node *node;
-	int ret, id;
+	int ret, i, id;
 
 	/* Allow all channels by default for backwards compatibility */
-	for (id = 0; id < data->variant->num_dai; id++) {
+	for (i = 0; i < data->variant->num_dai; i++) {
+		id = data->variant->dai_driver[i].id;
 		data->mi2s_playback_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH;
 		data->mi2s_capture_sd_mode[id] = LPAIF_I2SCTL_MODE_8CH;
 	}
Signature · 1 line
2.39.0
maintainer
#2 lore raw
In reply to Brian Norris
Quoted 10 lines · Brian Norris

These indices should reference the ID placed within the dai_driver array, not the indices of the array itself.

This fixes commit 4ff028f6c108 ("ASoC: qcom: lpass-cpu: Make I2S SD lines configurable"), which among others, broke IPQ8064 audio (sound/soc/qcom/lpass-ipq806x.c) because it uses ID 4 but we'd stop initializing the mi2s_playback_sd_mode and mi2s_capture_sd_mode arrays at ID 0.

[...]

Applied to

broonie/sound.git for-next

Thanks!

[1/1] ASoC: qcom: lpass-cpu: Fix fallback SD line index handling

      commit: 000bca8d706d1bf7cca01af75787247c5a2fdedf

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark