Commit ea67b26e3fb063aa59584b113f3d7ea71a0db856

Authored by Lokesh Vutla
1 parent 713a02a2ce

clk: sci-clk: add slack to clk-set-rate passed to firmware

Add slack to the clock frequency parameters passed to firmware within
clk_set_rate. min-freq is changed to 0 and max-rate is changed to
ULONG_MAX. This fixes certain issues with pll clock rounding when the
firmware is not able to set the frequency exactly to the target, the
current implementation fails if the available frequency is even 1Hz off
the target. With the change, the firmware still tries its best to set
the frequency as close as possible to the target.

Reported-by: Vishal Mahaveer <vishalm@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

drivers/clk/clk-ti-sci.c
... ... @@ -106,8 +106,7 @@
106 106 k3_avs_notify_freq(clk->id, clk->data, rate);
107 107 #endif
108 108  
109   - /* Ask for exact frequency by using same value for min/target/max */
110   - ret = cops->set_freq(sci, clk->id, clk->data, rate, rate, rate);
  109 + ret = cops->set_freq(sci, clk->id, clk->data, 0, rate, ULONG_MAX);
111 110 if (ret)
112 111 dev_err(clk->dev, "%s: set_freq failed (%d)\n", __func__, ret);
113 112