]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clk: ux500: add range to usleep_range
authorNicholas Mc Guire <hofrat@opentech.at>
Thu, 11 Apr 2019 11:04:11 +0000 (13:04 +0200)
committerStephen Boyd <sboyd@kernel.org>
Thu, 11 Apr 2019 18:47:50 +0000 (11:47 -0700)
Providing a range for usleep_range() allows the hrtimer subsystem to
coalesce timers - the delay is runtime configurable so a factor 2
is taken to provide the range. With the expected range for
enable_delay_us being milliseconds, the range should lie in the 250us
range which is sufficient for hrtimer optimization.

Signed-off-by: Nicholas Mc Guire <hofrat@opentech.at>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/ux500/clk-sysctrl.c

index 7c0403b733ae4c5b236b58f3ea440cf0a2204a1c..698306f4801fc52cc400461c7414cc5f80db2701 100644 (file)
@@ -42,7 +42,8 @@ static int clk_sysctrl_prepare(struct clk_hw *hw)
                                clk->reg_bits[0]);
 
        if (!ret && clk->enable_delay_us)
-               usleep_range(clk->enable_delay_us, clk->enable_delay_us);
+               usleep_range(clk->enable_delay_us, clk->enable_delay_us +
+                            (clk->enable_delay_us >> 2));
 
        return ret;
 }