* [PATCH] clk: samsung: fix getting Exynos4 fin_pll rate from external clocks
@ 2024-07-22 6:33 Krzysztof Kozlowski
2024-07-23 10:33 ` Artur Weber
2024-07-23 18:29 ` Stephen Boyd
0 siblings, 2 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2024-07-22 6:33 UTC (permalink / raw)
To: Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
Alim Akhtar, Michael Turquette, Stephen Boyd, Marek Szyprowski,
Sam Protsenko, linux-samsung-soc, linux-clk, linux-arm-kernel,
linux-kernel
Cc: Krzysztof Kozlowski, Artur Weber, stable
Commit 0dc83ad8bfc9 ("clk: samsung: Don't register clkdev lookup for the
fixed rate clocks") claimed registering clkdev lookup is not necessary
anymore, but that was not entirely true: Exynos4210/4212/4412 clock code
still relied on it to get the clock rate of xxti or xusbxti external
clocks.
Drop that requirement by accessing already registered clk_hw when
looking up the xxti/xusbxti rate.
Reported-by: Artur Weber <aweber.kernel@gmail.com>
Closes: https://lore.kernel.org/all/6227c1fb-d769-462a-b79b-abcc15d3db8e@gmail.com/
Fixes: 0dc83ad8bfc9 ("clk: samsung: Don't register clkdev lookup for the fixed rate clocks")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
drivers/clk/samsung/clk-exynos4.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c
index a026ccca7315..28945b6b0ee1 100644
--- a/drivers/clk/samsung/clk-exynos4.c
+++ b/drivers/clk/samsung/clk-exynos4.c
@@ -1040,19 +1040,20 @@ static unsigned long __init exynos4_get_xom(void)
static void __init exynos4_clk_register_finpll(struct samsung_clk_provider *ctx)
{
struct samsung_fixed_rate_clock fclk;
- struct clk *clk;
- unsigned long finpll_f = 24000000;
+ unsigned long finpll_f;
+ unsigned int parent;
char *parent_name;
unsigned int xom = exynos4_get_xom();
parent_name = xom & 1 ? "xusbxti" : "xxti";
- clk = clk_get(NULL, parent_name);
- if (IS_ERR(clk)) {
+ parent = xom & 1 ? CLK_XUSBXTI : CLK_XXTI;
+
+ finpll_f = clk_hw_get_rate(ctx->clk_data.hws[parent]);
+ if (!finpll_f) {
pr_err("%s: failed to lookup parent clock %s, assuming "
"fin_pll clock frequency is 24MHz\n", __func__,
parent_name);
- } else {
- finpll_f = clk_get_rate(clk);
+ finpll_f = 24000000;
}
fclk.id = CLK_FIN_PLL;
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: samsung: fix getting Exynos4 fin_pll rate from external clocks
2024-07-22 6:33 [PATCH] clk: samsung: fix getting Exynos4 fin_pll rate from external clocks Krzysztof Kozlowski
@ 2024-07-23 10:33 ` Artur Weber
2024-07-23 18:29 ` Stephen Boyd
1 sibling, 0 replies; 3+ messages in thread
From: Artur Weber @ 2024-07-23 10:33 UTC (permalink / raw)
To: Krzysztof Kozlowski, Krzysztof Kozlowski, Sylwester Nawrocki,
Chanwoo Choi, Alim Akhtar, Michael Turquette, Stephen Boyd,
Marek Szyprowski, Sam Protsenko, linux-samsung-soc, linux-clk,
linux-arm-kernel, linux-kernel
Cc: stable
On 22.07.2024 08:33, Krzysztof Kozlowski wrote:
> Commit 0dc83ad8bfc9 ("clk: samsung: Don't register clkdev lookup for the
> fixed rate clocks") claimed registering clkdev lookup is not necessary
> anymore, but that was not entirely true: Exynos4210/4212/4412 clock code
> still relied on it to get the clock rate of xxti or xusbxti external
> clocks.
>
> Drop that requirement by accessing already registered clk_hw when
> looking up the xxti/xusbxti rate.
>
> Reported-by: Artur Weber <aweber.kernel@gmail.com>
> Closes: https://lore.kernel.org/all/6227c1fb-d769-462a-b79b-abcc15d3db8e@gmail.com/
> Fixes: 0dc83ad8bfc9 ("clk: samsung: Don't register clkdev lookup for the fixed rate clocks")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Seems to fix the warning for me on the Samsung Galaxy Tab 3 8.0, so:
Tested-by: Artur Weber <aweber.kernel@gmail.com> # Exynos4212
Thanks for the patch!
Best regards
Artur
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: samsung: fix getting Exynos4 fin_pll rate from external clocks
2024-07-22 6:33 [PATCH] clk: samsung: fix getting Exynos4 fin_pll rate from external clocks Krzysztof Kozlowski
2024-07-23 10:33 ` Artur Weber
@ 2024-07-23 18:29 ` Stephen Boyd
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2024-07-23 18:29 UTC (permalink / raw)
To: Alim Akhtar, Chanwoo Choi, Krzysztof Kozlowski,
Krzysztof Kozlowski, Marek Szyprowski, Michael Turquette,
Sam Protsenko, Sylwester Nawrocki, linux-arm-kernel, linux-clk,
linux-kernel, linux-samsung-soc
Cc: Krzysztof Kozlowski, Artur Weber, stable
Quoting Krzysztof Kozlowski (2024-07-21 23:33:09)
> Commit 0dc83ad8bfc9 ("clk: samsung: Don't register clkdev lookup for the
> fixed rate clocks") claimed registering clkdev lookup is not necessary
> anymore, but that was not entirely true: Exynos4210/4212/4412 clock code
> still relied on it to get the clock rate of xxti or xusbxti external
> clocks.
>
> Drop that requirement by accessing already registered clk_hw when
> looking up the xxti/xusbxti rate.
>
> Reported-by: Artur Weber <aweber.kernel@gmail.com>
> Closes: https://lore.kernel.org/all/6227c1fb-d769-462a-b79b-abcc15d3db8e@gmail.com/
> Fixes: 0dc83ad8bfc9 ("clk: samsung: Don't register clkdev lookup for the fixed rate clocks")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-23 18:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-22 6:33 [PATCH] clk: samsung: fix getting Exynos4 fin_pll rate from external clocks Krzysztof Kozlowski
2024-07-23 10:33 ` Artur Weber
2024-07-23 18:29 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®