mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Francesco Lavra <flavra@baylibre.com>
Cc: "Lorenzo Bianconi" <lorenzo@kernel.org>,
	"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
Subject: Re: [PATCH v9 1/6] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO
Date: Tue, 24 Mar 2026 14:17:11 +0200	[thread overview]
Message-ID: <acKAx34s1MStfy3G@ashevche-desk.local> (raw)
In-Reply-To: <20260324084733.653906-1-flavra@baylibre.com>

On Tue, Mar 24, 2026 at 09:47:33AM +0100, Francesco Lavra wrote:
> The DRDY_MASK feature implemented in sensor chips marks gyroscope and
> accelerometer invalid samples (i.e. samples that have been acquired during
> the settling time of sensor filters) with the special values 0x7FFFh,
> 0x7FFE, and 0x7FFD.
> The driver checks FIFO samples against these special values in order to
> discard invalid samples; however, it does the check regardless of the type
> of samples being processed, whereas this feature is specific to gyroscope
> and accelerometer data. This could cause valid samples to be discarded.
> 
> Fix the above check so that it takes into account the type of samples being
> processed. To avoid casting to __le16 * when checking sample values, clean
> up the type representation for data read from the FIFO.

...

>  static int
>  st_lsm6dsx_push_tagged_data(struct st_lsm6dsx_hw *hw, u8 tag,
> -			    u8 *data, s64 ts)
> +			    __le16 *data, s64 ts)

Dunno why this indentation, but if you need to send a new version, consider

static int st_lsm6dsx_push_tagged_data(struct st_lsm6dsx_hw *hw, u8 tag,
				       __le16 *data, s64 ts)

OR

static int
st_lsm6dsx_push_tagged_data(struct st_lsm6dsx_hw *hw, u8 tag, __le16 *data, s64 ts)

(yes, the second one goes to 83 characters).

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-24 12:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  8:46 [PATCH v9 0/6] imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-03-24  8:47 ` [PATCH v9 1/6] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO Francesco Lavra
2026-03-24 12:17   ` Andy Shevchenko [this message]
2026-03-25 19:55     ` Jonathan Cameron
2026-03-24  8:47 ` [PATCH v9 2/6] iio: Replace 'sign' field with union in struct iio_scan_type Francesco Lavra
2026-03-24  8:47 ` [PATCH v9 3/6] iio: tools: Add support for floating-point types in buffer scan elements Francesco Lavra
2026-03-24  8:47 ` [PATCH v9 4/6] iio: ABI: Add support for floating-point numbers " Francesco Lavra
2026-03-24  8:47 ` [PATCH v9 5/6] iio: ABI: Add quaternion axis modifier Francesco Lavra
2026-03-24  8:48 ` [PATCH v9 6/6] iio: imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-03-25 14:55   ` Jonathan Cameron
2026-03-25 20:08     ` Jonathan Cameron
2026-03-25 19:20   ` kernel test robot
2026-03-25 20:25   ` kernel test robot
2026-03-25 21:52   ` kernel test robot
2026-04-12 15:29 ` [PATCH v9 0/6] " 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=acKAx34s1MStfy3G@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=flavra@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome