Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-12-03 Thread Aniroop Mathur
On Sat, Dec 3, 2016 at 2:30 PM, Jonathan Cameron wrote: > On 02/12/16 19:07, Aniroop Mathur wrote: >> On Wed, Nov 30, 2016 at 8:13 PM, Aniroop Mathur wrote: >>> On 30 Nov 2016 19:05, "Lars-Peter Clausen" wrote: >>> > >>> > On 11/27/2016

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-12-03 Thread Aniroop Mathur
On Sat, Dec 3, 2016 at 2:30 PM, Jonathan Cameron wrote: > On 02/12/16 19:07, Aniroop Mathur wrote: >> On Wed, Nov 30, 2016 at 8:13 PM, Aniroop Mathur wrote: >>> On 30 Nov 2016 19:05, "Lars-Peter Clausen" wrote: >>> > >>> > On 11/27/2016 11:51 AM, Jonathan Cameron wrote: >>> > > On 26/11/16

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-12-03 Thread Jonathan Cameron
On 02/12/16 19:07, Aniroop Mathur wrote: > On Wed, Nov 30, 2016 at 8:13 PM, Aniroop Mathur wrote: >> On 30 Nov 2016 19:05, "Lars-Peter Clausen" wrote: >> > >> > On 11/27/2016 11:51 AM, Jonathan Cameron wrote: >> > > On 26/11/16 03:47, Aniroop Mathur

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-12-03 Thread Jonathan Cameron
On 02/12/16 19:07, Aniroop Mathur wrote: > On Wed, Nov 30, 2016 at 8:13 PM, Aniroop Mathur wrote: >> On 30 Nov 2016 19:05, "Lars-Peter Clausen" wrote: >> > >> > On 11/27/2016 11:51 AM, Jonathan Cameron wrote: >> > > On 26/11/16 03:47, Aniroop Mathur wrote: >> > >> msleep(1~20) may not do

Re: Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-12-02 Thread Aniroop Mathur
On Wed, Nov 30, 2016 at 8:13 PM, Aniroop Mathur wrote: > On 30 Nov 2016 19:05, "Lars-Peter Clausen" wrote: > > > > On 11/27/2016 11:51 AM, Jonathan Cameron wrote: > > > On 26/11/16 03:47, Aniroop Mathur wrote: > > >> msleep(1~20) may not do what the

Re: Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-12-02 Thread Aniroop Mathur
On Wed, Nov 30, 2016 at 8:13 PM, Aniroop Mathur wrote: > On 30 Nov 2016 19:05, "Lars-Peter Clausen" wrote: > > > > On 11/27/2016 11:51 AM, Jonathan Cameron wrote: > > > On 26/11/16 03:47, Aniroop Mathur wrote: > > >> msleep(1~20) may not do what the caller intends, and will often sleep >

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-12-02 Thread Aniroop Mathur
On Wed, Nov 30, 2016 at 5:49 PM, Linus Walleij wrote: > On Sun, Nov 27, 2016 at 11:51 AM, Jonathan Cameron wrote: >> On 26/11/16 03:47, Aniroop Mathur wrote: > > [bmp280.c] > >>> /* Wait to make sure we started up properly */ >>> -

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-12-02 Thread Aniroop Mathur
On Wed, Nov 30, 2016 at 5:49 PM, Linus Walleij wrote: > On Sun, Nov 27, 2016 at 11:51 AM, Jonathan Cameron wrote: >> On 26/11/16 03:47, Aniroop Mathur wrote: > > [bmp280.c] > >>> /* Wait to make sure we started up properly */ >>> - mdelay(data->start_up_time); >>> +

RE: Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-30 Thread Aniroop Mathur
On 30 Nov 2016 19:05, "Lars-Peter Clausen" wrote: > > On 11/27/2016 11:51 AM, Jonathan Cameron wrote: > > On 26/11/16 03:47, Aniroop Mathur wrote: > >> msleep(1~20) may not do what the caller intends, and will often sleep > >> longer. > >> (~20 ms actual sleep for any

RE: Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-30 Thread Aniroop Mathur
On 30 Nov 2016 19:05, "Lars-Peter Clausen" wrote: > > On 11/27/2016 11:51 AM, Jonathan Cameron wrote: > > On 26/11/16 03:47, Aniroop Mathur wrote: > >> msleep(1~20) may not do what the caller intends, and will often sleep > >> longer. > >> (~20 ms actual sleep for any value given in the

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-30 Thread Lars-Peter Clausen
On 11/27/2016 11:51 AM, Jonathan Cameron wrote: > On 26/11/16 03:47, Aniroop Mathur wrote: >> msleep(1~20) may not do what the caller intends, and will often sleep longer. >> (~20 ms actual sleep for any value given in the 1~20ms range) >> This is not the desired behaviour for many cases like

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-30 Thread Lars-Peter Clausen
On 11/27/2016 11:51 AM, Jonathan Cameron wrote: > On 26/11/16 03:47, Aniroop Mathur wrote: >> msleep(1~20) may not do what the caller intends, and will often sleep longer. >> (~20 ms actual sleep for any value given in the 1~20ms range) >> This is not the desired behaviour for many cases like

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-30 Thread Linus Walleij
On Sun, Nov 27, 2016 at 11:51 AM, Jonathan Cameron wrote: > On 26/11/16 03:47, Aniroop Mathur wrote: [bmp280.c] >> /* Wait to make sure we started up properly */ >> - mdelay(data->start_up_time); >> + usleep_range(data->start_up_time, data->start_up_time + 100);

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-30 Thread Linus Walleij
On Sun, Nov 27, 2016 at 11:51 AM, Jonathan Cameron wrote: > On 26/11/16 03:47, Aniroop Mathur wrote: [bmp280.c] >> /* Wait to make sure we started up properly */ >> - mdelay(data->start_up_time); >> + usleep_range(data->start_up_time, data->start_up_time + 100); > > As this in

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-27 Thread Jonathan Cameron
On 26/11/16 03:47, Aniroop Mathur wrote: > msleep(1~20) may not do what the caller intends, and will often sleep longer. > (~20 ms actual sleep for any value given in the 1~20ms range) > This is not the desired behaviour for many cases like device resume time, > device suspend time, device enable

Re: [PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-27 Thread Jonathan Cameron
On 26/11/16 03:47, Aniroop Mathur wrote: > msleep(1~20) may not do what the caller intends, and will often sleep longer. > (~20 ms actual sleep for any value given in the 1~20ms range) > This is not the desired behaviour for many cases like device resume time, > device suspend time, device enable

[PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-25 Thread Aniroop Mathur
msleep(1~20) may not do what the caller intends, and will often sleep longer. (~20 ms actual sleep for any value given in the 1~20ms range) This is not the desired behaviour for many cases like device resume time, device suspend time, device enable time, data reading time, etc. Thus, change msleep

[PATCH] IIO: Change msleep to usleep_range for small msecs

2016-11-25 Thread Aniroop Mathur
msleep(1~20) may not do what the caller intends, and will often sleep longer. (~20 ms actual sleep for any value given in the 1~20ms range) This is not the desired behaviour for many cases like device resume time, device suspend time, device enable time, data reading time, etc. Thus, change msleep