hwmon: (amd_energy) optimize accumulation interval
authorNaveen Krishna Chatradhi <nchatrad@amd.com>
Tue, 29 Sep 2020 10:53:20 +0000 (16:23 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 30 Sep 2020 05:06:39 +0000 (22:06 -0700)
commit514db2b445df79e0a2f040842969cf58088a3886
treee93d5993d2a2e6f35c14278a06c96e67326f9c55
parent6b0c0c83dc55dc2484b1d5cbf32631262ae86284
hwmon: (amd_energy) optimize accumulation interval

On a system with course grain resolution of energy unit (milli J) the
accumulation thread can be executed less frequently than on the system
with fine grain resolution(micro J).

This patch sets the accumulation thread interval to an optimum value
calculated based on the (energy unit) resolution supported by the
hardware (assuming a peak wattage of 240W).

Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Link: https://lore.kernel.org/r/20200929105322.8919-3-nchatrad@amd.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/amd_energy.c