]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
platform/x86: intel_telemetry: Remove unused telemetry_[gs]et_sampling_period()
authorDr. David Alan Gilbert <linux@treblig.org>
Sun, 8 Jun 2025 01:25:11 +0000 (02:25 +0100)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 11 Jun 2025 07:56:00 +0000 (10:56 +0300)
The functions:

  - telemetry_get_sampling_period()
  - telemetry_set_sampling_period()

were both added by the commit 378f956e3f93 ("platform/x86: Add Intel
Telemetry Core Driver") in 2016 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 <linux@treblig.org>
Link: https://lore.kernel.org/r/20250608012512.377134-3-linux@treblig.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
arch/x86/include/asm/intel_telemetry.h
drivers/platform/x86/intel/telemetry/core.c
drivers/platform/x86/intel/telemetry/pltdrv.c

index 3d7e0b922341bb312a8c291e3d0f3c6c8b42454e..e7fb005ac8d86bf3baf08f766fc159a499d8651b 100644 (file)
@@ -59,11 +59,6 @@ struct telemetry_plt_config {
 };
 
 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);
 
@@ -101,11 +96,6 @@ int telemetry_read_eventlog(enum telemetry_unit telem_unit,
 int telemetry_raw_read_eventlog(enum telemetry_unit telem_unit,
                                struct telemetry_evtlog *evtlog, int len);
 
-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);
 
index 229e59c64af7386a22f5b2262fa3ab5776d5207f..fe9e8580a8f52a298e0755e1e515a41414b624d4 100644 (file)
@@ -21,19 +21,6 @@ struct telemetry_core_config {
 
 static struct telemetry_core_config telm_core_conf;
 
-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_unit,
                                             u32 *verbosity)
 {
@@ -62,56 +49,12 @@ static int telemetry_def_read_eventlog(enum telemetry_unit telem_unit,
 }
 
 static const struct telemetry_core_ops telm_defpltops = {
-       .set_sampling_period = telemetry_def_set_sampling_period,
-       .get_sampling_period = telemetry_def_get_sampling_period,
        .get_trace_verbosity = telemetry_def_get_trace_verbosity,
        .set_trace_verbosity = telemetry_def_set_trace_verbosity,
        .raw_read_eventlog = telemetry_def_raw_read_eventlog,
        .read_eventlog = telemetry_def_read_eventlog,
 };
 
-/**
- * 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 = (Value *16^Exponent)
- *
- * 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 period
- * @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 = (Value *16^Exponent)
- *
- * 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
index 60d3783de7effed27b47f97871b17e0dfb3e3b01..f23c170a55dc674be2e287072b4cf69aab2f8fdf 100644 (file)
@@ -639,121 +639,6 @@ static int telemetry_setup(struct platform_device *pdev)
        return 0;
 }
 
-static int telemetry_plt_set_sampling_period(u8 pss_period, u8 ioss_period)
-{
-       u32 telem_ctrl = 0;
-       int ret = 0;
-
-       mutex_lock(&(telm_conf->telem_lock));
-       if (ioss_period) {
-               struct intel_scu_ipc_dev *scu = telm_conf->scu;
-
-               if (TELEM_SAMPLE_PERIOD_INVALID(ioss_period)) {
-                       pr_err("IOSS Sampling Period Out of Range\n");
-                       ret = -EINVAL;
-                       goto out;
-               }
-
-               /* Get telemetry EVENT CTL */
-               ret = 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 = 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 |= ioss_period;
-
-               ret = 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 = ioss_period;
-       }
-
-       if (pss_period) {
-               if (TELEM_SAMPLE_PERIOD_INVALID(pss_period)) {
-                       pr_err("PSS Sampling Period Out of Range\n");
-                       ret = -EINVAL;
-                       goto out;
-               }
-
-               /* Get telemetry EVENT CTL */
-               ret = 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 = 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 |= pss_period;
-
-               ret = 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 = 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 = telm_conf->pss_config.min_period;
-       *pss_max_period = telm_conf->pss_config.max_period;
-       *ioss_min_period = telm_conf->ioss_config.min_period;
-       *ioss_max_period = 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 @@ out:
 static const struct telemetry_core_ops telm_pltops = {
        .get_trace_verbosity = telemetry_plt_get_trace_verbosity,
        .set_trace_verbosity = telemetry_plt_set_trace_verbosity,
-       .set_sampling_period = telemetry_plt_set_sampling_period,
-       .get_sampling_period = telemetry_plt_get_sampling_period,
        .raw_read_eventlog = telemetry_plt_raw_read_eventlog,
        .read_eventlog = telemetry_plt_read_eventlog,
 };