From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FF203126B2 for ; Sun, 29 Mar 2026 13:18:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774790313; cv=none; b=kSpeV8BKBLzcipfuV403veZCMr9/BSP0BGwTvgmfw8sDUQHY/iYZ4lODkHESbPsxNoVzaK3EMSSYNQv+0BL329AIoJJQIiKayix/gi/a0KDhQmHpds6B2AshCa0tr5Hu0hFr4zlxvsexCsh4A16QFqMfXJHtemITr6b1vfgX0ZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774790313; c=relaxed/simple; bh=X39SFrRBImwW7cQ2KmPQJS0Oq4mdA+fFeevC6xVp358=; h=Subject:To:From:Date:Message-ID:MIME-Version:Content-Type; b=ixQfETcNxEi3gZLctl8ZAo8iL8IYULOAROKCMqoAfAiMfsTxEfnqyhnB7YHI3dX5SiiGy4jE1ZABljmz/pSYkH5zsqB4Kj2Pv5a4ToYluFtFUIs1aoUBlXJIBDriF5FKYuykzq4caIk/0RF+TPBGZL0GyqnMZpJCHIPgpavys6Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ySIgDRJx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ySIgDRJx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86540C116C6; Sun, 29 Mar 2026 13:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774790312; bh=X39SFrRBImwW7cQ2KmPQJS0Oq4mdA+fFeevC6xVp358=; h=Subject:To:From:Date:From; b=ySIgDRJxDXAZ0IPoI0nVH4qvtV3HDL3Pr8FBbQM21zbMwZs3qtA8SP2BicSuBPBxq UhRkEZqzTS8agIlSaFCaI+OQHPdxu7L71POtPoo8EKiS78Pxkcw46LAV5rcrmXcPFk sWZtmcyanyQU8ZsFPJ7gRx1VJ+T+5gITCM/qXQ0o= Subject: patch "iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope" added to char-misc-linus To: flavra@baylibre.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org From: Date: Sun, 29 Mar 2026 14:50:10 +0200 Message-ID: <2026032910-dander-regretful-4cb9@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit This is a note to let you know that I've just added the patch titled iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope to my char-misc git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git in the char-misc-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From 630748afa7030b272b7bee5df857e7bcf132ed51 Mon Sep 17 00:00:00 2001 From: Francesco Lavra Date: Wed, 25 Feb 2026 11:06:00 +0100 Subject: iio: imu: st_lsm6dsx: Set FIFO ODR for accelerometer and gyroscope only The st_lsm6dsx_set_fifo_odr() function, which is called when enabling and disabling the hardware FIFO, checks the contents of the hw->settings->batch array at index sensor->id, and then sets the current ODR value in sensor registers that depend on whether the register address is set in the above array element. This logic is valid for internal sensors only, i.e. the accelerometer and gyroscope; however, since commit c91c1c844ebd ("iio: imu: st_lsm6dsx: add i2c embedded controller support"), this function is called also when configuring the hardware FIFO for external sensors (i.e. sensors accessed through the sensor hub functionality), which can result in unrelated device registers being written. Add a check to the beginning of st_lsm6dsx_set_fifo_odr() so that it does not touch any registers unless it is called for internal sensors. Fixes: c91c1c844ebd ("iio: imu: st_lsm6dsx: add i2c embedded controller support") Signed-off-by: Francesco Lavra Cc: Signed-off-by: Jonathan Cameron --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c index 55d877745575..1ee2fc5f5f1f 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c @@ -225,6 +225,10 @@ static int st_lsm6dsx_set_fifo_odr(struct st_lsm6dsx_sensor *sensor, const struct st_lsm6dsx_reg *batch_reg; u8 data; + /* Only internal sensors have a FIFO ODR configuration register. */ + if (sensor->id >= ARRAY_SIZE(hw->settings->batch)) + return 0; + batch_reg = &hw->settings->batch[sensor->id]; if (batch_reg->addr) { int val; -- 2.53.0