Commit f08601aa authored by William Breathitt Gray's avatar William Breathitt Gray Committed by sanglipeng
Browse files

iio: addac: stx104: Fix race condition when converting analog-to-digital

stable inclusion
from stable-v5.10.192
commit 436b4232533a8eb586f75179b391da17e18cdf1e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I933RF

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=436b4232533a8eb586f75179b391da17e18cdf1e



--------------------------------

[ Upstream commit 4f9b80ae ]

The ADC conversion procedure requires several device I/O operations
performed in a particular sequence. If stx104_read_raw() is called
concurrently, the ADC conversion procedure could be clobbered. Prevent
such a race condition by utilizing a mutex.

Fixes: 4075a283 ("iio: stx104: Add IIO support for the ADC channels")
Signed-off-by: default avatarWilliam Breathitt Gray <william.gray@linaro.org>
Link: https://lore.kernel.org/r/2ae5e40eed5006ca735e4c12181a9ff5ced65547.1680790580.git.william.gray@linaro.org


Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 9cbdbdf2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment