Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-20 Thread Thomas Gleixner
On Thu, 20 Oct 2016, Daniel Kurtz wrote: > On Wed, Oct 19, 2016 at 4:29 AM, Doug Anderson wrote: > > ...but I'm not sure I agree with you about what to do here. > > Specifically I think that whatever we do we need to try to keep > > schedule_hrtimeout_range() and

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-20 Thread Thomas Gleixner
On Thu, 20 Oct 2016, Daniel Kurtz wrote: > On Wed, Oct 19, 2016 at 4:29 AM, Doug Anderson wrote: > > ...but I'm not sure I agree with you about what to do here. > > Specifically I think that whatever we do we need to try to keep > > schedule_hrtimeout_range() and schedule_timeout() parallel. For

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-20 Thread Daniel Kurtz
On Wed, Oct 19, 2016 at 4:29 AM, Doug Anderson wrote: > > Dan, > > On Tue, Oct 18, 2016 at 6:44 AM, Daniel Kurtz wrote: > > Hi Doug, > > > > On Tue, Oct 11, 2016 at 5:04 AM, Douglas Anderson > > wrote: > >> Users of

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-20 Thread Daniel Kurtz
On Wed, Oct 19, 2016 at 4:29 AM, Doug Anderson wrote: > > Dan, > > On Tue, Oct 18, 2016 at 6:44 AM, Daniel Kurtz wrote: > > Hi Doug, > > > > On Tue, Oct 11, 2016 at 5:04 AM, Douglas Anderson > > wrote: > >> Users of usleep_range() expect that it will _never_ return in less time > >> than the

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-18 Thread Doug Anderson
Dan, On Tue, Oct 18, 2016 at 6:44 AM, Daniel Kurtz wrote: > Hi Doug, > > On Tue, Oct 11, 2016 at 5:04 AM, Douglas Anderson > wrote: >> Users of usleep_range() expect that it will _never_ return in less time >> than the minimum passed parameter.

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-18 Thread Doug Anderson
Dan, On Tue, Oct 18, 2016 at 6:44 AM, Daniel Kurtz wrote: > Hi Doug, > > On Tue, Oct 11, 2016 at 5:04 AM, 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

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-18 Thread Daniel Kurtz
Hi Doug, On Tue, Oct 11, 2016 at 5:04 AM, 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: > > usleep_range() =>

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-18 Thread Daniel Kurtz
Hi Doug, On Tue, Oct 11, 2016 at 5:04 AM, 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: > > usleep_range() => do_usleep_range() =>

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-12 Thread Doug Anderson
Hi, On Wed, Oct 12, 2016 at 6:11 AM, Thomas Gleixner wrote: > I'm well aware what Doug wants to do and I'm not saying that this is wrong, > but I'm not going to look at all usleep() usage sites to make sure none is > relying on such a behaviour and gets surprised by the

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-12 Thread Doug Anderson
Hi, On Wed, Oct 12, 2016 at 6:11 AM, Thomas Gleixner wrote: > I'm well aware what Doug wants to do and I'm not saying that this is wrong, > but I'm not going to look at all usleep() usage sites to make sure none is > relying on such a behaviour and gets surprised by the change, > > The point is

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-12 Thread Thomas Gleixner
On Tue, 11 Oct 2016, Andreas Mohr wrote: > On Tue, Oct 11, 2016 at 09:14:38AM +0200, Thomas Gleixner 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

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-12 Thread Thomas Gleixner
On Tue, 11 Oct 2016, Andreas Mohr wrote: > On Tue, Oct 11, 2016 at 09:14:38AM +0200, Thomas Gleixner 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

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-12 Thread Mark Brown
On Tue, Oct 11, 2016 at 09:33:15AM -0700, Doug Anderson wrote: > On Tue, Oct 11, 2016 at 12:14 AM, Thomas Gleixner 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

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-12 Thread Mark Brown
On Tue, Oct 11, 2016 at 09:33:15AM -0700, Doug Anderson wrote: > On Tue, Oct 11, 2016 at 12:14 AM, Thomas Gleixner 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.

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Andreas Mohr
On Tue, Oct 11, 2016 at 01:02:10PM -0700, Doug Anderson wrote: > Andreas, > > On Tue, Oct 11, 2016 at 12:30 PM, Andreas Mohr wrote: > > This loop implementation relies on negative kmin (result of ktime_sub()) > > getting internally handled by schedule_hrtimeout_range() as a 0

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Andreas Mohr
On Tue, Oct 11, 2016 at 01:02:10PM -0700, Doug Anderson wrote: > Andreas, > > On Tue, Oct 11, 2016 at 12:30 PM, Andreas Mohr wrote: > > This loop implementation relies on negative kmin (result of ktime_sub()) > > getting internally handled by schedule_hrtimeout_range() as a 0 result. > > If that

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Heiko Stuebner
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.

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Heiko Stuebner
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.

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Doug Anderson
Andreas, On Tue, Oct 11, 2016 at 12:30 PM, Andreas Mohr wrote: > Hi, > > decided to write a review now, slightly delayed, sorry. > > On Mon, Oct 10, 2016 at 02:04:02PM -0700, Douglas Anderson wrote: >> diff --git a/kernel/time/timer.c b/kernel/time/timer.c >> index

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Doug Anderson
Andreas, On Tue, Oct 11, 2016 at 12:30 PM, Andreas Mohr wrote: > Hi, > > decided to write a review now, slightly delayed, sorry. > > On Mon, Oct 10, 2016 at 02:04:02PM -0700, Douglas Anderson wrote: >> diff --git a/kernel/time/timer.c b/kernel/time/timer.c >> index 32bf6f75a8fe..219439efd56a

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Andreas Mohr
Hi, decided to write a review now, slightly delayed, sorry. On Mon, Oct 10, 2016 at 02:04:02PM -0700, Douglas Anderson wrote: > diff --git a/kernel/time/timer.c b/kernel/time/timer.c > index 32bf6f75a8fe..219439efd56a 100644 > --- a/kernel/time/timer.c > +++ b/kernel/time/timer.c > @@ -1898,12

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Andreas Mohr
Hi, decided to write a review now, slightly delayed, sorry. On Mon, Oct 10, 2016 at 02:04:02PM -0700, Douglas Anderson wrote: > diff --git a/kernel/time/timer.c b/kernel/time/timer.c > index 32bf6f75a8fe..219439efd56a 100644 > --- a/kernel/time/timer.c > +++ b/kernel/time/timer.c > @@ -1898,12

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Brian Norris
Hi Doug, On Mon, Oct 10, 2016 at 02:04:02PM -0700, Doug 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. Like you and Andreas, I also don't understand Thomas's

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Brian Norris
Hi Doug, On Mon, Oct 10, 2016 at 02:04:02PM -0700, Doug 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. Like you and Andreas, I also don't understand Thomas's

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Andreas Mohr
On Tue, Oct 11, 2016 at 09:14:38AM +0200, Thomas Gleixner 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: >

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Andreas Mohr
On Tue, Oct 11, 2016 at 09:14:38AM +0200, Thomas Gleixner 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: >

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Doug Anderson
Thomas, +clock and regulator folks since part of my arguments below involve the regulator / clock core. If you're not interested in this topic, feel free to ignore. Original patch can be found on LKML or at On Tue, Oct 11, 2016 at 12:14 AM, Thomas

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread Doug Anderson
Thomas, +clock and regulator folks since part of my arguments below involve the regulator / clock core. If you're not interested in this topic, feel free to ignore. Original patch can be found on LKML or at On Tue, Oct 11, 2016 at 12:14 AM, Thomas

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread 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

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-11 Thread 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

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-10 Thread Doug Anderson
Hi, On Mon, Oct 10, 2016 at 2:04 PM, 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: > > usleep_range() =>

Re: [PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-10 Thread Doug Anderson
Hi, On Mon, Oct 10, 2016 at 2:04 PM, 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: > > usleep_range() => do_usleep_range() =>

[PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-10 Thread Douglas Anderson
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: usleep_range() => do_usleep_range() => schedule_hrtimeout_range() => schedule_hrtimeout_range_clock() just ends up calling

[PATCH v2] timers: Fix usleep_range() in the context of wake_up_process()

2016-10-10 Thread Douglas Anderson
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: usleep_range() => do_usleep_range() => schedule_hrtimeout_range() => schedule_hrtimeout_range_clock() just ends up calling