2022-04-22 15:00:47 +00:00
|
|
|
From 12e7e9e42fb9b5d057f717ec3738dc8c62394c60 Mon Sep 17 00:00:00 2001
|
2021-11-24 17:32:01 +00:00
|
|
|
From: Maxime Ripard <maxime@cerno.tech>
|
|
|
|
Date: Wed, 5 May 2021 15:35:34 +0200
|
2022-04-22 15:00:47 +00:00
|
|
|
Subject: [PATCH 448/828] clk: Always clamp the rounded rate
|
2021-11-24 17:32:01 +00:00
|
|
|
|
|
|
|
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(+)
|
|
|
|
|
|
|
|
--- a/drivers/clk/clk.c
|
|
|
|
+++ b/drivers/clk/clk.c
|
2022-04-22 15:00:47 +00:00
|
|
|
@@ -1355,6 +1355,8 @@ static int clk_core_determine_round_nolo
|
2021-11-24 17:32:01 +00:00
|
|
|
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
|