linux/drivers/hwmon/pmbus
Robert Hancock 18e8db7f65 hwmon: (pmbus) Add mutex locking for sysfs reads
As part of commit a919ba0697 ("hwmon: (pmbus) Stop caching register
values"), the update of the sensor value is now triggered directly by the
sensor attribute value being read from sysfs. This created (or at least
made much more likely) a locking issue, since nothing protected the device
page selection from being unexpectedly modified by concurrent reads. If
sensor values on different pages on the same device were being concurrently
read by multiple threads, this could cause spurious read errors due to the
page register not reading back the same value last written, or sensor
values being read from the incorrect page.

Add locking of the update_lock mutex in pmbus_show_sensor and
pmbus_show_samples so that these cannot result in concurrent reads from the
underlying device.

Fixes: a919ba0697 ("hwmon: (pmbus) Stop caching register values")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Reviewed-by: Alex Qiu <xqiu@google.com>
Link: https://lore.kernel.org/r/20201103193315.3011800-1-robert.hancock@calian.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2020-11-03 18:55:56 -08:00
..
adm1266.c hwmon: (pmbus/adm1266) read blackbox 2020-09-23 09:42:41 -07:00
adm1275.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
bel-pfe.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ibm-cffps.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
inspur-ipsps.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ir35221.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ir38064.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
irps5401.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
isl68137.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
Kconfig hwmon: (pmbus) Add support for MPS Multi-phase mp2975 controller 2020-10-04 08:40:10 -07:00
lm25066.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ltc2978.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ltc3815.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
Makefile hwmon: (pmbus) Add support for MPS Multi-phase mp2975 controller 2020-10-04 08:40:10 -07:00
max8688.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max16064.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max16601.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max20730.c hwmon: (pmbus/max20730) use scnprintf() instead of snprintf() 2020-10-26 08:00:32 -07:00
max20751.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max31785.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
max34440.c hwmon: (pmbus/max34440) Fix OC fault limits 2020-10-05 09:16:31 -07:00
mp2975.c hwmon: (pmbus) Add support for MPS Multi-phase mp2975 controller 2020-10-04 08:40:10 -07:00
pmbus_core.c hwmon: (pmbus) Add mutex locking for sysfs reads 2020-11-03 18:55:56 -08:00
pmbus.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
pmbus.h hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
pxe1610.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
tps40422.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
tps53679.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ucd9000.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
ucd9200.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
xdpe12284.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00
zl6100.c hwmon (pmbus) use simple i2c probe function 2020-09-23 09:42:39 -07:00