From nobody Sat Feb 7 12:21:45 2026 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (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 3EAA9134AC; Sun, 8 Jun 2025 01:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749345941; cv=none; b=fW5Og9vlaJJu9I5aTzTkb5vnNrADWo5l54WNshEN4NCZwjk/kSCN6B2t3NgxaAYTnBgobf9x6GONDwHW2nu5dmil76rU+DXnw0yKPe58REaAcukN2au5Q7NOGubQRfdwRUV6PRU4r9Bd35GyPl6gDrQGcqot+MEGCvcQ0pb0WkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749345941; c=relaxed/simple; bh=Xz38wUv+zqJF7aTbshqy2ZY4ajvu964Nft4yUVM5mxM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bdB6CM7pE6xW+BbTm8DYlxu5wtkufQ5VpJQIX8vjZnOt2bE9zbQbMTL+kXr0AdnmQfPheq6qLRRcFQzRQRcBgvccTdwTALaRJsT60mD4B9xGARUnUyXxyGU+Hf9gy1g4QKYeMp6IBQy/z9n1hS/QuKYE+SpwAKdPfSrT+guh6Ks= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=lksI5ELD; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="lksI5ELD" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=M7VKH/G4cHDJoSEyw+bSJC3widT/3FG08VGcYcgkato=; b=lksI5ELDDoWPZ72/ /loiQVcj+hCPXrVXOXw5jY0fl6lgnwDKbBVFmrYJ5fjTByZDI8Rl5KBFxARNS4/Ee6aty7EshkJo3 ad1T0kDbvr0J6mzzvIyMaXdeJVeEtF/q3l4HEobd2BpEUJGaOaW/o7C+oYPos7MSGanChQfyH2/fF TzGMB8n9rc7gtUxx1FZJtYgta7+F5wfwGY3YaaBIpDPsvRU4gl8LKVZoGAlcqqyfMSDmsjJBz8Lau l2j9ol1EvlA0TIszgeqXc59kU/P5mRMuBcXiHeqqeAMWuvP78EH02kMItvZIEdxnzumqG5ydX1dN7 OlwmTsZuFwlkI5ut4A==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1uO4mf-008Dyl-2N; Sun, 08 Jun 2025 01:25:13 +0000 From: linux@treblig.org To: irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, platform-driver-x86@vger.kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 1/3] platform/x86: intel_telemetry: Remove unused telemetry_*_events Date: Sun, 8 Jun 2025 02:25:10 +0100 Message-ID: <20250608012512.377134-2-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250608012512.377134-1-linux@treblig.org> References: <20250608012512.377134-1-linux@treblig.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" The functions: telemetry_add_events(), telemetry_update_events(), telemetry_reset_events(), telemetry_get_eventconfig() were all added in 2016's commit 378f956e3f93 ("platform/x86: Add Intel Telemetry Core Driver") but have remained unused. They're each a tiny wrapper that is the only caller through a similarly named function pointer, and for each function pointer there's a 'def' empty implementation and a plt implementation. Remove all of those components for each function. Signed-off-by: Dr. David Alan Gilbert --- arch/x86/include/asm/intel_telemetry.h | 24 ---- drivers/platform/x86/intel/telemetry/core.c | 101 ---------------- drivers/platform/x86/intel/telemetry/pltdrv.c | 114 ------------------ 3 files changed, 239 deletions(-) diff --git a/arch/x86/include/asm/intel_telemetry.h b/arch/x86/include/asm/= intel_telemetry.h index 43b7657febca..3d7e0b922341 100644 --- a/arch/x86/include/asm/intel_telemetry.h +++ b/arch/x86/include/asm/intel_telemetry.h @@ -62,13 +62,6 @@ struct telemetry_core_ops { int (*get_sampling_period)(u8 *pss_min_period, u8 *pss_max_period, u8 *ioss_min_period, u8 *ioss_max_period); =20 - int (*get_eventconfig)(struct telemetry_evtconfig *pss_evtconfig, - struct telemetry_evtconfig *ioss_evtconfig, - int pss_len, int ioss_len); - - int (*update_events)(struct telemetry_evtconfig pss_evtconfig, - struct telemetry_evtconfig ioss_evtconfig); - int (*set_sampling_period)(u8 pss_period, u8 ioss_period); =20 int (*get_trace_verbosity)(enum telemetry_unit telem_unit, @@ -84,11 +77,6 @@ struct telemetry_core_ops { int (*read_eventlog)(enum telemetry_unit telem_unit, struct telemetry_evtlog *evtlog, int len, int log_all_evts); - - int (*add_events)(u8 num_pss_evts, u8 num_ioss_evts, - u32 *pss_evtmap, u32 *ioss_evtmap); - - int (*reset_events)(void); }; =20 int telemetry_set_pltdata(const struct telemetry_core_ops *ops, @@ -101,18 +89,6 @@ struct telemetry_plt_config *telemetry_get_pltdata(void= ); int telemetry_get_evtname(enum telemetry_unit telem_unit, const char **name, int len); =20 -int telemetry_update_events(struct telemetry_evtconfig pss_evtconfig, - struct telemetry_evtconfig ioss_evtconfig); - -int telemetry_add_events(u8 num_pss_evts, u8 num_ioss_evts, - u32 *pss_evtmap, u32 *ioss_evtmap); - -int telemetry_reset_events(void); - -int telemetry_get_eventconfig(struct telemetry_evtconfig *pss_config, - struct telemetry_evtconfig *ioss_config, - int pss_len, int ioss_len); - int telemetry_read_events(enum telemetry_unit telem_unit, struct telemetry_evtlog *evtlog, int len); =20 diff --git a/drivers/platform/x86/intel/telemetry/core.c b/drivers/platform= /x86/intel/telemetry/core.c index e4be40f73eeb..229e59c64af7 100644 --- a/drivers/platform/x86/intel/telemetry/core.c +++ b/drivers/platform/x86/intel/telemetry/core.c @@ -21,12 +21,6 @@ struct telemetry_core_config { =20 static struct telemetry_core_config telm_core_conf; =20 -static int telemetry_def_update_events(struct telemetry_evtconfig pss_evtc= onfig, - struct telemetry_evtconfig ioss_evtconfig) -{ - return 0; -} - static int telemetry_def_set_sampling_period(u8 pss_period, u8 ioss_period) { return 0; @@ -40,14 +34,6 @@ static int telemetry_def_get_sampling_period(u8 *pss_min= _period, return 0; } =20 -static int telemetry_def_get_eventconfig( - struct telemetry_evtconfig *pss_evtconfig, - struct telemetry_evtconfig *ioss_evtconfig, - int pss_len, int ioss_len) -{ - return 0; -} - static int telemetry_def_get_trace_verbosity(enum telemetry_unit telem_uni= t, u32 *verbosity) { @@ -75,51 +61,15 @@ static int telemetry_def_read_eventlog(enum telemetry_u= nit telem_unit, return 0; } =20 -static int telemetry_def_add_events(u8 num_pss_evts, u8 num_ioss_evts, - u32 *pss_evtmap, u32 *ioss_evtmap) -{ - return 0; -} - -static int telemetry_def_reset_events(void) -{ - return 0; -} - static const struct telemetry_core_ops telm_defpltops =3D { .set_sampling_period =3D telemetry_def_set_sampling_period, .get_sampling_period =3D telemetry_def_get_sampling_period, .get_trace_verbosity =3D telemetry_def_get_trace_verbosity, .set_trace_verbosity =3D telemetry_def_set_trace_verbosity, .raw_read_eventlog =3D telemetry_def_raw_read_eventlog, - .get_eventconfig =3D telemetry_def_get_eventconfig, .read_eventlog =3D telemetry_def_read_eventlog, - .update_events =3D telemetry_def_update_events, - .reset_events =3D telemetry_def_reset_events, - .add_events =3D telemetry_def_add_events, }; =20 -/** - * telemetry_update_events() - Update telemetry Configuration - * @pss_evtconfig: PSS related config. No change if num_evts =3D 0. - * @ioss_evtconfig: IOSS related config. No change if num_evts =3D 0. - * - * This API updates the IOSS & PSS Telemetry configuration. Old config - * is overwritten. Call telemetry_reset_events when logging is over - * All sample period values should be in the form of: - * bits[6:3] -> value; bits [0:2]-> Exponent; Period =3D (Value *16^Expone= nt) - * - * Return: 0 success, < 0 for failure - */ -int telemetry_update_events(struct telemetry_evtconfig pss_evtconfig, - struct telemetry_evtconfig ioss_evtconfig) -{ - return telm_core_conf.telem_ops->update_events(pss_evtconfig, - ioss_evtconfig); -} -EXPORT_SYMBOL_GPL(telemetry_update_events); - - /** * telemetry_set_sampling_period() - Sets the IOSS & PSS sampling period * @pss_period: placeholder for PSS Period to be set. @@ -162,57 +112,6 @@ int telemetry_get_sampling_period(u8 *pss_min_period, = u8 *pss_max_period, EXPORT_SYMBOL_GPL(telemetry_get_sampling_period); =20 =20 -/** - * telemetry_reset_events() - Restore the IOSS & PSS configuration to defa= ult - * - * Return: 0 success, < 0 for failure - */ -int telemetry_reset_events(void) -{ - return telm_core_conf.telem_ops->reset_events(); -} -EXPORT_SYMBOL_GPL(telemetry_reset_events); - -/** - * telemetry_get_eventconfig() - Returns the pss and ioss events enabled - * @pss_evtconfig: Pointer to PSS related configuration. - * @ioss_evtconfig: Pointer to IOSS related configuration. - * @pss_len: Number of u32 elements allocated for pss_evtconfig array - * @ioss_len: Number of u32 elements allocated for ioss_evtconfig array - * - * Return: 0 success, < 0 for failure - */ -int telemetry_get_eventconfig(struct telemetry_evtconfig *pss_evtconfig, - struct telemetry_evtconfig *ioss_evtconfig, - int pss_len, int ioss_len) -{ - return telm_core_conf.telem_ops->get_eventconfig(pss_evtconfig, - ioss_evtconfig, - pss_len, ioss_len); -} -EXPORT_SYMBOL_GPL(telemetry_get_eventconfig); - -/** - * telemetry_add_events() - Add IOSS & PSS configuration to existing setti= ngs. - * @num_pss_evts: Number of PSS Events (<29) in pss_evtmap. Can be 0. - * @num_ioss_evts: Number of IOSS Events (<29) in ioss_evtmap. Can be 0. - * @pss_evtmap: Array of PSS Event-IDs to Enable - * @ioss_evtmap: Array of PSS Event-IDs to Enable - * - * Events are appended to Old Configuration. In case of total events > 28,= it - * returns error. Call telemetry_reset_events to reset after eventlog done - * - * Return: 0 success, < 0 for failure - */ -int telemetry_add_events(u8 num_pss_evts, u8 num_ioss_evts, - u32 *pss_evtmap, u32 *ioss_evtmap) -{ - return telm_core_conf.telem_ops->add_events(num_pss_evts, - num_ioss_evts, pss_evtmap, - ioss_evtmap); -} -EXPORT_SYMBOL_GPL(telemetry_add_events); - /** * telemetry_read_events() - Fetches samples as specified by evtlog.telem_= evt_id * @telem_unit: Specify whether IOSS or PSS Read diff --git a/drivers/platform/x86/intel/telemetry/pltdrv.c b/drivers/platfo= rm/x86/intel/telemetry/pltdrv.c index 9a499efa1e4d..60d3783de7ef 100644 --- a/drivers/platform/x86/intel/telemetry/pltdrv.c +++ b/drivers/platform/x86/intel/telemetry/pltdrv.c @@ -639,32 +639,6 @@ static int telemetry_setup(struct platform_device *pde= v) return 0; } =20 -static int telemetry_plt_update_events(struct telemetry_evtconfig pss_evtc= onfig, - struct telemetry_evtconfig ioss_evtconfig) -{ - int ret; - - if ((pss_evtconfig.num_evts > 0) && - (TELEM_SAMPLE_PERIOD_INVALID(pss_evtconfig.period))) { - pr_err("PSS Sampling Period Out of Range\n"); - return -EINVAL; - } - - if ((ioss_evtconfig.num_evts > 0) && - (TELEM_SAMPLE_PERIOD_INVALID(ioss_evtconfig.period))) { - pr_err("IOSS Sampling Period Out of Range\n"); - return -EINVAL; - } - - ret =3D telemetry_setup_evtconfig(pss_evtconfig, ioss_evtconfig, - TELEM_UPDATE); - if (ret) - pr_err("TELEMETRY Config Failed\n"); - - return ret; -} - - static int telemetry_plt_set_sampling_period(u8 pss_period, u8 ioss_period) { u32 telem_ctrl =3D 0; @@ -780,90 +754,6 @@ static int telemetry_plt_get_sampling_period(u8 *pss_m= in_period, } =20 =20 -static int telemetry_plt_reset_events(void) -{ - struct telemetry_evtconfig pss_evtconfig, ioss_evtconfig; - int ret; - - pss_evtconfig.evtmap =3D NULL; - pss_evtconfig.num_evts =3D TELEM_MAX_OS_ALLOCATED_EVENTS; - pss_evtconfig.period =3D TELEM_SAMPLING_DEFAULT_PERIOD; - - ioss_evtconfig.evtmap =3D NULL; - ioss_evtconfig.num_evts =3D TELEM_MAX_OS_ALLOCATED_EVENTS; - ioss_evtconfig.period =3D TELEM_SAMPLING_DEFAULT_PERIOD; - - ret =3D telemetry_setup_evtconfig(pss_evtconfig, ioss_evtconfig, - TELEM_RESET); - if (ret) - pr_err("TELEMETRY Reset Failed\n"); - - return ret; -} - - -static int telemetry_plt_get_eventconfig(struct telemetry_evtconfig *pss_c= onfig, - struct telemetry_evtconfig *ioss_config, - int pss_len, int ioss_len) -{ - u32 *pss_evtmap, *ioss_evtmap; - u32 index; - - pss_evtmap =3D pss_config->evtmap; - ioss_evtmap =3D ioss_config->evtmap; - - mutex_lock(&(telm_conf->telem_lock)); - pss_config->num_evts =3D telm_conf->pss_config.ssram_evts_used; - ioss_config->num_evts =3D telm_conf->ioss_config.ssram_evts_used; - - pss_config->period =3D telm_conf->pss_config.curr_period; - ioss_config->period =3D telm_conf->ioss_config.curr_period; - - if ((pss_len < telm_conf->pss_config.ssram_evts_used) || - (ioss_len < telm_conf->ioss_config.ssram_evts_used)) { - mutex_unlock(&(telm_conf->telem_lock)); - return -EINVAL; - } - - for (index =3D 0; index < telm_conf->pss_config.ssram_evts_used; - index++) { - pss_evtmap[index] =3D - telm_conf->pss_config.telem_evts[index].evt_id; - } - - for (index =3D 0; index < telm_conf->ioss_config.ssram_evts_used; - index++) { - ioss_evtmap[index] =3D - telm_conf->ioss_config.telem_evts[index].evt_id; - } - - mutex_unlock(&(telm_conf->telem_lock)); - return 0; -} - - -static int telemetry_plt_add_events(u8 num_pss_evts, u8 num_ioss_evts, - u32 *pss_evtmap, u32 *ioss_evtmap) -{ - struct telemetry_evtconfig pss_evtconfig, ioss_evtconfig; - int ret; - - pss_evtconfig.evtmap =3D pss_evtmap; - pss_evtconfig.num_evts =3D num_pss_evts; - pss_evtconfig.period =3D telm_conf->pss_config.curr_period; - - ioss_evtconfig.evtmap =3D ioss_evtmap; - ioss_evtconfig.num_evts =3D num_ioss_evts; - ioss_evtconfig.period =3D telm_conf->ioss_config.curr_period; - - ret =3D telemetry_setup_evtconfig(pss_evtconfig, ioss_evtconfig, - TELEM_ADD); - if (ret) - pr_err("TELEMETRY ADD Failed\n"); - - return ret; -} - static int telem_evtlog_read(enum telemetry_unit telem_unit, struct telem_ssram_region *ssram_region, u8 len) { @@ -1096,11 +986,7 @@ static const struct telemetry_core_ops telm_pltops = =3D { .set_sampling_period =3D telemetry_plt_set_sampling_period, .get_sampling_period =3D telemetry_plt_get_sampling_period, .raw_read_eventlog =3D telemetry_plt_raw_read_eventlog, - .get_eventconfig =3D telemetry_plt_get_eventconfig, - .update_events =3D telemetry_plt_update_events, .read_eventlog =3D telemetry_plt_read_eventlog, - .reset_events =3D telemetry_plt_reset_events, - .add_events =3D telemetry_plt_add_events, }; =20 static int telemetry_pltdrv_probe(struct platform_device *pdev) --=20 2.49.0 From nobody Sat Feb 7 12:21:45 2026 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (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 8209914A4DB; Sun, 8 Jun 2025 01:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749345945; cv=none; b=cNFh0V/L5LmHZPqsLv4OVtbbSFpxaNkCTFTmu4+DGBFVv4z5ItsC8HD6Iup6OM8fLy0+JKAKXfIKdq8q9ifQkimj6g010UNifaYk63tjd9x6iYZbKRwY0f8WNHqxLn9ylUdY9fLX4p1P9OdSZfrzq2wtF+k7AHyKZgElYGp6rkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749345945; c=relaxed/simple; bh=WDvi1Nk2ofBFZ+/NbQBR4i23wemBFLZjDHsRCoqd5YU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L+J6oUq9c/Z/1AFLQISpYeRE10FC88ScM9oZF6TIByxfmPa/KvSv1v6sPlH8nd8JLd+31xYHFOKTU/chzKhm2f1VvA8+EW7NyBuJZwbUw3SEM8RZ7g0hmp95pk5s8BZympsgEcToG0HCBAT68IKYSAbPx/lTDgXI8AB56xcqV18= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=EnKF2vvj; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="EnKF2vvj" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=WJr0cQUh1oIwxftMhGSaCHbcPtUcQVmiJZW2pTFZvBM=; b=EnKF2vvjMTXmLHMN hFzat2kgj/GHwyKt6kJxo8j+thAB4rQaFAo0UUKBIAZgBXV/GcNFs0iWlR4s9QoVJh/vLVgu+s4w1 jY5OY+5XXB+HRZeDS0oQxiQxk9rjr+arQ6VuKZONG9QwGOnXEZKaIehwFJl9UdGLVx58d+qilvU7d pZkxvNOg1/W718S3R56zinRIIqwSbqeKws5/FwC2Vc6NWWAxiNJ2BwD57/CKNiGObtZPz48Y3cjx0 dMG/Q1HPwcYtQEhgT983PE7XqHOVVE7g3nU0IvIWFbTRfWyCkBIQDYlBTdSYXlf/6xT8MSccdELqf etoWsBQl7M7cDo7t+w==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1uO4mg-008Dyl-0h; Sun, 08 Jun 2025 01:25:14 +0000 From: linux@treblig.org To: irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, platform-driver-x86@vger.kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 2/3] platform/x86: intel_telemetry: Remove unused [gs]et_sampling_period Date: Sun, 8 Jun 2025 02:25:11 +0100 Message-ID: <20250608012512.377134-3-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250608012512.377134-1-linux@treblig.org> References: <20250608012512.377134-1-linux@treblig.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" The functions: get_sampling_period() and set_sampling_period() were both added in 2016's commit 378f956e3f93 ("platform/x86: Add Intel Telemetry Core Driver") but have remained unused. They're each a tiny wrapper that is the only caller through a similarly named function pointer, and for each function pointer there's a 'def' empty implementation and a plt implementation. Remove all of those components for each function. Signed-off-by: Dr. David Alan Gilbert --- arch/x86/include/asm/intel_telemetry.h | 10 -- drivers/platform/x86/intel/telemetry/core.c | 57 --------- drivers/platform/x86/intel/telemetry/pltdrv.c | 117 ------------------ 3 files changed, 184 deletions(-) diff --git a/arch/x86/include/asm/intel_telemetry.h b/arch/x86/include/asm/= intel_telemetry.h index 3d7e0b922341..e7fb005ac8d8 100644 --- a/arch/x86/include/asm/intel_telemetry.h +++ b/arch/x86/include/asm/intel_telemetry.h @@ -59,11 +59,6 @@ struct telemetry_plt_config { }; =20 struct telemetry_core_ops { - int (*get_sampling_period)(u8 *pss_min_period, u8 *pss_max_period, - u8 *ioss_min_period, u8 *ioss_max_period); - - int (*set_sampling_period)(u8 pss_period, u8 ioss_period); - int (*get_trace_verbosity)(enum telemetry_unit telem_unit, u32 *verbosity); =20 @@ -101,11 +96,6 @@ int telemetry_read_eventlog(enum telemetry_unit telem_u= nit, int telemetry_raw_read_eventlog(enum telemetry_unit telem_unit, struct telemetry_evtlog *evtlog, int len); =20 -int telemetry_get_sampling_period(u8 *pss_min_period, u8 *pss_max_period, - u8 *ioss_min_period, u8 *ioss_max_period); - -int telemetry_set_sampling_period(u8 pss_period, u8 ioss_period); - int telemetry_set_trace_verbosity(enum telemetry_unit telem_unit, u32 verbosity); =20 diff --git a/drivers/platform/x86/intel/telemetry/core.c b/drivers/platform= /x86/intel/telemetry/core.c index 229e59c64af7..fe9e8580a8f5 100644 --- a/drivers/platform/x86/intel/telemetry/core.c +++ b/drivers/platform/x86/intel/telemetry/core.c @@ -21,19 +21,6 @@ struct telemetry_core_config { =20 static struct telemetry_core_config telm_core_conf; =20 -static int telemetry_def_set_sampling_period(u8 pss_period, u8 ioss_period) -{ - return 0; -} - -static int telemetry_def_get_sampling_period(u8 *pss_min_period, - u8 *pss_max_period, - u8 *ioss_min_period, - u8 *ioss_max_period) -{ - return 0; -} - static int telemetry_def_get_trace_verbosity(enum telemetry_unit telem_uni= t, u32 *verbosity) { @@ -62,56 +49,12 @@ static int telemetry_def_read_eventlog(enum telemetry_u= nit telem_unit, } =20 static const struct telemetry_core_ops telm_defpltops =3D { - .set_sampling_period =3D telemetry_def_set_sampling_period, - .get_sampling_period =3D telemetry_def_get_sampling_period, .get_trace_verbosity =3D telemetry_def_get_trace_verbosity, .set_trace_verbosity =3D telemetry_def_set_trace_verbosity, .raw_read_eventlog =3D telemetry_def_raw_read_eventlog, .read_eventlog =3D telemetry_def_read_eventlog, }; =20 -/** - * telemetry_set_sampling_period() - Sets the IOSS & PSS sampling period - * @pss_period: placeholder for PSS Period to be set. - * Set to 0 if not required to be updated - * @ioss_period: placeholder for IOSS Period to be set - * Set to 0 if not required to be updated - * - * All values should be in the form of: - * bits[6:3] -> value; bits [0:2]-> Exponent; Period =3D (Value *16^Expone= nt) - * - * Return: 0 success, < 0 for failure - */ -int telemetry_set_sampling_period(u8 pss_period, u8 ioss_period) -{ - return telm_core_conf.telem_ops->set_sampling_period(pss_period, - ioss_period); -} -EXPORT_SYMBOL_GPL(telemetry_set_sampling_period); - -/** - * telemetry_get_sampling_period() - Get IOSS & PSS min & max sampling per= iod - * @pss_min_period: placeholder for PSS Min Period supported - * @pss_max_period: placeholder for PSS Max Period supported - * @ioss_min_period: placeholder for IOSS Min Period supported - * @ioss_max_period: placeholder for IOSS Max Period supported - * - * All values should be in the form of: - * bits[6:3] -> value; bits [0:2]-> Exponent; Period =3D (Value *16^Expone= nt) - * - * Return: 0 success, < 0 for failure - */ -int telemetry_get_sampling_period(u8 *pss_min_period, u8 *pss_max_period, - u8 *ioss_min_period, u8 *ioss_max_period) -{ - return telm_core_conf.telem_ops->get_sampling_period(pss_min_period, - pss_max_period, - ioss_min_period, - ioss_max_period); -} -EXPORT_SYMBOL_GPL(telemetry_get_sampling_period); - - /** * telemetry_read_events() - Fetches samples as specified by evtlog.telem_= evt_id * @telem_unit: Specify whether IOSS or PSS Read diff --git a/drivers/platform/x86/intel/telemetry/pltdrv.c b/drivers/platfo= rm/x86/intel/telemetry/pltdrv.c index 60d3783de7ef..f23c170a55dc 100644 --- a/drivers/platform/x86/intel/telemetry/pltdrv.c +++ b/drivers/platform/x86/intel/telemetry/pltdrv.c @@ -639,121 +639,6 @@ static int telemetry_setup(struct platform_device *pd= ev) return 0; } =20 -static int telemetry_plt_set_sampling_period(u8 pss_period, u8 ioss_period) -{ - u32 telem_ctrl =3D 0; - int ret =3D 0; - - mutex_lock(&(telm_conf->telem_lock)); - if (ioss_period) { - struct intel_scu_ipc_dev *scu =3D telm_conf->scu; - - if (TELEM_SAMPLE_PERIOD_INVALID(ioss_period)) { - pr_err("IOSS Sampling Period Out of Range\n"); - ret =3D -EINVAL; - goto out; - } - - /* Get telemetry EVENT CTL */ - ret =3D intel_scu_ipc_dev_command(scu, IOSS_TELEM, - IOSS_TELEM_EVENT_CTL_READ, NULL, 0, - &telem_ctrl, sizeof(telem_ctrl)); - if (ret) { - pr_err("IOSS TELEM_CTRL Read Failed\n"); - goto out; - } - - /* Disable Telemetry */ - TELEM_DISABLE(telem_ctrl); - - ret =3D intel_scu_ipc_dev_command(scu, IOSS_TELEM, - IOSS_TELEM_EVENT_CTL_WRITE, - &telem_ctrl, sizeof(telem_ctrl), - NULL, 0); - if (ret) { - pr_err("IOSS TELEM_CTRL Event Disable Write Failed\n"); - goto out; - } - - /* Enable Periodic Telemetry Events and enable SRAM trace */ - TELEM_CLEAR_SAMPLE_PERIOD(telem_ctrl); - TELEM_ENABLE_SRAM_EVT_TRACE(telem_ctrl); - TELEM_ENABLE_PERIODIC(telem_ctrl); - telem_ctrl |=3D ioss_period; - - ret =3D intel_scu_ipc_dev_command(scu, IOSS_TELEM, - IOSS_TELEM_EVENT_CTL_WRITE, - &telem_ctrl, sizeof(telem_ctrl), - NULL, 0); - if (ret) { - pr_err("IOSS TELEM_CTRL Event Enable Write Failed\n"); - goto out; - } - telm_conf->ioss_config.curr_period =3D ioss_period; - } - - if (pss_period) { - if (TELEM_SAMPLE_PERIOD_INVALID(pss_period)) { - pr_err("PSS Sampling Period Out of Range\n"); - ret =3D -EINVAL; - goto out; - } - - /* Get telemetry EVENT CTL */ - ret =3D intel_punit_ipc_command( - IPC_PUNIT_BIOS_READ_TELE_EVENT_CTRL, - 0, 0, NULL, &telem_ctrl); - if (ret) { - pr_err("PSS TELEM_CTRL Read Failed\n"); - goto out; - } - - /* Disable Telemetry */ - TELEM_DISABLE(telem_ctrl); - ret =3D intel_punit_ipc_command( - IPC_PUNIT_BIOS_WRITE_TELE_EVENT_CTRL, - 0, 0, &telem_ctrl, NULL); - if (ret) { - pr_err("PSS TELEM_CTRL Event Disable Write Failed\n"); - goto out; - } - - /* Enable Periodic Telemetry Events and enable SRAM trace */ - TELEM_CLEAR_SAMPLE_PERIOD(telem_ctrl); - TELEM_ENABLE_SRAM_EVT_TRACE(telem_ctrl); - TELEM_ENABLE_PERIODIC(telem_ctrl); - telem_ctrl |=3D pss_period; - - ret =3D intel_punit_ipc_command( - IPC_PUNIT_BIOS_WRITE_TELE_EVENT_CTRL, - 0, 0, &telem_ctrl, NULL); - if (ret) { - pr_err("PSS TELEM_CTRL Event Enable Write Failed\n"); - goto out; - } - telm_conf->pss_config.curr_period =3D pss_period; - } - -out: - mutex_unlock(&(telm_conf->telem_lock)); - return ret; -} - - -static int telemetry_plt_get_sampling_period(u8 *pss_min_period, - u8 *pss_max_period, - u8 *ioss_min_period, - u8 *ioss_max_period) -{ - *pss_min_period =3D telm_conf->pss_config.min_period; - *pss_max_period =3D telm_conf->pss_config.max_period; - *ioss_min_period =3D telm_conf->ioss_config.min_period; - *ioss_max_period =3D telm_conf->ioss_config.max_period; - - return 0; -} - - static int telem_evtlog_read(enum telemetry_unit telem_unit, struct telem_ssram_region *ssram_region, u8 len) { @@ -983,8 +868,6 @@ static int telemetry_plt_set_trace_verbosity(enum telem= etry_unit telem_unit, static const struct telemetry_core_ops telm_pltops =3D { .get_trace_verbosity =3D telemetry_plt_get_trace_verbosity, .set_trace_verbosity =3D telemetry_plt_set_trace_verbosity, - .set_sampling_period =3D telemetry_plt_set_sampling_period, - .get_sampling_period =3D telemetry_plt_get_sampling_period, .raw_read_eventlog =3D telemetry_plt_raw_read_eventlog, .read_eventlog =3D telemetry_plt_read_eventlog, }; --=20 2.49.0 From nobody Sat Feb 7 12:21:45 2026 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (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 03789BA27; Sun, 8 Jun 2025 01:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749345940; cv=none; b=u6qhPBzJD+shJ/UaAH4PbE4dNSaVknCXecV+ipi3fEkyys+nC1uSDuTeip1xZODv+SlwzMeWNEq5Kw+UN+Q3w3iJOhoZ6lcelpUW9nLQq9tTLDydMuegDTqYGCztdGFpx7IV6vV6T/wPsmwV7Ko+uxwEhULajBeTz+wdDKaz0Tk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749345940; c=relaxed/simple; bh=0YUKrUynV6vU5tGY0vHhfX7mN3CW+H3YNEBxP3RjGk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YE6Mi+mXz52mWMwH2S39dddbAJ6/2FqrLR1QHAfYrIMYt/bXdpxb8COGfdavxMzxuguCML72UCiIRxqy+4w8xfxlOjjJA01MfLNvThw3FUyQu2pIIVt8xnUmGuDIrGV/ZiycjBj/l/JWkNKonhPFGJfn9Egrl3sQCWtNMY+cbj8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=YyXBIX0N; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="YyXBIX0N" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=lsYaog1HzQES+8YAX8AuY2m8sh1Bobp+Ncwbdrkz51g=; b=YyXBIX0N03HIb8uZ FgzNyAcxcqjmsGSNjnQkbvHpxezVpktnysxauri9PRTthKHgvAhVXSmdITDrg4wnzG1GONRSssAy1 csGdTWNky8hiI9DFTHcHW5vXamwmnva/jk4sXGgb+J94i4VVnPq8izQHc7facn6P4WXQbRaP8+PKA Y7zDE3pHucKibJtvQXReocU++Kb5h0c83vYwF1Klrz756TfSzHxsZe9GMGHUpZBfnBAXtHxFFkTKE JvS83ew9EeuiFYDmwbLk0oxE1CUE2FaXba1TYzbyvhZXndCn8cMQnd9/ddhHz6DMXMAlKFSmnHjYe sIN61RD7V0BeBh0OTg==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1uO4mg-008Dyl-2E; Sun, 08 Jun 2025 01:25:14 +0000 From: linux@treblig.org To: irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, platform-driver-x86@vger.kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 3/3] platform/x86: intel_telemetry: Remove unused telemetry_raw_read_events Date: Sun, 8 Jun 2025 02:25:12 +0100 Message-ID: <20250608012512.377134-4-linux@treblig.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250608012512.377134-1-linux@treblig.org> References: <20250608012512.377134-1-linux@treblig.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" telemetry_raw_read_events() was added in 2016's commit 378f956e3f93 ("platform/x86: Add Intel Telemetry Core Driver") but have remained unused. Unlike the others in this set, it's wrapper calls into a pointer also used by another entry, so it's only the entry wrapper that's unused. Remove it. Signed-off-by: Dr. David Alan Gilbert --- arch/x86/include/asm/intel_telemetry.h | 3 --- drivers/platform/x86/intel/telemetry/core.c | 19 ------------------- 2 files changed, 22 deletions(-) diff --git a/arch/x86/include/asm/intel_telemetry.h b/arch/x86/include/asm/= intel_telemetry.h index e7fb005ac8d8..944637a4e6de 100644 --- a/arch/x86/include/asm/intel_telemetry.h +++ b/arch/x86/include/asm/intel_telemetry.h @@ -87,9 +87,6 @@ int telemetry_get_evtname(enum telemetry_unit telem_unit, int telemetry_read_events(enum telemetry_unit telem_unit, struct telemetry_evtlog *evtlog, int len); =20 -int telemetry_raw_read_events(enum telemetry_unit telem_unit, - struct telemetry_evtlog *evtlog, int len); - int telemetry_read_eventlog(enum telemetry_unit telem_unit, struct telemetry_evtlog *evtlog, int len); =20 diff --git a/drivers/platform/x86/intel/telemetry/core.c b/drivers/platform= /x86/intel/telemetry/core.c index fe9e8580a8f5..f312864b8d07 100644 --- a/drivers/platform/x86/intel/telemetry/core.c +++ b/drivers/platform/x86/intel/telemetry/core.c @@ -72,25 +72,6 @@ int telemetry_read_events(enum telemetry_unit telem_unit, } EXPORT_SYMBOL_GPL(telemetry_read_events); =20 -/** - * telemetry_raw_read_events() - Fetch samples specified by evtlog.telem_e= vt_id - * @telem_unit: Specify whether IOSS or PSS Read - * @evtlog: Array of telemetry_evtlog structs to fill data - * evtlog.telem_evt_id specifies the ids to read - * @len: Length of array of evtlog - * - * The caller must take care of locking in this case. - * - * Return: number of eventlogs read for success, < 0 for failure - */ -int telemetry_raw_read_events(enum telemetry_unit telem_unit, - struct telemetry_evtlog *evtlog, int len) -{ - return telm_core_conf.telem_ops->raw_read_eventlog(telem_unit, evtlog, - len, 0); -} -EXPORT_SYMBOL_GPL(telemetry_raw_read_events); - /** * telemetry_read_eventlog() - Fetch the Telemetry log from PSS or IOSS * @telem_unit: Specify whether IOSS or PSS Read --=20 2.49.0