lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250228-mt6359-fix-probe-failed-v1-1-64941d387b2c@collabora.com>
Date: Fri, 28 Feb 2025 11:32:19 +0100
From: Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>
To: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, 
 Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>, 
 Matthias Brugger <matthias.bgg@...il.com>, 
 AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, 
 Macpaul Lin <macpaul.lin@...iatek.com>
Cc: kernel@...labora.com, linux-sound@...r.kernel.org, 
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
 linux-mediatek@...ts.infradead.org, 
 Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>
Subject: [PATCH] ASoC: mediatek: mt6359: Fix DT parse error due to wrong
 child node name

A recent dtbs_check error fix in mt6359.dtsi file changed a node name
(from "mt6359codec" to "audio-codec") without modifying the mt6539
codec code that uses it.
It leads to a probe failure after devicetree parsing returns in error:
```
[    1.354025] mt6359-sound mt6359-sound: mt6359_platform_driver_probe() failed to parse dts
[    1.355066] mt6359-sound mt6359-sound: probe with driver mt6359-sound failed with error -22
```

So, add the child node retrieval with the new name and if not found,
try with the older one for backward compatibility.

Fixes: 76b35f59bbe6 ("arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec")
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>
---
I've tested this patch on a Mediatek Genio 510 EVK board with a kernel
based on linux-next (tag: 20250228)
---
 sound/soc/codecs/mt6359.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/mt6359.c b/sound/soc/codecs/mt6359.c
index 0b76a55664b0352f6ee2d0f3c96466ffe1df2d6d..f73120c6a6ce680797a1f61841815ca01a24adf4 100644
--- a/sound/soc/codecs/mt6359.c
+++ b/sound/soc/codecs/mt6359.c
@@ -2867,9 +2867,12 @@ static int mt6359_parse_dt(struct mt6359_priv *priv)
 	struct device *dev = priv->dev;
 	struct device_node *np;
 
-	np = of_get_child_by_name(dev->parent->of_node, "mt6359codec");
-	if (!np)
-		return -EINVAL;
+	np = of_get_child_by_name(dev->parent->of_node, "audio-codec");
+	if (!np) {
+		np = of_get_child_by_name(dev->parent->of_node, "mt6359codec");
+		if (!np)
+			return -EINVAL;
+	}
 
 	ret = of_property_read_u32(np, "mediatek,dmic-mode",
 				   &priv->dmic_one_wire_mode);

---
base-commit: 15c3f6fa407bf6913c282b22ef2bcfa40cb53927
change-id: 20250227-mt6359-fix-probe-failed-a83e0fee902c

Best regards,
-- 
Louis-Alexis Eyraud <louisalexis.eyraud@...labora.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ