linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] clk: ux500: add range to usleep_range
@ 2019-04-07  3:13 Nicholas Mc Guire
  2019-04-10 22:53 ` Stephen Boyd
  2019-04-11  9:36 ` Ulf Hansson
  0 siblings, 2 replies; 9+ messages in thread
From: Nicholas Mc Guire @ 2019-04-07  3:13 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Stephen Boyd, Michael Turquette, Nicholas Mc Guire, linux-kernel,
	linux-clk, linux-arm-kernel

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.

Signed-off-by: Nicholas Mc Guire <hofrat@opentech.at>
---

Problem located with an experimental coccinelle script                                       
                                                                                             
Q: Basically usleep_range() with min == max never makes much sense notably                      
   in non-atomic context. If the factor of 2 is tolerable or a fixed
   offset of e.g. 1000 would be more suitable is not clear to me - maybe
   someone familiar with that driver can clarify this.
                                                                                             
Patch was compile tested with: u8500_defconfig (implies COMMON_CLK=y)
(with some sparse warnings about not implemented system calls)                               
                                                                                             
Patch is against 5.1-rc3 (localversion-next is next=20190405)                                

 drivers/clk/ux500/clk-sysctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c
index 7c0403b..a1fa3fb 100644
--- a/drivers/clk/ux500/clk-sysctrl.c
+++ b/drivers/clk/ux500/clk-sysctrl.c
@@ -42,7 +42,7 @@ 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*2);
 
 	return ret;
 }
-- 
2.1.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-04-11 13:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-07  3:13 [PATCH RFC] clk: ux500: add range to usleep_range Nicholas Mc Guire
2019-04-10 22:53 ` Stephen Boyd
2019-04-11  2:56   ` Nicholas Mc Guire
2019-04-11 11:51     ` Joe Perches
2019-04-11 12:59       ` Nicholas Mc Guire
2019-04-11 13:12         ` Joe Perches
2019-04-11 13:53           ` Nicholas Mc Guire
2019-04-11  9:36 ` Ulf Hansson
2019-04-11 10:38   ` Nicholas Mc Guire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).