[PATCH v9 08/12] platform/x86/intel/pmt: Register enumeration functions with resctrl
From: Tony Luck
Date: Wed Jul 01 2026 - 17:38:08 EST
INTEL_PMT_TELEMETRY is a loadable module, but resctrl is built-in and cannot
call PMT functions directly.
Use ".probe_type = PROBE_FORCE_SYNCHRONOUS" to ensure sequential, synchronous
calls to per-device .probe() functions. Register the telemetry enumeration
function pointers at the end of pmt_telem_init() when all .probe() functions
have run and enumeration is complete.
Unregister at the start of pmt_telem_exit() before teardown of the
auxiliary drivers.
Note that checkpatch complains about the #include of <asm/resctrl.h>.
This is needed rather than <linux/resctrl.h> to get the function stub
definitions when CONFIG_X86_CPU_RESCTRL=n.
Suggested-by: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
--
v9:
Back to register in .init() and unregister in .exti()
Add PROBE_FORCE_SYNCHRONOUS
---
drivers/platform/x86/intel/pmt/telemetry.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/x86/intel/pmt/telemetry.c
index f243ccf3185b..fba0b3912c06 100644
--- a/drivers/platform/x86/intel/pmt/telemetry.c
+++ b/drivers/platform/x86/intel/pmt/telemetry.c
@@ -25,6 +25,8 @@
#include <linux/uaccess.h>
#include <linux/xarray.h>
+#include <asm/resctrl.h>
+
#include "class.h"
#define TELEM_SIZE_OFFSET 0x0
@@ -429,17 +431,23 @@ static struct auxiliary_driver pmt_telem_aux_driver = {
.probe = pmt_telem_probe,
.driver = {
.suppress_bind_attrs = true,
+ .probe_type = PROBE_FORCE_SYNCHRONOUS,
},
};
static int __init pmt_telem_init(void)
{
- return auxiliary_driver_register(&pmt_telem_aux_driver);
+ int ret = auxiliary_driver_register(&pmt_telem_aux_driver);
+
+ intel_aet_register_enumeration(THIS_MODULE, intel_pmt_get_regions_by_feature,
+ intel_pmt_put_feature_group);
+ return ret;
}
module_init(pmt_telem_init);
static void __exit pmt_telem_exit(void)
{
+ intel_aet_unregister_enumeration();
auxiliary_driver_unregister(&pmt_telem_aux_driver);
xa_destroy(&telem_array);
}
--
2.54.0