* [PATCH] ASoC: SOF: ipc4-topology: fix link failure with SND_INTEL_DSP_CONFIG=m
@ 2026-11-25 18:37 Jude Gyimah
2026-11-25 19:28 ` Arnd Bergmann
0 siblings, 1 reply; 2+ messages in thread
From: Jude Gyimah @ 2026-11-25 18:37 UTC (permalink / raw)
To: lgirdwood, peter.ujfalusi, yung-chuan.liao, daniel.baluta,
kai.vehmanen, pierre-louis.bossart, Vijendar.Mukunda
Cc: broonie, perex, tiwai, arnd, sound-open-firmware, linux-sound,
linux-kernel, Jude Gyimah
Hi everyone,
Just to bring this to your attention.
snd-sof can be built into vmlinux while the Intel NHLT code that
ipc4-topology.c calls is in a module, and then the link fails:
ipc4-topology.c:(.text+0x22bc): undefined reference to
`intel_nhlt_get_endpoint_blob'
ipc4-topology.c:(.text+0x2424): undefined reference to
`intel_nhlt_ssp_device_type'
This happens with a non-Intel SOF platform built in and the Intel option
modular, for example SND_SOC_SOF_IMX_COMMON=y selecting SND_SOC_SOF while
SND_SOC_SOF_INTEL_COMMON=m selects SND_INTEL_DSP_CONFIG=m.
The existing guard cannot prevent it. intel-nhlt.o is shipped by
SND_INTEL_DSP_CONFIG, but the guard tests SND_INTEL_NHLT, a bool that
SND_INTEL_DSP_CONFIG selects "if ACPI", and a select from an m-valued
symbol sets a bool to y. So SND_INTEL_NHLT is y whenever the provider is
y or m, and the condition can only tell "NHLT present somewhere" from
"absent", never built-in from modular. The static inline fallbacks in
include/sound/intel-nhlt.h are keyed on the same condition and are
therefore unreachable too.
Test reachability of the option that actually ships the code instead. No
header change is needed: the file already stubs
snd_sof_get_nhlt_endpoint_data() in its own #else branch, and wherever
IS_REACHABLE is true with ACPI=y, SND_INTEL_NHLT is y as well, so the real
declarations are in scope.
This is the same remedy as commit 8a3fea95fab1 ("ASoC: SOF:
SND_INTEL_DSP_CONFIG dependency") applied for snd_intel_dsp_driver_probe in
sof-pci-dev.c, which commit 194fe0fc3422 ("ASoC: SOF: pci: move DSP_CONFIG
use to platform-specific drivers") later resolved by moving that call to
Intel-specific code. Moving these calls likewise would be the complete
fix so this is the one-line one.
Found with kreach, a static check that compares what Kconfig allows
against the symbols the compiled objects actually reference.
Fixes: aa84ffb72158 ("ASoC: SOF: ipc4-topology: Add support for SSP/DMIC DAI's")
Link: https://lore.kernel.org/r/20261107114944.561731-1-jude.gyimah87@gmail.com
Signed-off-by: Jude Gyimah <jude.gyimah87@gmail.com>
---
sound/soc/sof/ipc4-topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index 22c15fbb93f2..3ad27c57564b 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -1790,7 +1790,7 @@ static void sof_ipc4_unprepare_copier_module(struct snd_sof_widget *swidget)
}
}
-#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT)
+#if IS_ENABLED(CONFIG_ACPI) && IS_REACHABLE(CONFIG_SND_INTEL_DSP_CONFIG)
static int snd_sof_get_hw_config_params(struct snd_sof_dev *sdev, struct snd_sof_dai *dai,
int *sample_rate, int *channel_count, int *bit_depth)
{
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: SOF: ipc4-topology: fix link failure with SND_INTEL_DSP_CONFIG=m
2026-11-25 18:37 [PATCH] ASoC: SOF: ipc4-topology: fix link failure with SND_INTEL_DSP_CONFIG=m Jude Gyimah
@ 2026-11-25 19:28 ` Arnd Bergmann
0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2026-11-25 19:28 UTC (permalink / raw)
To: Jude Gyimah, lgirdwood, Peter Ujfalusi, Bard Liao, Daniel Baluta,
Kai Vehmanen, Pierre-Louis Bossart, Vijendar Mukunda
Cc: Mark Brown, Jaroslav Kysela, tiwai, sound-open-firmware,
linux-sound, linux-kernel
On Wed, Nov 25, 2026, at 19:37, Jude Gyimah wrote:
> }
>
> -#if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT)
> +#if IS_ENABLED(CONFIG_ACPI) &&
> IS_REACHABLE(CONFIG_SND_INTEL_DSP_CONFIG)
> static int snd_sof_get_hw_config_params(struct snd_sof_dev *sdev,
> struct snd_sof_dai *dai,
IS_REACHABLE() is practically always a mistake, don't do that.
There is surely a way to correctly express the dependencies and avoid
the configuration that leads to this.
Arnd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-25 19:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 18:37 [PATCH] ASoC: SOF: ipc4-topology: fix link failure with SND_INTEL_DSP_CONFIG=m Jude Gyimah
2026-11-25 19:28 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®