bcm27xx: add support for linux v5.15
[openwrt/staging/ldir.git] / target / linux / bcm27xx / patches-5.15 / 950-0852-clk-Remove-redundant-clk_core_init_rate_req-call.patch
1 From 62bc67ade6e30b4a578f105d8bb18de0ffc45a88 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Sat, 2 Apr 2022 14:06:53 +0200
4 Subject: [PATCH] clk: Remove redundant clk_core_init_rate_req() call
5
6 Since all the users of clk_core_round_rate_nolock() will now properly
7 initialize, there's no need for it to initialize the request itself.
8
9 This is even dangerous, as if the clock cannot change its rate by itself
10 and has CLK_SET_RATE_PARENT, clk_core_round_rate_nolock() will call
11 itself with the parent clock but the client clk_rate_request structure.
12
13 We will then reinitialize the child request with the parent context
14 (parent, boundaries, etc.), which is an issue if the parent ever changes
15 its own parent or parent rate.
16
17 Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # imx8mp
18 Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> # exynos4210, meson g12b
19 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
20 ---
21 drivers/clk/clk.c | 2 --
22 1 file changed, 2 deletions(-)
23
24 --- a/drivers/clk/clk.c
25 +++ b/drivers/clk/clk.c
26 @@ -1430,8 +1430,6 @@ static int clk_core_round_rate_nolock(st
27 return 0;
28 }
29
30 - clk_core_init_rate_req(core, req, req->rate);
31 -
32 if (clk_core_can_round(core))
33 return clk_core_determine_round_nolock(core, req);
34 else if (core->flags & CLK_SET_RATE_PARENT)