[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210318205238.21937-1-daniel.lezcano@linaro.org>
Date: Thu, 18 Mar 2021 21:52:38 +0100
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: daniel.lezcano@...aro.org
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
linux-pm@...r.kernel.org (open list:POWER MANAGEMENT CORE),
linux-kernel@...r.kernel.org (open list)
Subject: [PATCH] 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@...aro.org>
---
drivers/powercap/dtpm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/powercap/dtpm.c b/drivers/powercap/dtpm.c
index a4784ac2f79b..2f028776cfa8 100644
--- a/drivers/powercap/dtpm.c
+++ b/drivers/powercap/dtpm.c
@@ -594,8 +594,10 @@ int dtpm_create(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("Created dtpm node '%s' / %llu-%llu uW, \n",
dtpm->zone.name, dtpm->power_min, dtpm->power_max);
--
2.17.1
Powered by blists - more mailing lists