ath25: switch default kernel to 5.15
[openwrt/staging/ldir.git] / target / linux / at91 / patches-5.10 / 247-clk-use-clk_core_get_rate_recalc-in-clk_rate_get.patch
1 From fe07791494a78d5a4be1363385e6ba7940740644 Mon Sep 17 00:00:00 2001
2 From: Claudiu Beznea <claudiu.beznea@microchip.com>
3 Date: Mon, 11 Oct 2021 14:27:19 +0300
4 Subject: [PATCH 247/247] clk: use clk_core_get_rate_recalc() in clk_rate_get()
5
6 In case clock flags contains CLK_GET_RATE_NOCACHE the clk_rate_get()
7 will return the cached rate. Thus, use clk_core_get_rate_recalc() which
8 takes proper action when clock flags contains CLK_GET_RATE_NOCACHE.
9
10 Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
11 Link: https://lore.kernel.org/r/20211011112719.3951784-16-claudiu.beznea@microchip.com
12 Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
13 [sboyd@kernel.org: Grab prepare lock around operation]
14 Signed-off-by: Stephen Boyd <sboyd@kernel.org>
15 ---
16 drivers/clk/clk.c | 5 ++++-
17 1 file changed, 4 insertions(+), 1 deletion(-)
18
19 --- a/drivers/clk/clk.c
20 +++ b/drivers/clk/clk.c
21 @@ -3116,7 +3116,10 @@ static int clk_rate_get(void *data, u64
22 {
23 struct clk_core *core = data;
24
25 - *val = core->rate;
26 + clk_prepare_lock();
27 + *val = clk_core_get_rate_recalc(core);
28 + clk_prepare_unlock();
29 +
30 return 0;
31 }
32