Re: [PATCH 1/4] iio: imu: inv_icm42600: sleep before enabling FIFO data

From: Andy Shevchenko

Date: Fri Aug 21 2026 - 07:15:12 EST


On Thu, Aug 20, 2026 at 09:02:37PM +0200, Jean-Baptiste Maneyrol via B4 Relay wrote:

> When turning accel or gyro on, a sleep is required for letting the
> mechanical part stabilize before reporting correct data. Do the sleep
> before enabling FIFO data to prevent push of incorrect data. This is
> required if the FIFO is already on because a sensor is already running.

...

> + /* sleep maximum required time */
> + sleep = max(sleep_accel, sleep_temp);
> + if (sleep) {
> + mutex_unlock(&st->lock);
> + msleep(sleep);
> + mutex_lock(&st->lock);
> + }

Doesn't sounds correct. Here it breaks the atomicity. Is it a problem?
(Imagine a few CPUs doing something with this driver, is any other thread may
intervene the flow here?)

...

> + /* sleep maximum required time */
> + sleep = max(sleep_gyro, sleep_temp);
> + if (sleep) {
> + mutex_unlock(&st->lock);
> + msleep(sleep);
> + mutex_lock(&st->lock);
> + }

Ditto.

--
With Best Regards,
Andy Shevchenko