Skip to contentSkip to conversation

ASoC: codecs: warn on unknown codec version

PATCH In review Dmitry Baryshkov 2 participants 4 messages Aug 3, 2024 – Aug 9, 2024

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

cover ASoC: codecs: warn on unknown codec version

While debugging broken audio issues on some of Qualcomm platforms I stumbled upon the kernel not providing the actual error information. It prints an error from the wsa_macro driver, but the actual issue is in the VA macro driver. Add error message to point to the actual error location.

va_macro 3370000.codec: Unknown VA Codec version, ID: 00 / 0f / 00 wsa_macro 3240000.codec: Unsupported Codec version (0)

---
Dmitry Baryshkov (2):
ASoC: codecs: lpass-macro: fix version strings returned for 1.x codecs
ASoC: codecs: lpass-va-macro: warn on unknown version

 sound/soc/codecs/lpass-macro-common.h | 6 ++++++
 sound/soc/codecs/lpass-va-macro.c     | 4 ++++
 2 files changed, 10 insertions(+)

---
base-commit: 668d33c9ff922c4590c58754ab064aaf53c387dd
change-id: 20240803-codec-version-db6f65ab51ce

Best regards,

Signature · 1 line
Dmitry Baryshkov <[email protected]>
#1 lore raw

PATCH 1/2 ASoC: codecs: lpass-macro: fix version strings returned for 1.x codecs

Add missing cases to lpass_macro_get_codec_version_string() to let it print the correct codec version for 1.x codec platforms.

Fixes 378918d59181 ("ASoC: codecs: lpass-macro: add helpers to get codec version")
---
 sound/soc/codecs/lpass-macro-common.h | 6 ++++++
 1 file changed, 6 insertions(+)
sound/soc/codecs/lpass-macro-common.h +6 -0
index 21cb30ab706d..fb4b96cb2b23 100644
@@ -49,6 +49,12 @@ static inline void lpass_macro_pds_exit_action(void *pds)
 static inline const char *lpass_macro_get_codec_version_string(int version)
 {
 	switch (version) {
+	case LPASS_CODEC_VERSION_1_0:
+		return "v1.0";
+	case LPASS_CODEC_VERSION_1_1:
+		return "v1.1";
+	case LPASS_CODEC_VERSION_1_2:
+		return "v1.2";
 	case LPASS_CODEC_VERSION_2_0:
 		return "v2.0";
 	case LPASS_CODEC_VERSION_2_1:
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/2 ASoC: codecs: lpass-va-macro: warn on unknown version

In reply to Dmitry Baryshkov

Warn the users if the driver doesn't know the codec version. This helps in debugging the issues with other codec not detecting the correct version.

va_macro 3370000.codec: Unknown VA Codec version, ID: 00 / 0f / 00

---
 sound/soc/codecs/lpass-va-macro.c | 4 ++++
 1 file changed, 4 insertions(+)
sound/soc/codecs/lpass-va-macro.c +4 -0
index b852cc7ffad9..cdc090418d74 100644
@@ -1483,6 +1483,10 @@ static void va_macro_set_lpass_codec_version(struct va_macro *va)
 	if ((core_id_0 == 0x02) && (core_id_1 == 0x0F) && (core_id_2 == 0x80 || core_id_2 == 0x81))
 		version = LPASS_CODEC_VERSION_2_8;
 
+	if (version == LPASS_CODEC_VERSION_UNKNOWN)
+		dev_warn(va->dev, "Unknown Codec version, ID: %02x / %02x / %02x\n",
+			 core_id_0, core_id_1, core_id_2);
+
 	lpass_macro_set_codec_version(version);
 
 	dev_dbg(va->dev, "LPASS Codec Version %s\n", lpass_macro_get_codec_version_string(version));
Signature · 1 line
2.39.2
maintainer
#3 lore raw
In reply to Dmitry Baryshkov
Quoted 10 lines · Dmitry Baryshkov

While debugging broken audio issues on some of Qualcomm platforms I stumbled upon the kernel not providing the actual error information. It prints an error from the wsa_macro driver, but the actual issue is in the VA macro driver. Add error message to point to the actual error location.

va_macro 3370000.codec: Unknown VA Codec version, ID: 00 / 0f / 00 wsa_macro 3240000.codec: Unsupported Codec version (0)

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: codecs: lpass-macro: fix version strings returned for 1.x codecs

      commit: 49f6202ce991742f451fc724f03d0c17460d06cd
[2/2] ASoC: codecs: lpass-va-macro: warn on unknown version
      commit: a9a7a2d80790d06cd32c535e2e7b10f72ce592e7

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