All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: jean-baptiste.maneyrol@tdk.com
Cc: "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jean-Baptiste Maneyrol" <jmaneyrol@invensense.com>
Subject: Re: [PATCH 1/4] iio: imu: inv_icm42600: sleep before enabling FIFO data
Date: Fri, 21 Aug 2026 14:15:00 +0300	[thread overview]
Message-ID: <aogzNOaeOHQ732oP@ashevche-desk.local> (raw)
In-Reply-To: <20260820-inv-icm42600-enhacements-v1-1-075a881db557@tdk.com>

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



  parent reply	other threads:[~2026-08-21 11:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 19:02 [PATCH 0/4] inv_icm42600 driver enhancements Jean-Baptiste Maneyrol via B4 Relay
2026-08-20 19:02 ` Jean-Baptiste Maneyrol
2026-08-20 19:02 ` [PATCH 1/4] iio: imu: inv_icm42600: sleep before enabling FIFO data Jean-Baptiste Maneyrol via B4 Relay
2026-08-20 19:02   ` Jean-Baptiste Maneyrol
2026-08-21  0:06   ` Jonathan Cameron
2026-08-21 12:39     ` Jean-Baptiste Maneyrol
2026-08-21 11:15   ` Andy Shevchenko [this message]
2026-08-21 12:50     ` Jean-Baptiste Maneyrol
2026-08-21 13:21       ` Andy Shevchenko
2026-08-20 19:02 ` [PATCH 2/4] iio: imu: inv_icm42600: use 2 sensors fixed packet size of 16 bytes Jean-Baptiste Maneyrol via B4 Relay
2026-08-20 19:02   ` Jean-Baptiste Maneyrol
2026-08-21  0:09   ` Jonathan Cameron
2026-08-21 12:59     ` Jean-Baptiste Maneyrol
2026-08-20 19:02 ` [PATCH 3/4] iio: imu: inv_icm42600: simplify watermark computation by using gcd Jean-Baptiste Maneyrol via B4 Relay
2026-08-20 19:02   ` Jean-Baptiste Maneyrol
2026-08-21  0:14   ` Jonathan Cameron
2026-08-21 13:01     ` Jean-Baptiste Maneyrol
2026-08-20 19:02 ` [PATCH 4/4] iio: imu: inv_icm42600: do not read FIFO count for watermark it Jean-Baptiste Maneyrol via B4 Relay
2026-08-20 19:02   ` Jean-Baptiste Maneyrol
2026-08-21  0:28   ` Jonathan Cameron
2026-08-21 13:09     ` Jean-Baptiste Maneyrol
2026-08-23  1:13       ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aogzNOaeOHQ732oP@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jic23@kernel.org \
    --cc=jmaneyrol@invensense.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.