Re: [PATCH v11 16/23] platform/x86/intel/pmt: Register enumeration functions with resctrl
From: Ilpo Järvinen
Date: Tue Sep 01 2026 - 07:15:17 EST
On Mon, 31 Aug 2026, Tony Luck wrote:
> 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.
>
> Suggested-by: Christoph Hellwig <hch@xxxxxxxxxxxxx>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> ---
> v11:
> Add TAB to line up '=' in .driver initialization
>
> drivers/platform/x86/intel/pmt/telemetry.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/x86/intel/pmt/telemetry.c
> index 953f35b6daec..2d2282c636b2 100644
> --- a/drivers/platform/x86/intel/pmt/telemetry.c
> +++ b/drivers/platform/x86/intel/pmt/telemetry.c
> @@ -427,16 +427,28 @@ static struct auxiliary_driver pmt_telem_aux_driver = {
> .id_table = pmt_telem_id_table,
> .remove = pmt_telem_remove,
> .probe = pmt_telem_probe,
> + .driver = {
> + .probe_type = PROBE_FORCE_SYNCHRONOUS,
> + },
> };
>
> static int __init pmt_telem_init(void)
> {
> - return auxiliary_driver_register(&pmt_telem_aux_driver);
> + int ret;
> +
> + ret = auxiliary_driver_register(&pmt_telem_aux_driver);
> +
> + if (!ret)
> + intel_aet_register_enumeration(THIS_MODULE, intel_pmt_get_regions_by_feature,
> + intel_pmt_put_feature_group);
Preferably reverse the logic and handle the error first.
> +
> + 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);
> }
>
--
i.