From: Nicholas Mc Guire <hofrat@opentech.at>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org,
Nicholas Mc Guire <hofrat@opentech.at>
Subject: [PATCH V2] clk: ux500: add range to usleep_range
Date: Thu, 11 Apr 2019 13:04:11 +0200 [thread overview]
Message-ID: <1554980651-54136-1-git-send-email-hofrat@opentech.at> (raw)
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>
---
Problem located with an experimental coccinelle script
V2: As clarified by Ulf Hansson <ulf.hansson@linaro.org> the delays
here are typically in the millisecond range - so as proposed
replace the factor 2 by a 25% increase of max.
Patch was compile tested with: u8500_defconfig (implies COMMON_CLK=y)
(with some unrelated sparse warnings about not implemented system calls)
Patch is against 5.1-rc4 (localversion-next is next=20190410)
drivers/clk/ux500/clk-sysctrl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c
index 7c0403b..698306f 100644
--- a/drivers/clk/ux500/clk-sysctrl.c
+++ b/drivers/clk/ux500/clk-sysctrl.c
@@ -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;
}
--
2.1.4
next reply other threads:[~2019-04-11 11:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-11 11:04 Nicholas Mc Guire [this message]
2019-04-11 11:07 ` [PATCH V2] clk: ux500: add range to usleep_range Ulf Hansson
2019-04-11 18:47 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1554980651-54136-1-git-send-email-hofrat@opentech.at \
--to=hofrat@opentech.at \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).