From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 3BBAC3446CB for ; Mon, 15 Jun 2026 18:25:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781547917; cv=none; b=N9QX5bARuseA1poaLG1R/wjOjHi5nvdIRn4i3tNnE8D79SIup463dyvyJ/2Nw3LWSxUYIezDrkZzCoN2YqU2p1DuaFhOAEt3rSwVzTyWqwRBRPWfUyIxw2U/2wplzqvQbhcHE2OByqQ1RRJoS04YwwJ0vqEk/jEoTXrc9TASuo8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781547917; c=relaxed/simple; bh=MrhqPa7j2JGoW5KXGgtohMR/jOgI/vkqvszj5jCodoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gwAAC1GUu7bq8TypyePNxyEjAubFSEDzRnBhb/sOT+LwVftXHwgugJXYwEidVMEyfPZkMDd9Yn8U2v/r0qPlfViDVJIii8SiQh5ahV8ROkdmTCowACfDMGrr4uFx5vqsR/gHMjoftGYFBvAGfF1AIBHSphq6oS4LXf8MOuM+C+g= 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=htW/dHZH; arc=none smtp.client-ip=198.175.65.12 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="htW/dHZH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781547915; x=1813083915; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MrhqPa7j2JGoW5KXGgtohMR/jOgI/vkqvszj5jCodoM=; b=htW/dHZH8ojl86h2Td8uzfCy7ZYHZra4ARe1ooX6lPdknfC2Y1wDo3AA pTRMent4/UgqxpmXw8Ct5VR6SPM99B9MM08rCfb+9jo1OiiyTI0iXLQrX AmiZW+DESAHbMG9wVJ/2pyNaZcub4RQOrgefhF1+NlR5b6OyVjxufvHgp pj+6XtrYmWLfZI/5sY0xXORZdAFp+M2q9s8b5f4zGWQn85GvNwhGjjUaL x+F3e7+cvjGdhZhuukdl5wBwZIr3gItguM+6KatFbLgZlQ6MxCKg5ztOZ EjZSwCRF1mfKG1lQ9tAWtck1WYCv4CC9EixUGXaqQVpFIlz/QLOxen9Yw A==; X-CSE-ConnectionGUID: eI90hYV9RSSRUfKQ2/St0Q== X-CSE-MsgGUID: g4V+TMmLSiGaEDpOInlbUw== X-IronPort-AV: E=McAfee;i="6800,10657,11818"; a="93790028" X-IronPort-AV: E=Sophos;i="6.24,206,1774335600"; d="scan'208";a="93790028" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2026 11:25:11 -0700 X-CSE-ConnectionGUID: dxyYtQtPTuyOlPZ6USejjA== X-CSE-MsgGUID: 0uKHzxPJQqGZmRRq/+KssQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,206,1774335600"; d="scan'208";a="247620653" Received: from spandruv-desk1.amr.corp.intel.com (HELO agluck-desk3.intel.com) ([10.124.221.121]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2026 11:25:11 -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 v8 12/16] platform/x86/intel/pmt: Register enumeration functions with resctrl Date: Mon, 15 Jun 2026 11:24:53 -0700 Message-ID: <20260615182457.14725-13-tony.luck@intel.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260615182457.14725-1-tony.luck@intel.com> References: <20260615182457.14725-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. Register the telemetry enumeration function pointers at pmt_telemetry module .probe(), and unregister them at module .remove(). 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 --- v8: Move register/unregister calls to .probe()/.remove() drivers/platform/x86/intel/pmt/telemetry.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/platform/x86/intel/pmt/telemetry.c b/drivers/platform/x86/intel/pmt/telemetry.c index daa6da9bad2a..fa4033f94d2f 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 @@ -365,6 +367,8 @@ static void pmt_telem_remove(struct auxiliary_device *auxdev) struct pmt_telem_priv *priv = auxiliary_get_drvdata(auxdev); int i; + intel_aet_unregister_enumeration(); + mutex_lock(&ep_lock); for (i = 0; i < priv->num_entries; i++) { struct intel_pmt_entry *entry = &priv->entry[i]; @@ -405,6 +409,8 @@ static int pmt_telem_probe(struct auxiliary_device *auxdev, const struct auxilia intel_pmt_get_features(entry); } + intel_aet_register_enumeration(THIS_MODULE, intel_pmt_get_regions_by_feature, + intel_pmt_put_feature_group); return 0; abort_probe: pmt_telem_remove(auxdev); -- 2.54.0