From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08E723C3BFE for ; Wed, 1 Jul 2026 21:36:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782941769; cv=none; b=jy3Tgwm3hsy+ftuOy2CjPrczjH9fU7yPbBbar+BlKkfOoZQqXqVbu/FvE9f9M7Q0/DvVP4e3oJmgQGbbry47AueXZ1rA974SvqHEBZ1caG0BmWlOIk32GnLRGMxeZ7QuNIotYewKyFouQVetvxYB+nPasSi9QiMrQM2LxZ1K3tI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782941769; c=relaxed/simple; bh=5cYhYMUkBy36cAJFUn8ndzcMhPsFC3aFfrjbuEGFLMY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RUkD3y5k2Td+FHly2t1O3Y/UGaRNnC5FJXIm14DxL6/KMJx3dmDDH1+Zph5hH8n1XSMcqir0Y0XChtlztQefQ1gyBp2NSmjncVCNay28BclwAQ2qaQh7uHhoUu2VRkkhzwLt/UtliIqSGjjU0XFNaI+hm6n4ER4Z1Pt3snU23ZU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UVLgG3QL; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UVLgG3QL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1782941767; x=1814477767; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5cYhYMUkBy36cAJFUn8ndzcMhPsFC3aFfrjbuEGFLMY=; b=UVLgG3QLH6DYdlYvRZwsEnNi/HLawM91g6tSekL+jVjuaunYXjzxYZDJ 6cDba5MKesd+GgzgpPPWiIAhg1MWbzxXTLv7jH+R1Q8WtudIhb/yhxYJn ve2yeR3ZBc5PuqaOYntW6ETSGm+ZU2sXp/wYnak1hOQDVnYwPga2FdVI5 M82n7OwEY+sbP+/rGtU0xXKtOerWATt16z8TZnA4gZDmkum37qr20tZJD z69NB4z8f9YeeEAx0wk1TbsuORsCiRiw0tE/+4ZzBl6iH71o3U3Mw2fGF Y7np/Z5p9J7GBp5kR7wmvMzo9zIIBnA0wi2eCKq3O66EwpSSwDgO7498c Q==; X-CSE-ConnectionGUID: GGjf2EBOQZyh159wNte3UQ== X-CSE-MsgGUID: 0Nuo3X8QSCCaxlqsKlmzLw== X-IronPort-AV: E=McAfee;i="6800,10657,11834"; a="94285817" X-IronPort-AV: E=Sophos;i="6.25,142,1779174000"; d="scan'208";a="94285817" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 14:36:04 -0700 X-CSE-ConnectionGUID: rECg4VylRoKq/Ojk/HylTw== X-CSE-MsgGUID: Ns8HRb+XQ1WEn08XBNdDFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,142,1779174000"; d="scan'208";a="252242542" Received: from mdroper-mobl2.amr.corp.intel.com (HELO agluck-desk3.intel.com) ([10.124.221.120]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2026 14:36:04 -0700 From: Tony Luck To: Fenghua Yu , Reinette Chatre , Maciej Wieczor-Retman , Peter Newman , James Morse , Babu Moger , Drew Fustini , Dave Martin , Chen Yu , David E Box , x86@kernel.org Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Tony Luck Subject: [PATCH v9 08/12] platform/x86/intel/pmt: Register enumeration functions with resctrl Date: Wed, 1 Jul 2026 14:35:49 -0700 Message-ID: <20260701213553.15222-9-tony.luck@intel.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260701213553.15222-1-tony.luck@intel.com> References: <20260701213553.15222-1-tony.luck@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 . This is needed rather than to get the function stub definitions when CONFIG_X86_CPU_RESCTRL=n. Suggested-by: Christoph Hellwig Signed-off-by: Tony Luck -- 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 #include +#include + #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