ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c
Subsystems (3)
PATCH 1/1 ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c
This reverts commit 014fdeb0d747304111cfecf93df4407c1a0c80db.
Commit 014fdeb0d747 ("ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c") caused a circular dependency between the snd_sof and snd_sof_of modules:
depmod: ERROR: Cycle detected: snd_sof -> snd_sof_of -> snd_sof depmod: ERROR: Found 2 modules in dependency cycles!
Move the function back with sof_machine_select().
---
Not sure what the proper arrangement would be, but this gets my builds going again.
sound/soc/sof/core.c | 22 ++++++++++++++++++++++ sound/soc/sof/sof-of-dev.c | 23 ----------------------- sound/soc/sof/sof-of-dev.h | 9 --------- 3 files changed, 22 insertions(+), 32 deletions(-)
sound/soc/sof/core.c +22 -0
@@ -144,6 +144,28 @@ void sof_set_fw_state(struct snd_sof_dev *sdev, enum sof_fw_state new_state) }EXPORT_SYMBOL (sof_set_fw_state); +static struct snd_sof_of_mach *sof_of_machine_select (struct snd_sof_dev *sdev) +{ +struct snd_sof_pdata *sof_pdata = sdev->pdata; +const struct sof_dev_desc *desc = sof_pdata->desc; +struct snd_sof_of_mach *mach = desc->of_machines; + +if (!mach) +return NULL ; + +for (; mach->compatible; mach++) { +if (of_machine_is_compatible (mach->compatible)) { + sof_pdata->tplg_filename = mach->sof_tplg_filename; +if (mach->fw_filename) + sof_pdata->fw_filename = mach->fw_filename; + +return mach; + } + } + +return NULL ; +} +/* SOF Driver enumeration */ static int sof_machine_check (struct snd_sof_dev *sdev) {
sound/soc/sof/sof-of-dev.c +0 -23
@@ -41,29 +41,6 @@ static void sof_of_probe_complete(struct device *dev)pm_runtime_enable (dev); } -struct snd_sof_of_mach *sof_of_machine_select (struct snd_sof_dev *sdev) -{ -struct snd_sof_pdata *sof_pdata = sdev->pdata; -const struct sof_dev_desc *desc = sof_pdata->desc; -struct snd_sof_of_mach *mach = desc->of_machines; - -if (!mach) -return NULL ; - -for (; mach->compatible; mach++) { -if (of_machine_is_compatible (mach->compatible)) { - sof_pdata->tplg_filename = mach->sof_tplg_filename; -if (mach->fw_filename) - sof_pdata->fw_filename = mach->fw_filename; - -return mach; - } - } - -return NULL ; -} -EXPORT_SYMBOL (sof_of_machine_select); -int sof_of_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;
sound/soc/sof/sof-of-dev.h +0 -9
@@ -16,15 +16,6 @@ struct snd_sof_of_mach {const char *sof_tplg_filename; }; -#if IS_ENABLED (CONFIG_SND_SOC_SOF_OF_DEV ) -struct snd_sof_of_mach *sof_of_machine_select (struct snd_sof_dev *sdev); -#else -static inline struct snd_sof_of_mach *sof_of_machine_select (struct snd_sof_dev *sdev) -{ -return NULL ; -} -#endif -extern const struct dev_pm_ops sof_of_pm;int sof_of_probe (struct platform_device *pdev);
Signature · 1 line
2.43.0.rc2.451.g8631bc7472-goog
Quoted 6 lines · Chen-Yu Tsai
This reverts commit
014fdeb0d747304111cfecf93df4407c1a0c80db.Commit
014fdeb0d747("ASoC: SOF: Movesof_of_machine_select()tosof-of-dev.cfromsof-audio.c") caused a circular dependency between thesnd_sofandsnd_sof_ofmodules:
Quoted 7 lines
depmod: ERROR: Cycle detected: snd_sof -> snd_sof_of -> snd_sof depmod: ERROR: Found 2 modules in dependency cycles!Move the function back with
sof_machine_select().Fixes 014fdeb0d747 ("ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c")Signed-off-by Chen-Yu Tsai <[email protected]>
Oh, I have re-done the compile test and that does not detect this (I don't have ARM device to runtime test it), but looks valid. I wonder if we should do this similarly to acpi machine select via ops to cut the circular dependency?
That can be done in a followup patch.
Quoted 96 lines
---
Not sure what the proper arrangement would be, but this gets my builds going again.sound/soc/sof/core.c | 22 ++++++++++++++++++++++ sound/soc/sof/sof-of-dev.c | 23 ----------------------- sound/soc/sof/sof-of-dev.h | 9 --------- 3 files changed, 22 insertions(+), 32 deletions(-)sound/soc/sof/core.c +22
-0@@ -144,6 +144,28 @@ void sof_set_fw_state(struct snd_sof_dev *sdev, enum sof_fw_state new_state) }EXPORT_SYMBOL (sof_set_fw_state); +static struct snd_sof_of_mach *sof_of_machine_select (struct snd_sof_dev *sdev) +{ +struct snd_sof_pdata *sof_pdata = sdev->pdata; +const struct sof_dev_desc *desc = sof_pdata->desc; +struct snd_sof_of_mach *mach = desc->of_machines; + +if (!mach) +return NULL ; + +for (; mach->compatible; mach++) { +if (of_machine_is_compatible (mach->compatible)) { + sof_pdata->tplg_filename = mach->sof_tplg_filename; +if (mach->fw_filename) + sof_pdata->fw_filename = mach->fw_filename; + +return mach; + } + } + +return NULL ; +} +/* SOF Driver enumeration */ static int sof_machine_check (struct snd_sof_dev *sdev) {sound/soc/sof/sof-of-dev.c +0
-23@@ -41,29 +41,6 @@ static void sof_of_probe_complete(struct device *dev)pm_runtime_enable (dev); } -struct snd_sof_of_mach *sof_of_machine_select (struct snd_sof_dev *sdev) -{ -struct snd_sof_pdata *sof_pdata = sdev->pdata; -const struct sof_dev_desc *desc = sof_pdata->desc; -struct snd_sof_of_mach *mach = desc->of_machines; - -if (!mach) -return NULL ; - -for (; mach->compatible; mach++) { -if (of_machine_is_compatible (mach->compatible)) { - sof_pdata->tplg_filename = mach->sof_tplg_filename; -if (mach->fw_filename) - sof_pdata->fw_filename = mach->fw_filename; - -return mach; - } - } - -return NULL ; -} -EXPORT_SYMBOL (sof_of_machine_select); -int sof_of_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;sound/soc/sof/sof-of-dev.h +0
-9@@ -16,15 +16,6 @@ struct snd_sof_of_mach {const char *sof_tplg_filename; }; -#if IS_ENABLED (CONFIG_SND_SOC_SOF_OF_DEV ) -struct snd_sof_of_mach *sof_of_machine_select (struct snd_sof_dev *sdev); -#else -static inline struct snd_sof_of_mach *sof_of_machine_select (struct snd_sof_dev *sdev) -{ -return NULL ; -} -#endif -extern const struct dev_pm_ops sof_of_pm;int sof_of_probe (struct platform_device *pdev);
Signature · 1 line
Péter
Quoted 7 lines · Chen-Yu Tsai
This reverts commit
014fdeb0d747304111cfecf93df4407c1a0c80db.Commit
014fdeb0d747("ASoC: SOF: Movesof_of_machine_select()tosof-of-dev.cfromsof-audio.c") caused a circular dependency between thesnd_sofandsnd_sof_ofmodules:
Quoted 7 lines
depmod: ERROR: Cycle detected:
snd_sof->snd_sof_of->snd_sof
depmod: ERROR: Found 2 modules in dependency cycles!Move the function back with
sof_machine_select().Fixes 014fdeb0d747 ("ASoC: SOF: Move sof_of_machine_select() to sof-of-dev.c from sof-audio.c")Signed-off-by Chen-Yu Tsai <[email protected]>
Thanks for fixing this.
Mark Brown
maintainerQuoted 1 line · Chen-Yu Tsai
This reverts commit
014fdeb0d747304111cfecf93df4407c1a0c80db.
Please include human readable descriptions of things like commits and issues being discussed in e-mail in your mails, this makes them much easier for humans to read especially when they have no internet access. I do frequently catch up on my mail on flights or while otherwise travelling so this is even more pressing for me than just being about making things a bit easier to read.
Mark Brown
maintainerQuoted 10 lines · Chen-Yu Tsai
This reverts commit
014fdeb0d747304111cfecf93df4407c1a0c80db.Commit
014fdeb0d747("ASoC: SOF: Movesof_of_machine_select()tosof-of-dev.cfromsof-audio.c") caused a circular dependency between thesnd_sofandsnd_sof_ofmodules:depmod: ERROR: Cycle detected: snd_sof -> snd_sof_of -> snd_sof depmod: ERROR: Found 2 modules in dependency cycles![...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: Move sof_of_machine_select() to core.c from sof-of-dev.c
commit: d0ae9dc48e24f5f704abcbb2dca3e4651bf0ff59
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
Mark Brown
maintainerQuoted 5 lines · Chen-Yu Tsai
This reverts commit
014fdeb0d747304111cfecf93df4407c1a0c80db.Commit
014fdeb0d747("ASoC: SOF: Movesof_of_machine_select()tosof-of-dev.cfromsof-audio.c") caused a circular dependency between thesnd_sofandsnd_sof_ofmodules:
This doesn't apply against current code, please check and resend.
Please include human readable descriptions of things like commits and issues being discussed in e-mail in your mails, this makes them much easier for humans to read especially when they have no internet access. I do frequently catch up on my mail on flights or while otherwise travelling so this is even more pressing for me than just being about making things a bit easier to read.