Skip to content

Commit

Permalink
clk: Store clk_core for clk_rate_request
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Stephen Boyd <[email protected]>
  • Loading branch information
mripard authored and bebarino committed Dec 7, 2022
1 parent 9abf231 commit ef13f8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions include/linux/clk-provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down

0 comments on commit ef13f8b

Please sign in to comment.