]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (da9052) Synchronize access with mfd
authorSamu Nuutamo <samu.nuutamo@vincit.fi>
Mon, 11 May 2020 11:02:19 +0000 (13:02 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 13 May 2020 17:06:09 +0000 (10:06 -0700)
commit80bf3891d458a7351e75d5a2a0c73a5e51262771
treec2265df6f21223ca9c3a9e968cb9300e42fd2e95
parentec639444fc37bdd61582e1d648d05f7eecf8bca4
hwmon: (da9052) Synchronize access with mfd

When tsi-as-adc is configured it is possible for in7[0123]_input read to
return an incorrect value if a concurrent read to in[456]_input is
performed. This is caused by a concurrent manipulation of the mux
channel without proper locking as hwmon and mfd use different locks for
synchronization.

Switch hwmon to use the same lock as mfd when accessing the TSI channel.

Fixes: c270f03070c67 ("hwmon: da9052: Add support for TSI channel")
Signed-off-by: Samu Nuutamo <samu.nuutamo@vincit.fi>
[rebase to current master, reword commit message slightly]
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/da9052-hwmon.c