Skip to contentSkip to conversation

timer: mtk: skip setting parent with dummy fixed-clock

PATCH In review Christian Marangi 2 participants 2 messages Jul 6, 2024 – Jul 18, 2024 Arm MediaTek

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 timer: mtk: skip setting parent with dummy fixed-clock

Skip setting parent with dummy fixed-clock. Upstream linux might declare an additional clock for the mtk timer and that additional clock might also be a fixed-clock defined in DT. Setting parent of a dummy fixed-clock resulta in error hence mtk timer fails to probe.

Skip setting parent to permit correct probe of the mtk timer.

Fixes d3c3606c5cc6 ("timer: MediaTek: add timer driver for MediaTek SoCs")
---
 drivers/timer/mtk_timer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/timer/mtk_timer.c +2 -1
index 8216c289837..06deb23eb99 100644
@@ -73,7 +73,8 @@ static int mtk_timer_probe(struct udevice *dev)
 		return ret;
 
 	ret = clk_get_by_index(dev, 1, &parent);
-	if (!ret) {
+	/* Skip setting the parent with dummy fixed-clock */
+	if (!ret && parent.dev->driver != DM_DRIVER_GET(fixed_clock)) {
 		ret = clk_set_parent(&clk, &parent);
 		if (ret)
 			return ret;
Signature · 1 line
2.45.2
#1 lore raw
Quoted 8 lines · Christian Marangi

Skip setting parent with dummy fixed-clock. Upstream linux might declare an additional clock for the mtk timer and that additional clock might also be a fixed-clock defined in DT. Setting parent of a dummy fixed-clock resulta in error hence mtk timer fails to probe.

Skip setting parent to permit correct probe of the mtk timer.

[...]

Applied to u-boot/master, thanks!

Signature · 1 line
Tom