FAILED: patch "[PATCH] iio: imu: st_lsm6dsx: flush hw FIFO before resetting the" failed to apply to 5.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3a63da26db0a864134f023f088d41deacd509997 Mon Sep 17 00:00:00 2001
From: Lorenzo Bianconi <[email protected]>
Date: Fri, 13 Mar 2020 19:06:00 +0100
Subject: [PATCH] iio: imu: st_lsm6dsx: flush hw FIFO before resetting the
device
flush hw FIFO before device reset in order to avoid possible races on interrupt line 1. If the first interrupt line is asserted during hw reset the device will work in I3C-only mode (if it is supported)
Fixes 801a6e0af0c6 ("iio: imu: st_lsm6dsx: add support to LSM6DSO")
Fixes 43901008fde0 ("iio: imu: st_lsm6dsx: add support to LSM6DSR")
Reported-by Mario Tesi <[email protected]>
Signed-off-by Lorenzo Bianconi <[email protected]>
Reviewed-by Vitor Soares <[email protected]>
Tested-by Vitor Soares <[email protected]>
Cc <[email protected]>
Signed-off-by Jonathan Cameron <[email protected]>
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +23 -1
@@ -2036,11 +2036,21 @@ static int st_lsm6dsx_init_hw_timer(struct st_lsm6dsx_hw *hw)return 0 ; } -static int st_lsm6dsx_init_device (struct st_lsm6dsx_hw *hw) +static int st_lsm6dsx_reset_device (struct st_lsm6dsx_hw *hw) {const struct st_lsm6dsx_reg *reg;int err; +/* +* flush hw FIFO before device reset in order to avoid +* possible races on interrupt line 1. If the first interrupt +* line is asserted during hw reset the device will work in +* I3C-only mode (if it is supported) +*/ + err =st_lsm6dsx_flush_fifo (hw); +if (err <0 && err != -ENOTSUPP ) +return err; +/* device sw reset */ reg = &hw->settings->reset; err = regmap_update_bits(hw->regmap, reg->addr, reg->mask,
@@ -2059,6 +2069,18 @@ static int st_lsm6dsx_init_device(struct st_lsm6dsx_hw *hw)msleep (50 ); +return 0 ; +} + +static int st_lsm6dsx_init_device (struct st_lsm6dsx_hw *hw) +{ +const struct st_lsm6dsx_reg *reg; +int err; + + err =st_lsm6dsx_reset_device (hw); +if (err <0 ) +return err; +/* enable Block Data Update */ reg = &hw->settings->bdu; err = regmap_update_bits(hw->regmap, reg->addr, reg->mask,