]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
commita919ba06979a7858dab65492eb580121ccbd524f
treed1fce58cd4dc51039c471a66762ae0ec4faf4e3c
parent8999eabf332acf13455f33006ea8678398b8c95e
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