All of
 help / color / mirror / Atom feed
From: Daniel Lezcano <>
Cc: "Rafael J. Wysocki" <>, (open list:POWER MANAGEMENT CORE), (open list)
Subject: [PATCH] powercap/drivers/dtpm : Fix power limit initialization
Date: Thu, 18 Mar 2021 21:52:38 +0100	[thread overview]
Message-ID: <> (raw)

When a DTPM node is registered its power limit must be initialized to
the power max.

Signed-off-by: Daniel Lezcano <>
 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->power_limit = dtpm->power_max;
+	}
 	pr_info("Created dtpm node '%s' / %llu-%llu uW, \n",
 		dtpm->, dtpm->power_min, dtpm->power_max);

                 reply	other threads:[~2021-03-18 20:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH] powercap/drivers/dtpm : Fix power limit initialization' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.