Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v3] iio: accel: adxl355: replace usleep_range() with fsleep()
@ 2026-05-10 11:38 Stepan Ionichev
  2026-05-11  7:27 ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Stepan Ionichev @ 2026-05-10 11:38 UTC (permalink / raw)
  To: jic23
  Cc: lars, Michael.Hennerich, puranjay, dlechner, nuno.sa, andy,
	linux-iio, linux-kernel, sozdayvek

The "at least 5ms" wait after software reset has no specific upper
bound. Use fsleep() with 5 * USEC_PER_MSEC to make the unit
explicit at the call site.

No functional change.

Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
---
v3:
- Add this changelog (was missing in v2)

v2:
- Use 5 * USEC_PER_MSEC instead of raw 5000

 drivers/iio/accel/adxl355_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/adxl355_core.c b/drivers/iio/accel/adxl355_core.c
index 8f90c58f4..9d4421653 100644
--- a/drivers/iio/accel/adxl355_core.c
+++ b/drivers/iio/accel/adxl355_core.c
@@ -351,7 +351,7 @@ static int adxl355_setup(struct adxl355_data *data)
 			return ret;
 
 		/* Wait at least 5ms after software reset */
-		usleep_range(5000, 10000);
+		fsleep(5 * USEC_PER_MSEC);
 
 		/* Read shadow registers for comparison */
 		ret = regmap_bulk_read(data->regmap,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] iio: accel: adxl355: replace usleep_range() with fsleep()
  2026-05-10 11:38 [PATCH v3] iio: accel: adxl355: replace usleep_range() with fsleep() Stepan Ionichev
@ 2026-05-11  7:27 ` Andy Shevchenko
  2026-05-11 16:13   ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2026-05-11  7:27 UTC (permalink / raw)
  To: Stepan Ionichev
  Cc: jic23, lars, Michael.Hennerich, puranjay, dlechner, nuno.sa, andy,
	linux-iio, linux-kernel

On Sun, May 10, 2026 at 04:38:52PM +0500, Stepan Ionichev wrote:
> The "at least 5ms" wait after software reset has no specific upper
> bound. Use fsleep() with 5 * USEC_PER_MSEC to make the unit
> explicit at the call site.

> No functional change.

Strictly speaking the upper limit is not set as 10 milliseconds now,
but defined by the internals of fsleep(), usually +25%.

Perhaps Jonathan can just drop this sentence from the commit message
whilst applying.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] iio: accel: adxl355: replace usleep_range() with fsleep()
  2026-05-11  7:27 ` Andy Shevchenko
@ 2026-05-11 16:13   ` Jonathan Cameron
  2026-05-12  7:32     ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2026-05-11 16:13 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Stepan Ionichev, lars, Michael.Hennerich, puranjay, dlechner,
	nuno.sa, andy, linux-iio, linux-kernel

On Mon, 11 May 2026 10:27:40 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Sun, May 10, 2026 at 04:38:52PM +0500, Stepan Ionichev wrote:
> > The "at least 5ms" wait after software reset has no specific upper
> > bound. Use fsleep() with 5 * USEC_PER_MSEC to make the unit
> > explicit at the call site.  
> 
> > No functional change.  
> 
> Strictly speaking the upper limit is not set as 10 milliseconds now,
> but defined by the internals of fsleep(), usually +25%.

I'm not following.  There doesn't seem to be a statement of anything
about the upper limit that is used - just one on it not being specified
for the part.

> 
> Perhaps Jonathan can just drop this sentence from the commit message
> whilst applying.
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> 
Given I didn't really get the comment - applied as is.

J


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] iio: accel: adxl355: replace usleep_range() with fsleep()
  2026-05-11 16:13   ` Jonathan Cameron
@ 2026-05-12  7:32     ` Andy Shevchenko
  2026-05-12 11:26       ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2026-05-12  7:32 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Stepan Ionichev, lars, Michael.Hennerich, puranjay, dlechner,
	nuno.sa, andy, linux-iio, linux-kernel

On Mon, May 11, 2026 at 05:13:31PM +0100, Jonathan Cameron wrote:
> On Mon, 11 May 2026 10:27:40 +0300
> Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> > On Sun, May 10, 2026 at 04:38:52PM +0500, Stepan Ionichev wrote:

...

> > > No functional change.  
> > 
> > Strictly speaking the upper limit is not set as 10 milliseconds now,
> > but defined by the internals of fsleep(), usually +25%.
> 
> I'm not following.  There doesn't seem to be a statement of anything
> about the upper limit that is used - just one on it not being specified
> for the part.

I meant that switching from usleep_range() with explicit high limit is
different to implicit fsleep(). And that's a (subtle) functional change.
Hence "No functional change" is not fully true. Hope now it's clearer.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3] iio: accel: adxl355: replace usleep_range() with fsleep()
  2026-05-12  7:32     ` Andy Shevchenko
@ 2026-05-12 11:26       ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2026-05-12 11:26 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Stepan Ionichev, lars, Michael.Hennerich, puranjay, dlechner,
	nuno.sa, andy, linux-iio, linux-kernel

On Tue, 12 May 2026 10:32:23 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Mon, May 11, 2026 at 05:13:31PM +0100, Jonathan Cameron wrote:
> > On Mon, 11 May 2026 10:27:40 +0300
> > Andy Shevchenko <andriy.shevchenko@intel.com> wrote:  
> > > On Sun, May 10, 2026 at 04:38:52PM +0500, Stepan Ionichev wrote:  
> 
> ...
> 
> > > > No functional change.    
> > > 
> > > Strictly speaking the upper limit is not set as 10 milliseconds now,
> > > but defined by the internals of fsleep(), usually +25%.  
> > 
> > I'm not following.  There doesn't seem to be a statement of anything
> > about the upper limit that is used - just one on it not being specified
> > for the part.  
> 
> I meant that switching from usleep_range() with explicit high limit is
> different to implicit fsleep(). And that's a (subtle) functional change.
> Hence "No functional change" is not fully true. Hope now it's clearer.
Ah. Got you.  Thanks for talking me through it!

Jonathan

> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-05-12 11:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10 11:38 [PATCH v3] iio: accel: adxl355: replace usleep_range() with fsleep() Stepan Ionichev
2026-05-11  7:27 ` Andy Shevchenko
2026-05-11 16:13   ` Jonathan Cameron
2026-05-12  7:32     ` Andy Shevchenko
2026-05-12 11:26       ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox