diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2021-03-18 21:52:38 +0100 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2021-10-21 16:03:31 +0200 |
commit | 5d8cb8db9f791252ef5b7951b6d8cc6281de60a6 (patch) | |
tree | b277d5b7fa9ae1c28fde6708666ea7113ed9a930 /drivers/powercap | |
parent | powercap/drivers/dtpm: Scale the power with the load (diff) | |
download | linux-5d8cb8db9f791252ef5b7951b6d8cc6281de60a6.tar.xz linux-5d8cb8db9f791252ef5b7951b6d8cc6281de60a6.zip |
powercap/drivers/dtpm: Fix power limit initialization
When a DTPM node is registered its power limit must be initialized to
the power max.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210318205238.21937-1-daniel.lezcano@linaro.org
Diffstat (limited to 'drivers/powercap')
-rw-r--r-- | drivers/powercap/dtpm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c index c7c5529b61eb..b9fac786246a 100644 --- a/drivers/powercap/dtpm.c +++ b/drivers/powercap/dtpm.c @@ -448,8 +448,10 @@ int dtpm_register(const char *name, struct dtpm *dtpm, struct dtpm *parent) root = dtpm; } - if (dtpm->ops && !dtpm->ops->update_power_uw(dtpm)) + if (dtpm->ops && !dtpm->ops->update_power_uw(dtpm)) { __dtpm_add_power(dtpm); + dtpm->power_limit = dtpm->power_max; + } pr_info("Registered dtpm node '%s' / %llu-%llu uW, \n", dtpm->zone.name, dtpm->power_min, dtpm->power_max); |