* [PATCH 0/2] ASoC: SOF: core: Module parameter updates
@ 2024-10-23 11:06 Peter Ujfalusi
2024-10-23 11:06 ` [PATCH 1/2] ASoC: SOF: core: Add debug module parameters to set IPC and boot timeout Peter Ujfalusi
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2024-10-23 11:06 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, daniel.baluta
Hi,
Add new debug only parameters to override the default IPC and boot
timeout, these are only available if CONFIG_SND_SOC_SOF_DEBUG is
enabled, only for developers.
The second patch moves the firmware, topology name/path and IPC
version overrides from acpi/pci/of platform code to core and markes
the platform parameters deprecated, to be removed in few kernel
cycles.
There is really no point of duplicating these overrides as they
are not platform dependent.
Regards,
Peter
---
Peter Ujfalusi (2):
ASoC: SOF: core: Add debug module parameters to set IPC and boot
timeout
ASoC: SOF: core: Add fw, tplg and ipc type override parameters
sound/soc/sof/core.c | 64 ++++++++++++++++++++++++++++++++++++
sound/soc/sof/sof-acpi-dev.c | 4 +--
sound/soc/sof/sof-of-dev.c | 8 ++---
sound/soc/sof/sof-pci-dev.c | 12 +++----
4 files changed, 76 insertions(+), 12 deletions(-)
--
2.47.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ASoC: SOF: core: Add debug module parameters to set IPC and boot timeout
2024-10-23 11:06 [PATCH 0/2] ASoC: SOF: core: Module parameter updates Peter Ujfalusi
@ 2024-10-23 11:06 ` Peter Ujfalusi
2024-10-23 11:06 ` [PATCH 2/2] ASoC: SOF: core: Add fw, tplg and ipc type override parameters Peter Ujfalusi
2024-10-23 16:15 ` [PATCH 0/2] ASoC: SOF: core: Module parameter updates Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2024-10-23 11:06 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, daniel.baluta
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>
---
sound/soc/sof/core.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 83fe0401baf8..79bbbcca9c60 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -24,6 +24,17 @@ static int sof_core_debug = IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE
module_param_named(sof_debug, sof_core_debug, int, 0444);
MODULE_PARM_DESC(sof_debug, "SOF core debug options (0x0 all off)");
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG)
+static unsigned int sof_ipc_timeout_ms;
+static unsigned int sof_boot_timeout_ms;
+module_param_named(ipc_timeout, sof_ipc_timeout_ms, uint, 0444);
+MODULE_PARM_DESC(ipc_timeout,
+ "Set the IPC timeout value in ms (0 to use the platform default)");
+module_param_named(boot_timeout, sof_boot_timeout_ms, uint, 0444);
+MODULE_PARM_DESC(boot_timeout,
+ "Set the DSP boot timeout value in ms (0 to use the platform default)");
+#endif
+
/* SOF defaults if not provided by the platform in ms */
#define TIMEOUT_DEFAULT_IPC_MS 500
#define TIMEOUT_DEFAULT_BOOT_MS 2000
@@ -632,6 +643,15 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
else
sdev->boot_timeout = plat_data->desc->boot_timeout;
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG)
+ /* Override the timeout values with module parameter, if set */
+ if (sof_ipc_timeout_ms)
+ sdev->ipc_timeout = sof_ipc_timeout_ms;
+
+ if (sof_boot_timeout_ms)
+ sdev->boot_timeout = sof_boot_timeout_ms;
+#endif
+
sof_set_fw_state(sdev, SOF_FW_BOOT_NOT_STARTED);
/*
--
2.47.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ASoC: SOF: core: Add fw, tplg and ipc type override parameters
2024-10-23 11:06 [PATCH 0/2] ASoC: SOF: core: Module parameter updates Peter Ujfalusi
2024-10-23 11:06 ` [PATCH 1/2] ASoC: SOF: core: Add debug module parameters to set IPC and boot timeout Peter Ujfalusi
@ 2024-10-23 11:06 ` Peter Ujfalusi
2024-10-23 16:15 ` [PATCH 0/2] ASoC: SOF: core: Module parameter updates Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Peter Ujfalusi @ 2024-10-23 11:06 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, daniel.baluta
The different bus type helpers define their own override parameters for
firmware name/path, topology name/path. sof-pci-dev covers all while others
just a subset.
There is no technical reason to do that since these are generic platform
independent parameters.
Add the override module options to core (snd-sof module) and update the
description for the device helper modules as deprecated.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
sound/soc/sof/core.c | 44 ++++++++++++++++++++++++++++++++++++
sound/soc/sof/sof-acpi-dev.c | 4 ++--
sound/soc/sof/sof-of-dev.c | 8 +++----
sound/soc/sof/sof-pci-dev.c | 12 +++++-----
4 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 79bbbcca9c60..24e779e8d650 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -19,6 +19,31 @@
#define CREATE_TRACE_POINTS
#include <trace/events/sof.h>
+/* Module parameters for firmware, topology and IPC type override */
+static char *override_fw_path;
+module_param_named(fw_path, override_fw_path, charp, 0444);
+MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware.");
+
+static char *override_fw_filename;
+module_param_named(fw_filename, override_fw_filename, charp, 0444);
+MODULE_PARM_DESC(fw_filename, "alternate filename for SOF firmware.");
+
+static char *override_lib_path;
+module_param_named(lib_path, override_lib_path, charp, 0444);
+MODULE_PARM_DESC(lib_path, "alternate path for SOF firmware libraries.");
+
+static char *override_tplg_path;
+module_param_named(tplg_path, override_tplg_path, charp, 0444);
+MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
+
+static char *override_tplg_filename;
+module_param_named(tplg_filename, override_tplg_filename, charp, 0444);
+MODULE_PARM_DESC(tplg_filename, "alternate filename for SOF topology.");
+
+static int override_ipc_type = -1;
+module_param_named(ipc_type, override_ipc_type, int, 0444);
+MODULE_PARM_DESC(ipc_type, "Force SOF IPC type. 0 - IPC3, 1 - IPC4");
+
/* see SOF_DBG_ flags */
static int sof_core_debug = IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE_TRACE);
module_param_named(sof_debug, sof_core_debug, int, 0444);
@@ -581,6 +606,23 @@ static void sof_probe_work(struct work_struct *work)
}
}
+static void
+sof_apply_profile_override(struct sof_loadable_file_profile *path_override)
+{
+ if (override_ipc_type >= 0 && override_ipc_type < SOF_IPC_TYPE_COUNT)
+ path_override->ipc_type = override_ipc_type;
+ if (override_fw_path)
+ path_override->fw_path = override_fw_path;
+ if (override_fw_filename)
+ path_override->fw_name = override_fw_filename;
+ if (override_lib_path)
+ path_override->fw_lib_path = override_lib_path;
+ if (override_tplg_path)
+ path_override->tplg_path = override_tplg_path;
+ if (override_tplg_filename)
+ path_override->tplg_name = override_tplg_filename;
+}
+
int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
{
struct snd_sof_dev *sdev;
@@ -612,6 +654,8 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
}
}
+ sof_apply_profile_override(&plat_data->ipc_file_profile_base);
+
/* Initialize sof_ops based on the initial selected IPC version */
ret = sof_init_sof_ops(sdev);
if (ret)
diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c
index b196b2b74c26..76ff798a4a1e 100644
--- a/sound/soc/sof/sof-acpi-dev.c
+++ b/sound/soc/sof/sof-acpi-dev.c
@@ -24,11 +24,11 @@
static char *fw_path;
module_param(fw_path, charp, 0444);
-MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware.");
+MODULE_PARM_DESC(fw_path, "deprecated - moved to snd-sof module.");
static char *tplg_path;
module_param(tplg_path, charp, 0444);
-MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
+MODULE_PARM_DESC(tplg_path, "deprecated - moved to snd-sof module.");
static int sof_acpi_debug;
module_param_named(sof_acpi_debug, sof_acpi_debug, int, 0444);
diff --git a/sound/soc/sof/sof-of-dev.c b/sound/soc/sof/sof-of-dev.c
index f245c1b48c47..fb8c8a14d885 100644
--- a/sound/soc/sof/sof-of-dev.c
+++ b/sound/soc/sof/sof-of-dev.c
@@ -16,19 +16,19 @@
static char *fw_path;
module_param(fw_path, charp, 0444);
-MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware.");
+MODULE_PARM_DESC(fw_path, "deprecated - moved to snd-sof module.");
static char *fw_filename;
module_param(fw_filename, charp, 0444);
-MODULE_PARM_DESC(fw_filename, "alternate filename for SOF firmware.");
+MODULE_PARM_DESC(fw_filename, "deprecated - moved to snd-sof module.");
static char *tplg_path;
module_param(tplg_path, charp, 0444);
-MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
+MODULE_PARM_DESC(tplg_path, "deprecated - moved to snd-sof module.");
static char *tplg_filename;
module_param(tplg_filename, charp, 0444);
-MODULE_PARM_DESC(tplg_filename, "alternate filename for SOF topology.");
+MODULE_PARM_DESC(tplg_filename, "deprecated - moved to snd-sof module.");
const struct dev_pm_ops sof_of_pm = {
.prepare = snd_sof_prepare,
diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c
index 38f2187da5de..fe5650616573 100644
--- a/sound/soc/sof/sof-pci-dev.c
+++ b/sound/soc/sof/sof-pci-dev.c
@@ -22,23 +22,23 @@
static char *fw_path;
module_param(fw_path, charp, 0444);
-MODULE_PARM_DESC(fw_path, "alternate path for SOF firmware.");
+MODULE_PARM_DESC(fw_path, "deprecated - moved to snd-sof module.");
static char *fw_filename;
module_param(fw_filename, charp, 0444);
-MODULE_PARM_DESC(fw_filename, "alternate filename for SOF firmware.");
+MODULE_PARM_DESC(fw_filename, "deprecated - moved to snd-sof module.");
static char *lib_path;
module_param(lib_path, charp, 0444);
-MODULE_PARM_DESC(lib_path, "alternate path for SOF firmware libraries.");
+MODULE_PARM_DESC(lib_path, "deprecated - moved to snd-sof module.");
static char *tplg_path;
module_param(tplg_path, charp, 0444);
-MODULE_PARM_DESC(tplg_path, "alternate path for SOF topology.");
+MODULE_PARM_DESC(tplg_path, "deprecated - moved to snd-sof module.");
static char *tplg_filename;
module_param(tplg_filename, charp, 0444);
-MODULE_PARM_DESC(tplg_filename, "alternate filename for SOF topology.");
+MODULE_PARM_DESC(tplg_filename, "deprecated - moved to snd-sof module.");
static int sof_pci_debug;
module_param_named(sof_pci_debug, sof_pci_debug, int, 0444);
@@ -46,7 +46,7 @@ MODULE_PARM_DESC(sof_pci_debug, "SOF PCI debug options (0x0 all off)");
static int sof_pci_ipc_type = -1;
module_param_named(ipc_type, sof_pci_ipc_type, int, 0444);
-MODULE_PARM_DESC(ipc_type, "Force SOF IPC type. 0 - IPC3, 1 - IPC4");
+MODULE_PARM_DESC(ipc_type, "deprecated - moved to snd-sof module.");
static const char *sof_dmi_override_tplg_name;
static bool sof_dmi_use_community_key;
--
2.47.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] ASoC: SOF: core: Module parameter updates
2024-10-23 11:06 [PATCH 0/2] ASoC: SOF: core: Module parameter updates Peter Ujfalusi
2024-10-23 11:06 ` [PATCH 1/2] ASoC: SOF: core: Add debug module parameters to set IPC and boot timeout Peter Ujfalusi
2024-10-23 11:06 ` [PATCH 2/2] ASoC: SOF: core: Add fw, tplg and ipc type override parameters Peter Ujfalusi
@ 2024-10-23 16:15 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2024-10-23 16:15 UTC (permalink / raw)
To: lgirdwood, Peter Ujfalusi
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, daniel.baluta
On Wed, 23 Oct 2024 14:06:08 +0300, Peter Ujfalusi wrote:
> Add new debug only parameters to override the default IPC and boot
> timeout, these are only available if CONFIG_SND_SOC_SOF_DEBUG is
> enabled, only for developers.
>
> The second patch moves the firmware, topology name/path and IPC
> version overrides from acpi/pci/of platform code to core and markes
> the platform parameters deprecated, to be removed in few kernel
> cycles.
> There is really no point of duplicating these overrides as they
> are not platform dependent.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: SOF: core: Add debug module parameters to set IPC and boot timeout
commit: de688e50f5ef5b4937a5dbd5bfc7afb38673b936
[2/2] ASoC: SOF: core: Add fw, tplg and ipc type override parameters
commit: acb219840fbc57e3135436c03d2c4c2db80e39ee
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-23 16:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 11:06 [PATCH 0/2] ASoC: SOF: core: Module parameter updates Peter Ujfalusi
2024-10-23 11:06 ` [PATCH 1/2] ASoC: SOF: core: Add debug module parameters to set IPC and boot timeout Peter Ujfalusi
2024-10-23 11:06 ` [PATCH 2/2] ASoC: SOF: core: Add fw, tplg and ipc type override parameters Peter Ujfalusi
2024-10-23 16:15 ` [PATCH 0/2] ASoC: SOF: core: Module parameter updates Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox