]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
powercap: intel_rapl_tpmi: Handle PMU registration failure during probe
authorSumeet Pawnikar <sumeet4linux@gmail.com>
Thu, 23 Jul 2026 17:23:20 +0000 (22:53 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 27 Jul 2026 14:29:16 +0000 (16:29 +0200)
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>
[ rjw: Changed the log level of the new message to "info" ]
Link: https://patch.msgid.link/20260723172321.5960-1-sumeet4linux@gmail.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/powercap/intel_rapl_tpmi.c

index 7f41491d9cd1155515d317acdbb898d6d0ff6330..73f36d9c09b1b602338f470498201fb04406d31e 100644 (file)
@@ -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_info(&auxdev->dev, "Failed to add RAPL PMU for Package%d, %d\n",
+                       info->package_id, ret);
 
        auxiliary_set_drvdata(auxdev, trp);