powercap: intel_rapl_tpmi: Handle PMU registration failure during probe

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: 963a9ad3c5 ("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>
This commit is contained in:
Sumeet Pawnikar 2026-07-23 22:53:20 +05:30 committed by Rafael J. Wysocki
parent f5098b6bae
commit 9229916d59

View 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);