From: Mark Brown <broonie@kernel.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>,
Lee Jones <lee.jones@linaro.org>,
Brian Norris <briannorris@chromium.org>,
"open list:ARM/Rockchip SoC..."
<linux-rockchip@lists.infradead.org>,
Heiko Stuebner <heiko@sntech.de>,
Liam Girdwood <lgirdwood@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regulator: pwm: Fix regulator ramp delay for continuous mode
Date: Tue, 28 Jun 2016 20:53:37 +0100 [thread overview]
Message-ID: <20160628195337.GC17217@sirena.org.uk> (raw)
In-Reply-To: <CAD=FV=UNMhDYy3r+4a4FF8Ndwt+qNuV7_pOC=kzoaUxLfYYp4Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1400 bytes --]
On Tue, Jun 28, 2016 at 12:31:19PM -0700, Doug Anderson wrote:
> In all seriousness, I think the design for usleep_range() is to try to
> batch up wakeups to allow longer periods of sleeping and to optimize
> power. This you want to sleep as long as is allowable and then if you
> happen to wakeup for some other reason anyway then you process all the
> things whose minimum has passed. IIRC it was trying to get back to
> the good old days of only having jiffies where everyone was
> synchronized on the tick and you could sleep till the next tick after
> all the work was done. When you think of it this way then sleeping to
> the max makes sense. ...but it also means that you need to be careful
> and really not set the max too high.
That's what I *thought* it was doing, but when I looked at the
implementation down to the hrtimer level it was explicitly saying it was
actively trying to deliver the maximum delay but might do less. I'd
have expected that the implementation would check to see if there was a
wakeup scheduled in the range, piggybacking on the first one if so, and
if there was nothing it'd go for the minimum (perhaps with a bit of
rounding). Oh well.
> Of course, in practice I've found that often usleep_range() 99% of the
> time sleeps for the max. That can lead to some very subtle bugs if
> your min sleep is not long enough (!).
Yup.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-06-28 19:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-28 4:53 Douglas Anderson
2016-06-28 10:32 ` Caesar Wang
2016-06-28 16:07 ` Brian Norris
2016-06-28 18:52 ` Mark Brown
2016-06-28 19:31 ` Doug Anderson
2016-06-28 19:53 ` Mark Brown [this message]
2016-06-28 18:56 ` Mark Brown
2016-06-28 19:35 ` Doug Anderson
2016-07-01 8:06 ` Mark Brown
2016-07-01 20:17 ` Doug Anderson
2016-07-02 7:59 ` Mark Brown
2016-07-06 18:30 ` Doug Anderson
2016-07-07 8:17 ` Mark Brown
2016-07-02 15:47 ` Boris Brezillon
2016-07-04 8:53 ` Mark Brown
2016-07-04 9:05 ` Boris Brezillon
2016-07-04 9:13 ` Mark Brown
2016-07-08 16:41 ` Thierry Reding
2016-07-06 12:27 ` Boris Brezillon
2016-07-06 18:31 ` Doug Anderson
2016-07-07 8:16 ` Mark Brown
2016-07-07 8:03 ` Mark Brown
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=20160628195337.GC17217@sirena.org.uk \
--to=broonie@kernel.org \
--cc=boris.brezillon@free-electrons.com \
--cc=briannorris@chromium.org \
--cc=dianders@chromium.org \
--cc=heiko@sntech.de \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.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
Powered by JetHome