Linux Power Management development
 help / color / mirror / Atom feed
From: Sumeet Pawnikar <sumeet4linux@gmail.com>
To: rafael@kernel.org, rui.zhang@intel.com, linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, sumeet4linux@gmail.com
Subject: [PATCH v2] powercap: intel_rapl_tpmi: Handle PMU registration failure during probe
Date: Sun, 19 Jul 2026 14:20:59 +0530	[thread overview]
Message-ID: <20260719085100.145555-1-sumeet4linux@gmail.com> (raw)

intel_rapl_tpmi_probe() invokes rapl_package_add_pmu() but ignores
its return value, so a PMU registration failure would leave the driver
reporting probe success despite the PMU being absent, with no log
trace.

Since PMU registration is an optional auxiliary feature for perf energy
counters, its failure should not break the primary powercap functionality.
Check the return value and log a warning to ensure graceful degradation.

Fixes: 963a9ad3c589 ("powercap: intel_rapl_tpmi: Enable PMU support")
Signed-off-by: Sumeet Pawnikar <sumeet4linux@gmail.com>
---
v1->v2: 
  * Since PMU registration is an optional auxiliary feature here,
    treat it's failure as a non fatal error and log a warning
    and continue, similar to other RAPL drivers like intel_rapl_msr,
    to ensure graceful degradation (Based on Sashiko feedback:
    https://sashiko.dev/#/patchset/20260515184250.228062-1-sumeet4linux%40gmail.com)
  * Add Fixes tag in changelog.
---
 drivers/powercap/intel_rapl_tpmi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/powercap/intel_rapl_tpmi.c b/drivers/powercap/intel_rapl_tpmi.c
index 7f41491d9cd1..078a85158ce4 100644
--- a/drivers/powercap/intel_rapl_tpmi.c
+++ b/drivers/powercap/intel_rapl_tpmi.c
@@ -414,7 +414,10 @@ static int intel_rapl_tpmi_probe(struct auxiliary_device *auxdev,
 		goto err;
 	}
 
-	rapl_package_add_pmu(trp->rp);
+	ret = rapl_package_add_pmu(trp->rp);
+	if (ret)
+		dev_warn(&auxdev->dev, "Failed to add RAPL PMU for Package%d, %ld\n",
+			info->package_id, ret);
 
 	auxiliary_set_drvdata(auxdev, trp);
 
-- 
2.43.0


                 reply	other threads:[~2026-07-19  8:51 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20260719085100.145555-1-sumeet4linux@gmail.com \
    --to=sumeet4linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox