summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2019-10-06 15:22:02 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2019-10-15 21:11:05 +0100
commitd278d4479402d9cd653bfa5714399410f4196445 (patch)
treef62e2cfd2a7ebf05bb855d11ad82968b1027bd1d
parent04ca37d5ade99aaf49b662da8142926c981d154f (diff)
iio: imu: st_lsm6dsx: grab conf mutex in st_lsm6dsx_write_event_config
Always grub conf mutex in st_lsm6dsx_write_event_config since it can run concurrently with FIFO configuration Fixes: b5969abfa8b8 ("iio: imu: st_lsm6dsx: add motion events") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
index a6d5a9ea7806..0d5054a5105e 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
@@ -1619,7 +1619,9 @@ static int st_lsm6dsx_write_event_config(struct iio_dev *iio_dev,
if (err < 0)
return err;
+ mutex_lock(&hw->conf_lock);
err = st_lsm6dsx_sensor_set_enable(sensor, state);
+ mutex_unlock(&hw->conf_lock);
if (err < 0)
return err;