kernel: bump 5.10 to 5.10.173
[openwrt/staging/hauke.git] / target / linux / bcm27xx / patches-5.10 / 950-0596-clk-Always-clamp-the-rounded-rate.patch
1 From 8f26362634435209e4f849ce2efcb2b4f48c8f5b Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Wed, 5 May 2021 15:35:34 +0200
4 Subject: [PATCH] clk: Always clamp the rounded rate
5
6 The current core while setting the min and max rate properly in the
7 clk_request structure will not make sure that the requested rate is
8 within these boundaries, leaving it to each and every driver to make
9 sure it is.
10
11 Add a clamp call to make sure it's always done.
12
13 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
14 ---
15 drivers/clk/clk.c | 2 ++
16 1 file changed, 2 insertions(+)
17
18 --- a/drivers/clk/clk.c
19 +++ b/drivers/clk/clk.c
20 @@ -1344,6 +1344,8 @@ static int clk_core_determine_round_nolo
21 if (!core)
22 return 0;
23
24 + req->rate = clamp(req->rate, req->min_rate, req->max_rate);
25 +
26 /*
27 * At this point, core protection will be disabled if
28 * - if the provider is not protected at all