mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-02-15 04:42:02 +00:00
34 lines
1 KiB
Diff
34 lines
1 KiB
Diff
|
From b4f75524394dfa1e29b100bbffc1e31b29e8eb4f Mon Sep 17 00:00:00 2001
|
||
|
From: Maxime Ripard <maxime@cerno.tech>
|
||
|
Date: Wed, 5 May 2021 15:35:34 +0200
|
||
|
Subject: [PATCH 464/634] clk: Always clamp the rounded rate
|
||
|
|
||
|
The current core while setting the min and max rate properly in the
|
||
|
clk_request structure will not make sure that the requested rate is
|
||
|
within these boundaries, leaving it to each and every driver to make
|
||
|
sure it is.
|
||
|
|
||
|
Add a clamp call to make sure it's always done.
|
||
|
|
||
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
||
|
---
|
||
|
drivers/clk/clk.c | 2 ++
|
||
|
1 file changed, 2 insertions(+)
|
||
|
|
||
|
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
|
||
|
index 438c5f8f0b1e..03717d1392c8 100644
|
||
|
--- a/drivers/clk/clk.c
|
||
|
+++ b/drivers/clk/clk.c
|
||
|
@@ -1337,6 +1337,8 @@ static int clk_core_determine_round_nolock(struct clk_core *core,
|
||
|
if (!core)
|
||
|
return 0;
|
||
|
|
||
|
+ req->rate = clamp(req->rate, req->min_rate, req->max_rate);
|
||
|
+
|
||
|
/*
|
||
|
* At this point, core protection will be disabled
|
||
|
* - if the provider is not protected at all
|
||
|
--
|
||
|
2.33.1
|
||
|
|