mx6qsabresd hangs on linux-next
Fabio Estevam
festevam at gmail.com
Tue May 6 08:49:13 PDT 2014
On Tue, May 6, 2014 at 12:36 PM, Fabio Estevam <festevam at gmail.com> wrote:
> Indeed, if I revert:
>
> commit e7489693b3a853ab6dfad52f7e6af553ae8d3f28
> Author: Maxime COQUELIN <maxime.coquelin at st.com>
> Date: Wed Jan 29 17:24:08 2014 +0100
>
> clk: divider: Optimize clk_divider_bestdiv loop
>
> Currently, the for-loop used to try all the different dividers to find the
> one that best fit tries all the values from 1 to max_div,
> incrementing by one.
> In case of power-of-two, or table based divider, the loop isn't optimal.
>
> Instead of incrementing by one, this patch provides directly the
> next divider.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin at st.com>
> Signed-off-by: Mike Turquette <mturquette at linaro.org>
>
> Then the board does not hang.
Isn't the increment of i missing?
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -279,7 +279,7 @@ static int clk_divider_bestdiv(struct clk_hw *hw,
unsigned long rate,
*/
maxdiv = min(ULONG_MAX / rate, maxdiv);
- for (i = 1; i <= maxdiv; i = _next_div(divider, i)) {
+ for (i = 1; i <= maxdiv; i +=_next_div(divider, i)) {
if (!_is_valid_div(divider, i))
continue;
if (rate * i == parent_rate_saved) {
More information about the linux-arm-kernel
mailing list