hwmon: (sch5627) Use regmap for pwm map register caching
authorArmin Wolf <W_Armin@gmx.de>
Thu, 7 Sep 2023 05:26:37 +0000 (07:26 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 27 Oct 2023 14:27:24 +0000 (07:27 -0700)
commita54fe61639d9f3b6765fee32edda7cfceb6d705a
tree9709cc7d9bec857e1cfdfc4f1a422ce0906078c0
parent7da8a635436029957c5350da3acf51d78ed64071
hwmon: (sch5627) Use regmap for pwm map register caching

Accessing virtual registers is very inefficient, so pwm map values
should be cached when possible, else userspace could effectively do
a DOS attack by reading pwm map values in a while loop.
Use the regmap cache to cache those values.

Tested on a Fujitsu Esprimo P720.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20230907052639.16491-4-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/Kconfig
drivers/hwmon/sch5627.c
drivers/hwmon/sch56xx-common.c
drivers/hwmon/sch56xx-common.h