Skip to content

Commit 26ef47e

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: ipc4-topology: Add module parameter to ignore the CPC value
Add a new module parameter ipc4_ignore_cpc which can be used to force the kernel to ignore the queried CPC value for all firmware modules and use 0 instead. The CPC lookup is still done to report missing configurations and the debug print is going to be different to be explicit that the CPC is ignored and what was the value we would have used. The CPC value is sent to the firmware with the MOD_INIT_INSTANCE message and it is used by the firmware as a parameter for clock scaling. The flag is intended to be used only when there is a need to validate the firmware behavior regarding to clock scaling since the 0 CPC value will force the DSP to run in full speed, disabling the scaling and provides additional counter point to rule out clock management related issues. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Link: https://lore.kernel.org/r/20230822065419.24374-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 2cbd530 commit 26ef47e

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

sound/soc/sof/ipc4-topology.c

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@
1717
#include "ipc4-topology.h"
1818
#include "ops.h"
1919

20+
/*
21+
* The ignore_cpc flag can be used to ignore the CPC value for all modules by
22+
* using 0 instead.
23+
* The CPC is sent to the firmware along with the SOF_IPC4_MOD_INIT_INSTANCE
24+
* message and it is used for clock scaling.
25+
* 0 as CPC value will instruct the firmware to use maximum frequency, thus
26+
* deactivating the clock scaling.
27+
*/
28+
static bool ignore_cpc;
29+
module_param_named(ipc4_ignore_cpc, ignore_cpc, bool, 0444);
30+
MODULE_PARM_DESC(ipc4_ignore_cpc,
31+
"Ignore CPC values. This option will disable clock scaling in firmware.");
32+
2033
#define SOF_IPC4_GAIN_PARAM_ID 0
2134
#define SOF_IPC4_TPLG_ABI_SIZE 6
2235
#define SOF_IPC4_CHAIN_DMA_BUF_SIZE_MS 2
@@ -970,9 +983,16 @@ sof_ipc4_update_resource_usage(struct snd_sof_dev *sdev, struct snd_sof_widget *
970983
/* Update base_config->cpc from the module manifest */
971984
sof_ipc4_update_cpc_from_manifest(sdev, fw_module, base_config);
972985

973-
dev_dbg(sdev->dev, "%s: ibs / obs / cpc: %u / %u / %u\n",
974-
swidget->widget->name, base_config->ibs, base_config->obs,
975-
base_config->cpc);
986+
if (ignore_cpc) {
987+
dev_dbg(sdev->dev, "%s: ibs / obs: %u / %u, forcing cpc to 0 from %u\n",
988+
swidget->widget->name, base_config->ibs, base_config->obs,
989+
base_config->cpc);
990+
base_config->cpc = 0;
991+
} else {
992+
dev_dbg(sdev->dev, "%s: ibs / obs / cpc: %u / %u / %u\n",
993+
swidget->widget->name, base_config->ibs, base_config->obs,
994+
base_config->cpc);
995+
}
976996
}
977997

978998
static int sof_ipc4_widget_assign_instance_id(struct snd_sof_dev *sdev,

0 commit comments

Comments
 (0)