]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (pmbus) Stop caching register values
authorGuenter Roeck <linux@roeck-us.net>
Fri, 4 Sep 2020 16:33:14 +0000 (09:33 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 23 Sep 2020 16:42:41 +0000 (09:42 -0700)
commit559a11c267da84d072f36c3d5ddab25ffddcf447
treed1fce58cd4dc51039c471a66762ae0ec4faf4e3c
parent7fd6e6871ce92d29dabd8ed0ef832f616cc9cf96
hwmon: (pmbus) Stop caching register values

Caching register values can be very expensive for PMBus chips. Some
modern chips may have 10 or more pages, with several sensors supported
per page. For example, MAX16601 creates more than 90 sysfs attributes.
Register caching for such chips is time consuming, especially if only a
few attributes are read on a regular basis. For MAX16601, it was observed
that it can take up to two seconds to read all attributes on a slow I2C
bus. In this situation, register caching results in the opposite of its
intention: It increases the number of I2C operations, in some cases
substantially, and it results in large latency when trying to access
individual sensor data.

Drop all register caching to solve the problem. Since it is no longer
necessary, drop status register mapping as part of the change, and specify
status registers directly.

Cc: Alex Qiu <xqiu@google.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Alex Qiu <xqiu@google.com>
Tested-by: Alex Qiu <xqiu@google.com>
Link: https://lore.kernel.org/r/20200904163314.259087-1-linux@roeck-us.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c