]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (pmbus) Add mutex to regulator ops
authorPatrick Rudolph <patrick.rudolph@9elements.com>
Fri, 25 Feb 2022 16:06:09 +0000 (17:06 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 28 Feb 2022 01:02:36 +0000 (17:02 -0800)
commit7b81da8cb1950a1d47a28868b5a4df10d30cdec6
tree025a1cc72bf9d0a670862c930e32d3fb4428cd98
parenta4bb3615af56325e357eba8358c36083800642a8
hwmon: (pmbus) Add mutex to regulator ops

On PMBUS devices with multiple pages, the regulator ops need to be
protected with the update mutex. This prevents accidentally changing
the page in a separate thread while operating on the PMBUS_OPERATION
register.

Tested on Infineon xdpe11280 while a separate thread polls for sensor
data.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Marcello Sylvester Bauer <sylv@sylv.io>
Link: https://lore.kernel.org/r/b991506bcbf665f7af185945f70bf9d5cf04637c.1645804976.git.sylv@sylv.io
Fixes: 0af86f52a65cb ("hwmon: (pmbus) Add regulator support")
Cc: Alan Tull <atull@opensource.altera.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c