Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()
From: Heiko Stuebner
Date: Tue Oct 11 2016 - 16:35:58 EST
Am Dienstag, 11. Oktober 2016, 09:14:38 CEST schrieb Thomas Gleixner:
> 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.
It may be my personal ignorance for not finding this explained, but the
function documentation [0] states "min ... Minimum time in usecs to sleep"
which sounds pretty guaranteed to me.
One should of course make sure to not break anything intentionally, but having
things expect to work outside these parameters sounds somewhat broken
If the specified values are flexible beyond their stated range, I guess the
documentation should be updated to reflect that.
[0] https://www.kernel.org/doc/htmldocs/device-drivers/API-usleep-range.html