]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
clk: Store clk_core for clk_rate_request
authorMaxime Ripard <maxime@cerno.tech>
Wed, 26 Oct 2022 13:46:58 +0000 (15:46 +0200)
committerStephen Boyd <sboyd@kernel.org>
Wed, 7 Dec 2022 21:54:01 +0000 (13:54 -0800)
The struct clk_rate_request is meant to store the context around a rate
request such as the parent, boundaries, and so on.

However, it doesn't store the clock the rate request is submitted to,
which makes debugging difficult.

Let's add a pointer to the relevant clk_core instance in order to
improve the debugging of rate requests in a subsequent patch.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20221018-clk-rate-request-tracing-v2-1-5170b363c413@cerno.tech
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk.c
include/linux/clk-provider.h

index c3c3f8c072588d2a3581e7af7cad80115ffb081d..042e32acce0bfce81f211b6107fbf097a13e714d 100644 (file)
@@ -1464,6 +1464,7 @@ static void clk_core_init_rate_req(struct clk_core * const core,
 
        memset(req, 0, sizeof(*req));
 
+       req->core = core;
        req->rate = rate;
        clk_core_get_boundaries(core, &req->min_rate, &req->max_rate);
 
index 267cd06b54a0196704e1d395f44ee20c1fed263c..842e72a5348fa3f571a1f1669af3c6c617ffe905 100644 (file)
@@ -44,6 +44,7 @@ struct dentry;
  *
  * Should be initialized by calling clk_hw_init_rate_request().
  *
+ * @core:              Pointer to the struct clk_core affected by this request
  * @rate:              Requested clock rate. This field will be adjusted by
  *                     clock drivers according to hardware capabilities.
  * @min_rate:          Minimum rate imposed by clk users.
@@ -55,6 +56,7 @@ struct dentry;
  *
  */
 struct clk_rate_request {
+       struct clk_core *core;
        unsigned long rate;
        unsigned long min_rate;
        unsigned long max_rate;