Skip to content

Commit de688e5

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: core: Add debug module parameters to set IPC and boot timeout
Add two module parameters to override the IPC and boot timeout values if the SOF stack is compiled with debug enabled to allow experimenting with different timeout values without the need to recompile the kernel. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://patch.msgid.link/20241023110610.6141-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 43aea89 commit de688e5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

sound/soc/sof/core.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ static int sof_core_debug = IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE
2424
module_param_named(sof_debug, sof_core_debug, int, 0444);
2525
MODULE_PARM_DESC(sof_debug, "SOF core debug options (0x0 all off)");
2626

27+
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG)
28+
static unsigned int sof_ipc_timeout_ms;
29+
static unsigned int sof_boot_timeout_ms;
30+
module_param_named(ipc_timeout, sof_ipc_timeout_ms, uint, 0444);
31+
MODULE_PARM_DESC(ipc_timeout,
32+
"Set the IPC timeout value in ms (0 to use the platform default)");
33+
module_param_named(boot_timeout, sof_boot_timeout_ms, uint, 0444);
34+
MODULE_PARM_DESC(boot_timeout,
35+
"Set the DSP boot timeout value in ms (0 to use the platform default)");
36+
#endif
37+
2738
/* SOF defaults if not provided by the platform in ms */
2839
#define TIMEOUT_DEFAULT_IPC_MS 500
2940
#define TIMEOUT_DEFAULT_BOOT_MS 2000
@@ -632,6 +643,15 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
632643
else
633644
sdev->boot_timeout = plat_data->desc->boot_timeout;
634645

646+
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG)
647+
/* Override the timeout values with module parameter, if set */
648+
if (sof_ipc_timeout_ms)
649+
sdev->ipc_timeout = sof_ipc_timeout_ms;
650+
651+
if (sof_boot_timeout_ms)
652+
sdev->boot_timeout = sof_boot_timeout_ms;
653+
#endif
654+
635655
sof_set_fw_state(sdev, SOF_FW_BOOT_NOT_STARTED);
636656

637657
/*

0 commit comments

Comments
 (0)