platform/x86: intel_telemetry: Remove unused telemetry_[gs]et_sampling_period()

The functions:

  - telemetry_get_sampling_period()
  - telemetry_set_sampling_period()

were both added by the commit 378f956e3f ("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>
This commit is contained in:
Dr. David Alan Gilbert 2025-06-08 02:25:11 +01:00 committed by Ilpo Järvinen
parent 3dd1e9c2a2
commit b35b9fb28c
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31
3 changed files with 0 additions and 184 deletions

View 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);

View 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

View 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 @@ static int telemetry_plt_set_trace_verbosity(enum telemetry_unit telem_unit,
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,
};