ALSA/ASoC/SOF/SoundWire: fix Kconfig issues
Subsystems (4)
cover ALSA/ASoC/SOF/SoundWire: fix Kconfig issues
In January, Intel kbuild bot and Arnd Bergmann reported multiple issues with randconfig. This patchset builds on Arnd's suggestions to
a) expose ACPI and PCI devices in separate modules, while sof-acpi-dev and sof-pci-dev become helpers. This will result in minor changes required for developers/testers, i.e. modprobe snd-sof-pci will no longer result in a probe. The SOF CI was already updated to deal with this module dependency change and introduction of new modules.
b) Fix SOF/SoundWire/DSP_config dependencies by moving the code required to detect SoundWire presence in ACPI tables to sound/hda.
Integration note:
This patchset touches directories maintained by Vinod, Takashi and Mark in separate trees, and will impact additional changes to use the auxiliary bus in drivers/soundwire/.
I can think of two options, both of which are fine:
1. Mark merges the patches with Vinod and Takashi Acked-by tags, then Mark provides an immutable tag to Vinod.
2. Vinod merges the patches with Mark and Takashi Acked-by tags, then Vinod provides an immutable tag to Mark
Acknowledgements:
Thanks to Arnd for suggesting fixes and testing these patches with more randconfigs.
Thanks to Vinod Koul for his feedback on the move of this common helper to sound/hda/
Arnd Bergmann (1):
ASoC: SOF: ACPI: avoid reverse module dependency
Pierre-Louis Bossart (6):
ASoC: soc-acpi: allow for partial match in parent name
ASoC: SOF: pci: split PCI into different drivers
ASoC: SOF: pci: move DSP_CONFIG use to platform-specific drivers
ASoC: SOF: Intel: SoundWire: simplify Kconfig
ALSA: hda: move Intel SoundWire ACPI scan to dedicated module
ALSA: hda: intel-sdw-acpi: add missing include files
drivers/soundwire/intel.h | 2 - drivers/soundwire/intel_init.c | 158 ------------- include/linux/soundwire/sdw_intel.h | 2 + include/sound/soc-acpi.h | 2 +- sound/hda/Kconfig | 4 + sound/hda/Makefile | 3 + sound/hda/intel-dsp-config.c | 2 +- sound/hda/intel-sdw-acpi.c | 179 +++++++++++++++ sound/soc/sof/Kconfig | 15 +- sound/soc/sof/Makefile | 4 +- sound/soc/sof/intel/Kconfig | 254 +++++++-------------- sound/soc/sof/intel/Makefile | 20 +- sound/soc/sof/intel/bdw.c | 67 +++++- sound/soc/sof/intel/byt.c | 106 ++++++++- sound/soc/sof/intel/hda.c | 18 ++ sound/soc/sof/intel/hda.h | 3 + sound/soc/sof/intel/pci-apl.c | 81 +++++++ sound/soc/sof/intel/pci-cnl.c | 104 +++++++++ sound/soc/sof/intel/pci-icl.c | 84 +++++++ sound/soc/sof/intel/pci-tgl.c | 121 ++++++++++ sound/soc/sof/intel/pci-tng.c | 70 ++++++ sound/soc/sof/intel/shim.h | 6 - sound/soc/sof/sof-acpi-dev.c | 130 +---------- sound/soc/sof/sof-acpi-dev.h | 16 ++ sound/soc/sof/sof-pci-dev.c | 340 +--------------------------- sound/soc/sof/sof-pci-dev.h | 17 ++ 26 files changed, 998 insertions(+), 810 deletions(-) create mode 100644 sound/hda/intel-sdw-acpi.c create mode 100644 sound/soc/sof/intel/pci-apl.c create mode 100644 sound/soc/sof/intel/pci-cnl.c create mode 100644 sound/soc/sof/intel/pci-icl.c create mode 100644 sound/soc/sof/intel/pci-tgl.c create mode 100644 sound/soc/sof/intel/pci-tng.c create mode 100644 sound/soc/sof/sof-acpi-dev.h create mode 100644 sound/soc/sof/sof-pci-dev.h
Signature · 1 line
2.25.1
PATCH 1/7 ASoC: soc-acpi: allow for partial match in parent name
To change the module dependencies and simplify Kconfigs, we need to introduce new driver names (sof-audio-acpi-intel-byt and sof-audio-acpi-intel-bdw), and move from an exact string match to a partial one.
--- include/sound/soc-acpi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/sound/soc-acpi.h +1 -1
@@ -174,7 +174,7 @@ struct snd_soc_acpi_codecs {static inline bool snd_soc_acpi_sof_parent (struct device *dev) {return dev->parent && dev->parent->driver && dev->parent->driver->name && - !strcmp (dev->parent->driver->name,"sof-audio-acpi" ); + !strncmp (dev->parent->driver->name,"sof-audio-acpi" ,strlen ("sof-audio-acpi" )); }#endif
Signature · 1 line
2.25.1
PATCH 2/7 ASoC: SOF: ACPI: avoid reverse module dependency
In reply to Pierre-Louis BossartFrom: Arnd Bergmann <[email protected]>
The SOF-ACPI driver is backwards from the normal Linux model, it has a generic driver that knows about all the specific drivers, as opposed to having hardware specific drivers that link against a common framework.
This requires ugly Kconfig magic and leads to missed dependencies as seen in this link error:
arm-linux-gnueabi-ld: sound/soc/sof/sof-pci-dev.o: in function `sof_acpi_probe':
sof-pci-dev.c:(.text+0x1c): undefined reference to `snd_intel_dsp_driver_probe'
Change it to use the normal probe order of starting with a specific device in a driver, turning the sof-acpi-dev.c driver into a library (exported symbols are name-spaced to avoid symbol pollution).
For backwards-compatibility with previous Kconfigs, the default values for platform drivers uses the top-level ACPI configurations. The modules were also renamed to allow for gradual transitions in test scripts.
--- sound/soc/sof/Kconfig | 8 ++- sound/soc/sof/Makefile | 2 +- sound/soc/sof/intel/Kconfig | 48 +++++-------- sound/soc/sof/intel/Makefile | 8 +-- sound/soc/sof/intel/bdw.c | 67 ++++++++++++++++-- sound/soc/sof/intel/byt.c | 106 +++++++++++++++++++++++++--- sound/soc/sof/intel/shim.h | 6 -- sound/soc/sof/sof-acpi-dev.c | 130 +++-------------------------------- sound/soc/sof/sof-acpi-dev.h | 16 +++++ 9 files changed, 215 insertions(+), 176 deletions(-) create mode 100644 sound/soc/sof/sof-acpi-dev.h
sound/soc/sof/Kconfig +5 -3
@@ -23,15 +23,17 @@ config SND_SOC_SOF_PCI config SND_SOC_SOF_ACPI tristate "SOF ACPI enumeration support" depends on ACPI || COMPILE_TEST - select SND_SOC_SOF - select SND_SOC_ACPI if ACPI - select IOSF_MBI if X86 && PCI help This adds support for ACPI enumeration. This option is required to enable Intel Broadwell/Baytrail/Cherrytrail devices. + For backwards-compatibility with previous configurations the selection will + be used as default for platform-specific drivers. Say Y if you need this option. If unsure select "N". +config SND_SOC_SOF_ACPI_DEV + tristate + config SND_SOC_SOF_OF tristate "SOF OF enumeration support" depends on OF || COMPILE_TEST
sound/soc/sof/Makefile +1 -1
@@ -14,7 +14,7 @@ obj-$(CONFIG_SND_SOC_SOF) += snd-sof.o obj-$(CONFIG_SND_SOC_SOF_NOCODEC) += snd-sof-nocodec.o -obj-$(CONFIG_SND_SOC_SOF_ACPI) += snd-sof-acpi.o +obj-$(CONFIG_SND_SOC_SOF_ACPI_DEV) += snd-sof-acpi.o obj-$(CONFIG_SND_SOC_SOF_OF) += snd-sof-of.o obj-$(CONFIG_SND_SOC_SOF_PCI) += snd-sof-pci.o
sound/soc/sof/intel/Kconfig +17 -31
81 lines not on this page · raw message
sound/soc/sof/intel/Makefile +4 -4
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) -snd-sof-intel-byt-objs := byt.o -snd-sof-intel-bdw-objs := bdw.o +snd-sof-acpi-intel-byt-objs := byt.o +snd-sof-acpi-intel-bdw-objs := bdw.o snd-sof-intel-ipc-objs := intel-ipc.o
@@ -13,8 +13,8 @@ snd-sof-intel-hda-common-$(CONFIG_SND_SOC_SOF_HDA_PROBES) += hda-compress.o snd-sof-intel-hda-objs := hda-codec.o -obj-$(CONFIG_SND_SOC_SOF_INTEL_ATOM_HIFI_EP) += snd-sof-intel-byt.o -obj-$(CONFIG_SND_SOC_SOF_BROADWELL) += snd-sof-intel-bdw.o +obj-$(CONFIG_SND_SOC_SOF_INTEL_ATOM_HIFI_EP) += snd-sof-acpi-intel-byt.o +obj-$(CONFIG_SND_SOC_SOF_BROADWELL) += snd-sof-acpi-intel-bdw.o obj-$(CONFIG_SND_SOC_SOF_INTEL_HIFI_EP_IPC) += snd-sof-intel-ipc.o obj-$(CONFIG_SND_SOC_SOF_HDA_COMMON) += snd-sof-intel-hda-common.o obj-$(CONFIG_SND_SOC_SOF_HDA) += snd-sof-intel-hda.o
sound/soc/sof/intel/bdw.c +63 -4
92 lines not on this page · raw message
sound/soc/sof/intel/byt.c +98 -8
145 lines not on this page · raw message
sound/soc/sof/intel/shim.h +0 -6
@@ -167,13 +167,7 @@ struct sof_intel_dsp_desc { };extern const struct snd_sof_dsp_ops sof_tng_ops; -extern const struct snd_sof_dsp_ops sof_byt_ops; -extern const struct snd_sof_dsp_ops sof_cht_ops; -extern const struct snd_sof_dsp_ops sof_bdw_ops; -extern const struct sof_intel_dsp_desc byt_chip_info; -extern const struct sof_intel_dsp_desc cht_chip_info; -extern const struct sof_intel_dsp_desc bdw_chip_info;extern const struct sof_intel_dsp_desc tng_chip_info;struct sof_intel_stream {
sound/soc/sof/sof-acpi-dev.c +11 -119
182 lines not on this page · raw message
sound/soc/sof/sof-acpi-dev.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ +/* +* This file is provided under a dual BSD/GPLv2 license. When using or +* redistributing this file, you may do so under either license. +* +* Copyright(c) 2021 Intel Corporation. All rights reserved. +*/ + +#ifndef __SOUND_SOC_SOF_ACPI_H +#define __SOUND_SOC_SOF_ACPI_H + +extern const struct dev_pm_ops sof_acpi_pm; +int sof_acpi_probe (struct platform_device *pdev,const struct sof_dev_desc *desc); +int sof_acpi_remove (struct platform_device *pdev); + +#endif
Signature · 1 line
2.25.1
PATCH 3/7 ASoC: SOF: pci: split PCI into different drivers
In reply to Pierre-Louis BossartMove PCI IDs and device-specific definitions out of common code. No functionality change for now, just code split and removal of IF_ENABLED() which made the configurations too complicated in case of reuse of IP across generations.
Additional changes to address the DSP_CONFIG case and SoundWire depends/select confusions are provided in follow-up patches.
--- sound/soc/sof/Kconfig | 7 +- sound/soc/sof/Makefile | 2 +- sound/soc/sof/intel/Kconfig | 179 ++++++------------ sound/soc/sof/intel/Makefile | 12 ++ sound/soc/sof/intel/pci-apl.c | 81 +++++++++ sound/soc/sof/intel/pci-cnl.c | 104 +++++++++++ sound/soc/sof/intel/pci-icl.c | 84 +++++++++ sound/soc/sof/intel/pci-tgl.c | 121 +++++++++++++ sound/soc/sof/intel/pci-tng.c | 70 +++++++ sound/soc/sof/sof-pci-dev.c | 332 +--------------------------------- sound/soc/sof/sof-pci-dev.h | 17 ++ 11 files changed, 562 insertions(+), 447 deletions(-) create mode 100644 sound/soc/sof/intel/pci-apl.c create mode 100644 sound/soc/sof/intel/pci-cnl.c create mode 100644 sound/soc/sof/intel/pci-icl.c create mode 100644 sound/soc/sof/intel/pci-tgl.c create mode 100644 sound/soc/sof/intel/pci-tng.c create mode 100644 sound/soc/sof/sof-pci-dev.h
sound/soc/sof/Kconfig +5 -2
@@ -9,14 +9,17 @@ config SND_SOC_SOF_TOPLEVEL if SND_SOC_SOF_TOPLEVEL +config SND_SOC_SOF_PCI_DEV + tristate + config SND_SOC_SOF_PCI tristate "SOF PCI enumeration support" depends on PCI - select SND_SOC_SOF - select SND_SOC_ACPI if ACPI help This adds support for PCI enumeration. This option is required to enable Intel Skylake+ devices. + For backwards-compatibility with previous configurations the selection will + be used as default for platform-specific drivers. Say Y if you need this option. If unsure select "N".
sound/soc/sof/Makefile +1 -1
@@ -16,7 +16,7 @@ obj-$(CONFIG_SND_SOC_SOF_NOCODEC) += snd-sof-nocodec.o obj-$(CONFIG_SND_SOC_SOF_ACPI_DEV) += snd-sof-acpi.o obj-$(CONFIG_SND_SOC_SOF_OF) += snd-sof-of.o -obj-$(CONFIG_SND_SOC_SOF_PCI) += snd-sof-pci.o +obj-$(CONFIG_SND_SOC_SOF_PCI_DEV) += snd-sof-pci.o obj-$(CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL) += intel/ obj-$(CONFIG_SND_SOC_SOF_IMX_TOPLEVEL) += imx/
sound/soc/sof/intel/Kconfig +58 -121
268 lines not on this page · raw message
sound/soc/sof/intel/Makefile +12 -0
@@ -18,3 +18,15 @@ obj-$(CONFIG_SND_SOC_SOF_BROADWELL) += snd-sof-acpi-intel-bdw.o obj-$(CONFIG_SND_SOC_SOF_INTEL_HIFI_EP_IPC) += snd-sof-intel-ipc.o obj-$(CONFIG_SND_SOC_SOF_HDA_COMMON) += snd-sof-intel-hda-common.o obj-$(CONFIG_SND_SOC_SOF_HDA) += snd-sof-intel-hda.o + +snd-sof-pci-intel-tng-objs := pci-tng.o +snd-sof-pci-intel-apl-objs := pci-apl.o +snd-sof-pci-intel-cnl-objs := pci-cnl.o +snd-sof-pci-intel-icl-objs := pci-icl.o +snd-sof-pci-intel-tgl-objs := pci-tgl.o + +obj-$(CONFIG_SND_SOC_SOF_MERRIFIELD) += snd-sof-pci-intel-tng.o +obj-$(CONFIG_SND_SOC_SOF_INTEL_APL) += snd-sof-pci-intel-apl.o +obj-$(CONFIG_SND_SOC_SOF_INTEL_CNL) += snd-sof-pci-intel-cnl.o +obj-$(CONFIG_SND_SOC_SOF_INTEL_ICL) += snd-sof-pci-intel-icl.o +obj-$(CONFIG_SND_SOC_SOF_INTEL_TGL) += snd-sof-pci-intel-tgl.o
sound/soc/sof/intel/pci-apl.c new file +81 -0
81 lines not on this page · raw message
sound/soc/sof/intel/pci-cnl.c new file +104 -0
104 lines not on this page · raw message
sound/soc/sof/intel/pci-icl.c new file +84 -0
84 lines not on this page · raw message
sound/soc/sof/intel/pci-tgl.c new file +121 -0
121 lines not on this page · raw message
sound/soc/sof/intel/pci-tng.c new file +70 -0
70 lines not on this page · raw message
sound/soc/sof/sof-pci-dev.c +9 -323
372 lines not on this page · raw message
sound/soc/sof/sof-pci-dev.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ +/* +* This file is provided under a dual BSD/GPLv2 license. When using or +* redistributing this file, you may do so under either license. +* +* Copyright(c) 2021 Intel Corporation. All rights reserved. +*/ + +#ifndef __SOUND_SOC_SOF_PCI_H +#define __SOUND_SOC_SOF_PCI_H + +extern const struct dev_pm_ops sof_pci_pm; +int sof_pci_probe (struct pci_dev *pci,const struct pci_device_id *pci_id); +void sof_pci_remove (struct pci_dev *pci); +void sof_pci_shutdown (struct pci_dev *pci); + +#endif
Signature · 1 line
2.25.1
PATCH 4/7 ASoC: SOF: pci: move DSP_CONFIG use to platform-specific drivers
In reply to Pierre-Louis BossartThere is no reason why we should call the intel_dspcfg helpers from common code, this should be moved in Intel-specific code and only called from platforms where a conflict may occur with the HDaudio or SST/Skylake driver.
--- sound/soc/sof/intel/hda.c | 17 +++++++++++++++++ sound/soc/sof/intel/hda.h | 3 +++ sound/soc/sof/intel/pci-apl.c | 2 +- sound/soc/sof/intel/pci-cnl.c | 2 +- sound/soc/sof/intel/pci-icl.c | 2 +- sound/soc/sof/intel/pci-tgl.c | 2 +- sound/soc/sof/sof-pci-dev.c | 8 -------- 7 files changed, 24 insertions(+), 12 deletions(-)
sound/soc/sof/intel/hda.c +17 -0
@@ -22,10 +22,12 @@#include <linux/module.h> #include <linux/soundwire/sdw.h> #include <linux/soundwire/sdw_intel.h> +#include <sound/intel-dsp-config.h> #include <sound/intel-nhlt.h> #include <sound/sof.h> #include <sound/sof/xtensa.h> #include "../sof-audio.h" +#include "../sof-pci-dev.h" #include "../ops.h" #include "hda.h"
@@ -1256,7 +1258,22 @@ void hda_machine_select(struct snd_sof_dev *sdev)dev_warn (sdev->dev,"warning: No matching ASoC machine driver found\n" ); } +int hda_pci_intel_probe (struct pci_dev *pci,const struct pci_device_id *pci_id) +{ +int ret; + + ret =snd_intel_dsp_driver_probe (pci); +if (ret !=SND_INTEL_DSP_DRIVER_ANY && ret !=SND_INTEL_DSP_DRIVER_SOF ) { +dev_dbg (&pci->dev,"SOF PCI driver not selected, aborting probe\n" ); +return -ENODEV ; + } + +return sof_pci_probe (pci, pci_id); +} +EXPORT_SYMBOL_NS (hda_pci_intel_probe,SND_SOC_SOF_INTEL_HDA_COMMON ); +MODULE_LICENSE ("Dual BSD/GPL" ); +MODULE_IMPORT_NS (SND_SOC_SOF_PCI_DEV );MODULE_IMPORT_NS (SND_SOC_SOF_HDA_AUDIO_CODEC );MODULE_IMPORT_NS (SND_SOC_SOF_HDA_AUDIO_CODEC_I915 );MODULE_IMPORT_NS (SND_SOC_SOF_XTENSA );
sound/soc/sof/intel/hda.h +3 -0
@@ -764,4 +764,7 @@ void hda_machine_select(struct snd_sof_dev *sdev);void hda_set_mach_params (const struct snd_soc_acpi_mach *mach,struct device *dev); +/* PCI driver selection and probe */ +int hda_pci_intel_probe (struct pci_dev *pci,const struct pci_device_id *pci_id); +#endif
sound/soc/sof/intel/pci-apl.c +1 -1
@@ -67,7 +67,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids);static struct pci_driver snd_sof_pci_intel_apl_driver = { .name ="sof-audio-pci-intel-apl" , .id_table = sof_pci_ids, - .probe = sof_pci_probe, + .probe = hda_pci_intel_probe, .remove = sof_pci_remove, .shutdown = sof_pci_shutdown, .driver = {
sound/soc/sof/intel/pci-cnl.c +1 -1
@@ -90,7 +90,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids);static struct pci_driver snd_sof_pci_intel_cnl_driver = { .name ="sof-audio-pci-intel-cnl" , .id_table = sof_pci_ids, - .probe = sof_pci_probe, + .probe = hda_pci_intel_probe, .remove = sof_pci_remove, .shutdown = sof_pci_shutdown, .driver = {
sound/soc/sof/intel/pci-icl.c +1 -1
@@ -70,7 +70,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids);static struct pci_driver snd_sof_pci_intel_icl_driver = { .name ="sof-audio-pci-intel-icl" , .id_table = sof_pci_ids, - .probe = sof_pci_probe, + .probe = hda_pci_intel_probe, .remove = sof_pci_remove, .shutdown = sof_pci_shutdown, .driver = {
sound/soc/sof/intel/pci-tgl.c +1 -1
@@ -106,7 +106,7 @@ MODULE_DEVICE_TABLE(pci, sof_pci_ids);static struct pci_driver snd_sof_pci_intel_tgl_driver = { .name ="sof-audio-pci-intel-tgl" , .id_table = sof_pci_ids, - .probe = sof_pci_probe, + .probe = hda_pci_intel_probe, .remove = sof_pci_remove, .shutdown = sof_pci_shutdown, .driver = {
sound/soc/sof/sof-pci-dev.c +0 -8
@@ -13,7 +13,6 @@#include <linux/module.h> #include <linux/pci.h> #include <linux/pm_runtime.h> -#include <sound/intel-dsp-config.h> #include <sound/soc-acpi.h> #include <sound/soc-acpi-intel-match.h> #include <sound/sof.h>
@@ -120,13 +119,6 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)const struct snd_sof_dsp_ops *ops;int ret; -if (IS_REACHABLE (CONFIG_SND_INTEL_DSP_CONFIG )) { - ret =snd_intel_dsp_driver_probe (pci); -if (ret !=SND_INTEL_DSP_DRIVER_ANY && ret !=SND_INTEL_DSP_DRIVER_SOF ) { -dev_dbg (&pci->dev,"SOF PCI driver not selected, aborting probe\n" ); -return -ENODEV ; - } - }dev_dbg (&pci->dev,"PCI DSP detected" );/* get ops for platform */
Signature · 1 line
2.25.1
PATCH 5/7 ASoC: SOF: Intel: SoundWire: simplify Kconfig
In reply to Pierre-Louis BossartThe Kconfig file is way too convoluted. Track platforms where SoundWire is supported, and add simpler conditions to make sure there is no module/built-in issue.
The use of 'depends on' is less intuitive if a required 'depend' is missing, but that's a small price to pay for clarity and simplicity.
--- sound/soc/sof/intel/Kconfig | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-)
sound/soc/sof/intel/Kconfig +9 -17
@@ -276,29 +276,21 @@ config SND_SOC_SOF_HDA This option is not user-selectable but automagically handled by 'select' statements at a higher level. -config SND_SOC_SOF_INTEL_SOUNDWIRE_LINK - bool "SOF support for SoundWire" - depends on ACPI - help - This adds support for SoundWire with Sound Open Firmware - for Intel(R) platforms. - Say Y if you want to enable SoundWire links with SOF. - If unsure select "N". - config SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE tristate - select SND_SOC_SOF_INTEL_SOUNDWIRE if SND_SOC_SOF_INTEL_SOUNDWIRE_LINK - help - This option is not user-selectable but automagically handled by - 'select' statements at a higher level. config SND_SOC_SOF_INTEL_SOUNDWIRE - tristate - select SOUNDWIRE + tristate "SOF support for SoundWire" + default SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE + depends on SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE + depends on ACPI && SOUNDWIRE + depends on !(SOUNDWIRE=m && SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE=y) select SOUNDWIRE_INTEL help - This option is not user-selectable but automagically handled by - 'select' statements at a higher level. + This adds support for SoundWire with Sound Open Firmware + for Intel(R) platforms. + Say Y if you want to enable SoundWire links with SOF. + If unsure select "N". endif ## SND_SOC_SOF_INTEL_PCI
Signature · 1 line
2.25.1
PATCH 6/7 ALSA: hda: move Intel SoundWire ACPI scan to dedicated module
In reply to Pierre-Louis BossartThe ACPI scan capabilities is called from the intel-dspconfig as well as the SOF/HDaudio drivers. This creates dependencies and randconfig issues when HDaudio and SOF/SoundWire are not all configured as modules.
To simplify Kconfig dependencies between HDAudio, SoundWire, SOF and intel-dspconfig, move the ACPI scan helpers to a dedicated module. This follows the same idea as NHLT helpers which are already handled as a dedicated module.
The only functional change is that the kernel parameter to filter links is now handled by a different module, but that was only provided for developers needing work-arounds for early BIOS releases.
--- drivers/soundwire/intel.h | 2 - drivers/soundwire/intel_init.c | 158 ------------------------- include/linux/soundwire/sdw_intel.h | 2 + sound/hda/Kconfig | 4 + sound/hda/Makefile | 3 + sound/hda/intel-dsp-config.c | 2 +- sound/hda/intel-sdw-acpi.c | 174 ++++++++++++++++++++++++++++ sound/soc/sof/intel/Kconfig | 1 + sound/soc/sof/intel/hda.c | 1 + 9 files changed, 186 insertions(+), 161 deletions(-) create mode 100644 sound/hda/intel-sdw-acpi.c
drivers/soundwire/intel.h +0 -2
@@ -48,8 +48,6 @@ struct sdw_intel {#endif }; -#define SDW_INTEL_QUIRK_MASK_BUS_DISABLE BIT(1) -int intel_master_startup (struct platform_device *pdev);int intel_master_process_wakeen_event (struct platform_device *pdev);
drivers/soundwire/intel_init.c +0 -158
182 lines not on this page · raw message
include/linux/soundwire/sdw_intel.h +2 -0
@@ -187,4 +187,6 @@ void sdw_intel_enable_irq(void __iomem *mmio_base, bool enable);irqreturn_t sdw_intel_thread (int irq,void *dev_id); +#define SDW_INTEL_QUIRK_MASK_BUS_DISABLE BIT(1) +#endif
sound/hda/Kconfig +4 -0
@@ -44,9 +44,13 @@ config SND_INTEL_NHLT config SND_INTEL_DSP_CONFIG tristate select SND_INTEL_NHLT if ACPI + select SND_INTEL_SOUNDWIRE_ACPI if ACPI # this config should be selected only for Intel DSP platforms. # A fallback is provided so that the code compiles in all cases. +config SND_INTEL_SOUNDWIRE_ACPI + tristate + config SND_INTEL_BYT_PREFER_SOF bool "Prefer SOF driver over SST on BY/CHT platforms" depends on SND_SST_ATOM_HIFI2_PLATFORM_ACPI && SND_SOC_SOF_BAYTRAIL
sound/hda/Makefile +3 -0
@@ -17,3 +17,6 @@ obj-$(CONFIG_SND_HDA_EXT_CORE) += ext/ snd-intel-dspcfg-objs := intel-dsp-config.o snd-intel-dspcfg-$(CONFIG_SND_INTEL_NHLT) += intel-nhlt.o obj-$(CONFIG_SND_INTEL_DSP_CONFIG) += snd-intel-dspcfg.o + +snd-intel-sdw-acpi-objs := intel-sdw-acpi.o +obj-$(CONFIG_SND_INTEL_SOUNDWIRE_ACPI) += snd-intel-sdw-acpi.o
sound/hda/intel-dsp-config.c +1 -1
@@ -557,4 +557,4 @@ EXPORT_SYMBOL_GPL(snd_intel_acpi_dsp_driver_probe);MODULE_LICENSE ("GPL v2" );MODULE_DESCRIPTION ("Intel DSP config driver" ); -MODULE_IMPORT_NS (SOUNDWIRE_INTEL_INIT ); +MODULE_IMPORT_NS (SND_INTEL_SOUNDWIRE_ACPI );
sound/hda/intel-sdw-acpi.c new file +174 -0
174 lines not on this page · raw message
sound/soc/sof/intel/Kconfig +1 -0
@@ -286,6 +286,7 @@ config SND_SOC_SOF_INTEL_SOUNDWIRE depends on ACPI && SOUNDWIRE depends on !(SOUNDWIRE=m && SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE=y) select SOUNDWIRE_INTEL + select SND_INTEL_SOUNDWIRE_ACPI help This adds support for SoundWire with Sound Open Firmware for Intel(R) platforms.
sound/soc/sof/intel/hda.c +1 -0
@@ -1277,4 +1277,5 @@ MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);MODULE_IMPORT_NS (SND_SOC_SOF_HDA_AUDIO_CODEC );MODULE_IMPORT_NS (SND_SOC_SOF_HDA_AUDIO_CODEC_I915 );MODULE_IMPORT_NS (SND_SOC_SOF_XTENSA ); +MODULE_IMPORT_NS (SND_INTEL_SOUNDWIRE_ACPI );MODULE_IMPORT_NS (SOUNDWIRE_INTEL_INIT );
Signature · 1 line
2.25.1
Re: [PATCH 6/7] ALSA: hda: move Intel SoundWire ACPI scan to dedicated module
Quoted 13 lines · Pierre-Louis Bossart
The ACPI scan capabilities is called from the intel-dspconfig as well as the SOF/HDaudio drivers. This creates dependencies and randconfig issues when HDaudio and SOF/SoundWire are not all configured as modules.
To simplify
Kconfigdependencies between HDAudio, SoundWire, SOF and intel-dspconfig, move the ACPI scan helpers to a dedicated module. This follows the same idea as NHLT helpers which are already handled as a dedicated module.The only functional change is that the kernel parameter to filter links is now handled by a different module, but that was only provided for developers needing work-arounds for early BIOS releases.
Quoted 8 lines
Reported-by Arnd Bergmann <[email protected]>Signed-off-by Pierre-Louis Bossart <[email protected]>Reviewed-by Kai Vehmanen <[email protected]>Reviewed-by Guennadi Liakhovetski <[email protected]>Reviewed-by Bard Liao <[email protected]>--- drivers/soundwire/intel.h | 2 - drivers/soundwire/intel_init.c | 158 -------------------------
Signature · 1 line
~Vinod
PATCH 7/7 ALSA: hda: intel-sdw-acpi: add missing include files
In reply to Pierre-Louis BossartWe rely on implicit includes, list out explicitly what this code relies on.
--- sound/hda/intel-sdw-acpi.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/hda/intel-sdw-acpi.c +5 -0
@@ -6,7 +6,12 @@*/ #include <linux/acpi.h> +#include <linux/bits.h> +#include <linux/bitfield.h> +#include <linux/device.h> +#include <linux/errno.h> #include <linux/export.h> +#include <linux/fwnode.h> #include <linux/module.h> #include <linux/soundwire/sdw_intel.h> #include <linux/string.h>
Signature · 1 line
2.25.1
Quoted 2 lines · Pierre-Louis Bossart
In January, Intel kbuild bot and Arnd Bergmann reported multiple issues with randconfig. This patchset builds on Arnd's suggestions to
Quoted 13 lines · Pierre-Louis Bossart
In January, Intel kbuild bot and Arnd Bergmann reported multiple issues with randconfig. This patchset builds on Arnd's suggestions to
a) expose ACPI and PCI devices in separate modules, while sof-acpi-dev and sof-pci-dev become helpers. This will result in minor changes required for developers/testers, i.e. modprobe snd-sof-pci will no longer result in a probe. The SOF CI was already updated to deal with this module dependency change and introduction of new modules.
b) Fix SOF/SoundWire/DSP_config dependencies by moving the code required to detect SoundWire presence in ACPI tables to
sound/hda.
Quoted 9 lines
Integration note:
This patchset touches directories maintained by Vinod, Takashi and Mark in separate trees, and will impact additional changes to use the auxiliary bus indrivers/soundwire/.
I can think of two options, both of which are fine:
1. Mark merges the patches with Vinod and Takashi Acked-by tags, then Mark provides an immutable tag to Vinod.
2. Vinod merges the patches with Mark and Takashi Acked-by tags, then Vinod provides an immutable tag to Mark
thanks,
Takashi
Vinod Koul
maintainerQuoted 25 lines · Takashi Iwai
Quoted 13 lines · Pierre-Louis Bossart
In January, Intel kbuild bot and Arnd Bergmann reported multiple issues with randconfig. This patchset builds on Arnd's suggestions to
a) expose ACPI and PCI devices in separate modules, while sof-acpi-dev and sof-pci-dev become helpers. This will result in minor changes required for developers/testers, i.e. modprobe snd-sof-pci will no longer result in a probe. The SOF CI was already updated to deal with this module dependency change and introduction of new modules.
b) Fix SOF/SoundWire/DSP_config dependencies by moving the code required to detect SoundWire presence in ACPI tables to
sound/hda.Quoted 9 lines
Integration note:
This patchset touches directories maintained by Vinod, Takashi and Mark in separate trees, and will impact additional changes to use the auxiliary bus indrivers/soundwire/.
I can think of two options, both of which are fine:
1. Mark merges the patches with Vinod and Takashi Acked-by tags, then Mark provides an immutable tag to Vinod.
2. Vinod merges the patches with Mark and Takashi Acked-by tags, then Vinod provides an immutable tag to Mark
Quoted 1 line
Acked-by Takashi Iwai <[email protected]>
Since most of the changes are sound/ it makes sense for this to go thru sound tree. I have acked the sdw part..
Thanks
Signature · 1 line
~Vinod
Quoted 27 lines · Vinod Koul
Quoted 25 lines · Takashi Iwai
Quoted 22 lines · Pierre-Louis Bossart
In January, Intel kbuild bot and Arnd Bergmann reported multiple issues with randconfig. This patchset builds on Arnd's suggestions to
a) expose ACPI and PCI devices in separate modules, while sof-acpi-dev and sof-pci-dev become helpers. This will result in minor changes required for developers/testers, i.e. modprobe snd-sof-pci will no longer result in a probe. The SOF CI was already updated to deal with this module dependency change and introduction of new modules.
b) Fix SOF/SoundWire/DSP_config dependencies by moving the code required to detect SoundWire presence in ACPI tables to
sound/hda.Integration note:
This patchset touches directories maintained by Vinod, Takashi and Mark in separate trees, and will impact additional changes to use the auxiliary bus indrivers/soundwire/.
I can think of two options, both of which are fine:
1. Mark merges the patches with Vinod and Takashi Acked-by tags, then Mark provides an immutable tag to Vinod.
2. Vinod merges the patches with Mark and Takashi Acked-by tags, then Vinod provides an immutable tag to Mark
Quoted 4 lines
Quoted 1 line
Acked-by Takashi Iwai <[email protected]>Since most of the changes are
sound/it makes sense for this to go thru sound tree. I have acked the sdw part..
OK, I applied those and pushed to topic/sound-sdw-kconfig-fixes
immutable branch. A signed tag, sound-sdw-kconfig-fixes, is found
there, too.
Mark, Vinod, feel free to pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-sdw-kconfig/fixes
I suppose those are supposed to be merged in 5.12? If so, I'm going to merge to for-linus branch as well.
thanks,
Takashi
Quoted 8 lines
OK, I applied those and pushed to topic/sound-sdw-kconfig-fixes
immutable branch. A signed tag, sound-sdw-kconfig-fixes, is found
there, too.Mark, Vinod, feel free to pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.gittags/sound-sdw-kconfig/fixes
Thanks Takashi!
Quoted 2 lines
I suppose those are supposed to be merged in 5.12? If so, I'm going to merge to for-linus branch as well.
We finished those changes rather late in the cycle, so I didn't want to send this before 5.12-rc1 and create issues.
But we've been testing them for at least a month now, so the risk is low if this series was added in an 5.12-rcX branch.
Mark Brown
maintainerQuoted 2 lines · Takashi Iwai
Mark, Vinod, feel free to pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.gittags/sound-sdw-kconfig/fixes
$ git pull git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-sdw-kconfig/fixes fatal: Couldn't find remote ref tags/sound-sdw-kconfig/fixes
forgot to push?
Quoted 7 lines · Mark Brown
Quoted 2 lines · Takashi Iwai
Mark, Vinod, feel free to pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.gittags/sound-sdw-kconfig/fixes$ git pull git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-sdw-kconfig/fixes
Sorry, copy&paste error, it's not with "/fixes" but "-fixes".
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git tags/sound-sdw-kconfig-fixes
Takashi
Mark Brown
maintainerQuoted 3 lines · Takashi Iwai
Sorry, copy&paste error, it's not with "/fixes" but "-fixes".
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.gittags/sound-sdw-kconfig-fixes
Thanks, got it now.
Quoted 23 lines · Pierre-Louis Bossart
In January, Intel kbuild bot and Arnd Bergmann reported multiple issues with randconfig. This patchset builds on Arnd's suggestions to
a) expose ACPI and PCI devices in separate modules, while sof-acpi-dev and sof-pci-dev become helpers. This will result in minor changes required for developers/testers, i.e. modprobe snd-sof-pci will no longer result in a probe. The SOF CI was already updated to deal with this module dependency change and introduction of new modules.
b) Fix SOF/SoundWire/DSP_config dependencies by moving the code required to detect SoundWire presence in ACPI tables to
sound/hda.Integration note:
This patchset touches directories maintained by Vinod, Takashi and Mark in separate trees, and will impact additional changes to use the auxiliary bus indrivers/soundwire/.
I can think of two options, both of which are fine:
1. Mark merges the patches with Vinod and Takashi Acked-by tags, then Mark provides an immutable tag to Vinod.
2. Vinod merges the patches with Mark and Takashi Acked-by tags, then Vinod provides an immutable tag to Mark
Quoted 5 lines
Acknowledgements:
Thanks to Arnd for suggesting fixes and testing these patches with more randconfigs.
Thanks to Vinod Koul for his feedback on the move of this common helper tosound/hda/
Hi Pierre-Louis,
I have not done as much randconfig tested recently as I used to, but since I ramped up the rate again after the merge window, I have unfortunately once more run into a variation of this problem, with CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE=m and CONFIG_SND_SOC_SOF_HDA_COMMON=y:
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_dsp_interrupt_thread':
hda.c:(.text+0x739): undefined reference to `sdw_intel_thread'
x86_64-linux-ld: hda.c:(.text+0x764): undefined reference to `sdw_intel_process_wakeen_event'
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_sdw_int_enable':
hda.c:(.text+0x782): undefined reference to `sdw_intel_enable_irq'
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_sdw_startup':
hda.c:(.text+0x7ac): undefined reference to `sdw_intel_startup'
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_sdw_process_wakeen':
hda.c:(.text+0x7dc): undefined reference to `sdw_intel_process_wakeen_event'
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_dsp_probe':
hda.c:(.text+0xee1): undefined reference to `sdw_intel_probe'
x86_64-linux-ld: sound/soc/sof/intel/hda.o: in function `hda_dsp_remove':
hda.c:(.text+0xf7f): undefined reference to `sdw_intel_enable_irq'
x86_64-linux-ld: hda.c:(.text+0xf8e): undefined reference to `sdw_intel_exit'
This only seems to appear very rarely, as I still did around 25000 randconfig builds since you merged the series, but this config does show the problem for any kernel version between the fix and the latest linux-next:
https://pastebin.com/raw/VCjcB3EU
I have only done the quick bisection but no analysis regarding what we may have missed back in March. I hope you can figure this out.
Arnd
Quoted 26 lines
I have not done as much randconfig tested recently as I used to, but since I ramped up the rate again after the merge window, I have unfortunately once more run into a variation of this problem, with
CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE=mandCONFIG_SND_SOC_SOF_HDA_COMMON=y:x86_64-linux-ld:
sound/soc/sof/intel/hda.o: in function `hda_dsp_interrupt_thread':
hda.c:(.text+0x739): undefined reference to `sdw_intel_thread'
x86_64-linux-ld: hda.c:(.text+0x764): undefined reference to `sdw_intel_process_wakeen_event'
x86_64-linux-ld:sound/soc/sof/intel/hda.o: in function `hda_sdw_int_enable':
hda.c:(.text+0x782): undefined reference to `sdw_intel_enable_irq'
x86_64-linux-ld:sound/soc/sof/intel/hda.o: in function `hda_sdw_startup':
hda.c:(.text+0x7ac): undefined reference to `sdw_intel_startup'
x86_64-linux-ld:sound/soc/sof/intel/hda.o: in function `hda_sdw_process_wakeen':
hda.c:(.text+0x7dc): undefined reference to `sdw_intel_process_wakeen_event'
x86_64-linux-ld:sound/soc/sof/intel/hda.o: in function `hda_dsp_probe':
hda.c:(.text+0xee1): undefined reference to `sdw_intel_probe'
x86_64-linux-ld:sound/soc/sof/intel/hda.o: in function `hda_dsp_remove':
hda.c:(.text+0xf7f): undefined reference to `sdw_intel_enable_irq'
x86_64-linux-ld: hda.c:(.text+0xf8e): undefined reference to `sdw_intel_exit'
Quoted 8 lines
This only seems to appear very rarely, as I still did around 25000 randconfig builds since you merged the series, but this config does show the problem for any kernel version between the fix and the latest linux-next:
https://pastebin.com/raw/VCjcB3EU
I have only done the quick bisection but no analysis regarding what we may have missed back in March. I hope you can figure this out.
Thanks for this report Arnd.
I can reproduce the problem, the changes made 6 months back don't make too much sense to me any longer. I have really no idea why I moved the INTEL_SOUNDWIRE config to a boolean, that was asking for trouble.
I have a tentative fix being tested at
https://github.com/thesofproject/linux/pull/3066. I just moved the select operations to a different option and reverted the INTEL_SOUNDWIRE config to be an on/off switch from the user perspective, with dependencies on built-in v. module checked inside.
Quoted 7 lines · Pierre-Louis Bossart
Thanks for this report Arnd.
I can reproduce the problem, the changes made 6 months back don't make too much sense to me any longer. I have really no idea why I moved the
INTEL_SOUNDWIREconfig to a boolean, that was asking for trouble.
Quoted 5 lines
I have a tentative fix being tested at
https://github.com/thesofproject/linux/pull/3066. I just moved the select operations to a different option and reverted theINTEL_SOUNDWIREconfig to be an on/off switch from the user perspective, with dependencies on built-in v. module checked inside.
Ah, I'm glad you at least came up with a patch quickly, even if neither of us remembers what we were thinking then ;-)
I've added this to my test tree, and will be able to at least verify that this doesn't break anything obvious over night.
Arnd
Quoted 16 lines · Arnd Bergmann
Quoted 7 lines · Pierre-Louis Bossart
Thanks for this report Arnd.
I can reproduce the problem, the changes made 6 months back don't make too much sense to me any longer. I have really no idea why I moved the
INTEL_SOUNDWIREconfig to a boolean, that was asking for trouble.Quoted 5 lines
I have a tentative fix being tested at
https://github.com/thesofproject/linux/pull/3066. I just moved the select operations to a different option and reverted theINTEL_SOUNDWIREconfig to be an on/off switch from the user perspective, with dependencies on built-in v. module checked inside.
Quoted 5 lines
Ah, I'm glad you at least came up with a patch quickly, even if neither of us remembers what we were thinking then ;-)
I've added this to my test tree, and will be able to at least verify that this doesn't break anything obvious over night.
Everything seems to be holding up so far, no new randconfig regressions and the one I reported is fixed.
I did come across a completely unrelated problem in another patch of yours though, see
Arnd