Linux IIO development
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Francesco Lavra <flavra@baylibre.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
Subject: Re: [PATCH] iio: imu: st_lsm6dsx: Update enable mask when using sensor fusion
Date: Fri, 31 Jul 2026 22:44:44 +0200	[thread overview]
Message-ID: <am0JPMfepRUkMNfy@lore-qca> (raw)
In-Reply-To: <20260731174702.2665870-1-flavra@baylibre.com>

[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]

> The enable_mask struct member keeps track of which sensors are enabled in
> the IMU. When enabling and disabling the sensor fusion functionality, the
> driver does not properly update this struct member. This prevents a correct
> calculation of the number of samples that should be read from the hardware
> FIFO; as a result, reads from the FIFO can be unnecessarily split into
> multiple transactions, some of which can read past the FIFO length.

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> 
> Fixes: cd4e1141bff8 ("iio: imu: st_lsm6dsx: Add support for rotation sensor")
> Signed-off-by: Francesco Lavra <flavra@baylibre.com>
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c
> index 2e72c7ba94dd..5321033daebc 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_fusion.c
> @@ -112,6 +112,11 @@ int st_lsm6dsx_fusion_set_enable(struct st_lsm6dsx_sensor *sensor, bool enable)
>  		return err;
>  	}
>  
> +	if (enable)
> +		hw->enable_mask |= BIT(ST_LSM6DSX_ID_FUSION);
> +	else
> +		hw->enable_mask &= ~BIT(ST_LSM6DSX_ID_FUSION);
> +
>  	return st_lsm6dsx_fusion_page_disable(hw);
>  }
>  
> -- 
> 2.39.5
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2026-07-31 20:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 17:47 [PATCH] iio: imu: st_lsm6dsx: Update enable mask when using sensor fusion Francesco Lavra
2026-07-31 20:44 ` Lorenzo Bianconi [this message]

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=am0JPMfepRUkMNfy@lore-qca \
    --to=lorenzo@kernel.org \
    --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=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