Skip to contentSkip to conversation

clk: samsung: Don't register clkdev lookup for the fixed rate clocks

PATCH Applied Marek Szyprowski 4 participants 5 messages May 10, 2024 – Jul 22, 2024 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20240510065909eucas1p20067042a45b26e0a58110ff439dcc1b8@eucas1p2.samsung.com

#1 lore raw

PATCH v2 1/1 clk: samsung: Don't register clkdev lookup for the fixed rate clocks

Commit 4d11c62ca8d7 ("clkdev: report over-sized strings when creating clkdev entries") revealed that clock lookup is registered for all fixed clocks. The mentioned commit added a check if the registered name is not too long. This fails for some clocks registered for Exynos542x SoCs family. This lookup is a left-over from early common clock framework days, not really needed nowadays, so remove it to avoid further issues.

---
v2:
- removed unused 'ret' variable

---
 drivers/clk/samsung/clk.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/clk/samsung/clk.c +1 -10
index b6701905f254..afa5760ed3a1 100644
@@ -139,7 +139,7 @@ void __init samsung_clk_register_fixed_rate(struct samsung_clk_provider *ctx,
 		unsigned int nr_clk)
 {
 	struct clk_hw *clk_hw;
-	unsigned int idx, ret;
+	unsigned int idx;
 
 	for (idx = 0; idx < nr_clk; idx++, list++) {
 		clk_hw = clk_hw_register_fixed_rate(ctx->dev, list->name,
@@ -151,15 +151,6 @@ void __init samsung_clk_register_fixed_rate(struct samsung_clk_provider *ctx,
 		}
 
 		samsung_clk_add_lookup(ctx, clk_hw, list->id);
-
-		/*
-		 * Unconditionally add a clock lookup for the fixed rate clocks.
-		 * There are not many of these on any of Samsung platforms.
-		 */
-		ret = clk_hw_register_clkdev(clk_hw, list->name, NULL);
-		if (ret)
-			pr_err("%s: failed to register clock lookup for %s",
-				__func__, list->name);
 	}
 }
 
Signature · 1 line
2.34.1
maintainer Applied
#2 lore raw

Quoting Marek Szyprowski (2024-05-09 23:59:01)

Quoted 11 lines

Commit 4d11c62ca8d7 ("clkdev: report over-sized strings when creating clkdev entries") revealed that clock lookup is registered for all fixed clocks. The mentioned commit added a check if the registered name is not too long. This fails for some clocks registered for Exynos542x SoCs family. This lookup is a left-over from early common clock framework days, not really needed nowadays, so remove it to avoid further issues.

---

Applied to clk-next

#3 lore raw
In reply to Marek Szyprowski
Quoted 6 lines · Marek Szyprowski

Commit 4d11c62ca8d7 ("clkdev: report over-sized strings when creating clkdev entries") revealed that clock lookup is registered for all fixed clocks. The mentioned commit added a check if the registered name is not too long. This fails for some clocks registered for Exynos542x SoCs family. This lookup is a left-over from early common clock framework days, not really needed nowadays, so remove it to avoid further issues.

This commit causes a warning to appear during startup on Exynos 4x12:

Quoted 3 lines
[    0.000000] exynos4_clk_register_finpll: failed to lookup parent clock xusbxti, assuming fin_pll clock frequency is 24MHz
[    0.000000] Exynos4x12 clocks: sclk_apll = 400000000, sclk_mpll = 800000000
               	sclk_epll = 96000000, sclk_vpll = 108000000, arm_clk = 800000000

The warning seems to come from exynos4_clk_register_finpll in drivers/clk/samsung/clk-exynos4.c, where clk_get fails with error code -2.

Best regards
Artur

#4 lore raw
Quoted 8 lines · Artur Weber
Quoted 6 lines · Marek Szyprowski

Commit 4d11c62ca8d7 ("clkdev: report over-sized strings when creating clkdev entries") revealed that clock lookup is registered for all fixed clocks. The mentioned commit added a check if the registered name is not too long. This fails for some clocks registered for Exynos542x SoCs family. This lookup is a left-over from early common clock framework days, not really needed nowadays, so remove it to avoid further issues.

Quoted 7 lines

This commit causes a warning to appear during startup on Exynos 4x12:>

Quoted 3 lines
[    0.000000] exynos4_clk_register_finpll: failed to lookup parent clock xusbxti, assuming fin_pll clock frequency is 24MHz
[    0.000000] Exynos4x12 clocks: sclk_apll = 400000000, sclk_mpll = 800000000
               	sclk_epll = 96000000, sclk_vpll = 108000000, arm_clk = 800000000

The warning seems to come from exynos4_clk_register_finpll in drivers/clk/samsung/clk-exynos4.c, where clk_get fails with error code -2.

Indeed, so clk_hw_register_clkdev() was needed for clk_get(). I have a fix for this.

Best regards,
Krzysztof

#5 lore raw
Quoted 14 lines · Krzysztof Kozlowski
Quoted 13 lines · Artur Weber
Quoted 6 lines · Marek Szyprowski

Commit 4d11c62ca8d7 ("clkdev: report over-sized strings when creating clkdev entries") revealed that clock lookup is registered for all fixed clocks. The mentioned commit added a check if the registered name is not too long. This fails for some clocks registered for Exynos542x SoCs family. This lookup is a left-over from early common clock framework days, not really needed nowadays, so remove it to avoid further issues.

This commit causes a warning to appear during startup on Exynos 4x12:>

Quoted 3 lines
[    0.000000] exynos4_clk_register_finpll: failed to lookup parent clock xusbxti, assuming fin_pll clock frequency is 24MHz
[    0.000000] Exynos4x12 clocks: sclk_apll = 400000000, sclk_mpll = 800000000
               	sclk_epll = 96000000, sclk_vpll = 108000000, arm_clk = 800000000
Quoted 6 lines
Quoted 2 lines

The warning seems to come from exynos4_clk_register_finpll in drivers/clk/samsung/clk-exynos4.c, where clk_get fails with error code -2.

Indeed, so clk_hw_register_clkdev() was needed for clk_get(). I have a fix for this.

... and of course thanks for the report!

Best regards,
Krzysztof