]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (occ) Fix poll rate limiting
authorEddie James <eajames@linux.ibm.com>
Thu, 29 Apr 2021 15:13:36 +0000 (10:13 -0500)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 10 May 2021 13:27:33 +0000 (06:27 -0700)
commitb62b5519ca59d6078a580256c5cc30299bd22d7e
tree63c697a13879a0afdba14e6adb937bd90aef82bd
parente197f6b45e91e5c614258f9f66da0311503174ef
hwmon: (occ) Fix poll rate limiting

The poll rate limiter time was initialized at zero. This breaks the
comparison in time_after if jiffies is large. Switch to storing the
next update time rather than the previous time, and initialize the
time when the device is probed.

Fixes: a36e2e2d9fa8 ("hwmon (occ): Add sensor types and versions")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Link: https://lore.kernel.org/r/20210429151336.18980-1-eajames@linux.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/occ/common.c
drivers/hwmon/occ/common.h