[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161012085659.y74qnipuwdblkjjh@sirena.org.uk>
Date: Wed, 12 Oct 2016 10:56:59 +0200
From: Mark Brown <broonie@...nel.org>
To: Doug Anderson <dianders@...omium.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
John Stultz <john.stultz@...aro.org>,
Andreas Mohr <andi@...as.de>,
Brian Norris <briannorris@...omium.org>,
Tao Huang <huangtao@...k-chips.com>,
Tony Xie <tony.xie@...k-chips.com>,
"open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...eaurora.org>,
linux-clk <linux-clk@...r.kernel.org>
Subject: Re: [PATCH v2] timers: Fix usleep_range() in the context of
wake_up_process()
On Tue, Oct 11, 2016 at 09:33:15AM -0700, Doug Anderson wrote:
> On Tue, Oct 11, 2016 at 12:14 AM, Thomas Gleixner <tglx@...utronix.de> wrote:
> > On Mon, 10 Oct 2016, Douglas Anderson wrote:
> >> Users of usleep_range() expect that it will _never_ return in less time
> >> than the minimum passed parameter. However, nothing in any of the code
> >> ensures this. Specifically:
> > There is no such guarantee for that interface and never has been, so how
> > did you make sure that none of the existing users is relying on this?
> > You can't just can't just declare that all all of the users expect that and
> > be done with it.
> You're right that I can't guarantee that no callers are relying on the
> existing behavior of a wake_up_process() causing usleep_range() to
> return early. I would say, however, that all callers I've seen are
> absolutely relying on the min delay being enforced and I've never
> personally seen a caller relying on being woken up from
> usleep_range(). All the users relying on the min delay being enforced
Indeed. It's *highly* surprising for any sleep interface to undershoot
on delays, the usual thing is that they might delay for longer. If the
function doesn't actually reliably delay for the minimum time then I'd
expect that a large proportion of those conversions and other recent
code that's been added is buggy.
> one of two functions: usleep_atlest() and usleep_wakeable(). As
> argued below I think that usleep_range() name implies that it will at
> least sleep the minimum so I would really like to avoid keeping the
> name usleep_range() and also keeping the existing behavior.
I tend to agree with everything Doug is saying in terms of API
expectations.
Download attachment "signature.asc" of type "application/pgp-signature" (456 bytes)
Powered by blists - more mailing lists