* [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; 3+ 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] 3+ 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
2026-11-25 20:53 ` Jude Gyimah
0 siblings, 1 reply; 3+ 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] 3+ messages in thread* Re: [PATCH] ASoC: SOF: ipc4-topology: fix link failure with SND_INTEL_DSP_CONFIG=m
2026-11-25 19:28 ` Arnd Bergmann
@ 2026-11-25 20:53 ` Jude Gyimah
0 siblings, 0 replies; 3+ messages in thread
From: Jude Gyimah @ 2026-11-25 20:53 UTC (permalink / raw)
To: arnd, lgirdwood, peter.ujfalusi, yung-chuan.liao, daniel.baluta,
kai.vehmanen, pierre-louis.bossart, Vijendar.Mukunda
Cc: broonie, perex, tiwai, sound-open-firmware, linux-sound, linux-kernel
> 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.
Fair enough, I'll drop that patch.
I did try to express this in Kconfig and couldn't get it to work. Here's what
I saw, in case it saves someone else the effort.
Adding this to SND_SOC_SOF:
depends on SND_INTEL_DSP_CONFIG || !SND_INTEL_DSP_CONFIG
doesn't avoid the bad configuration. SND_SOC_SOF has no prompt and is only
reached via select, and select ignores depends on. So olddefconfig keeps
SND_SOC_SOF=y with SND_INTEL_DSP_CONFIG=m and just prints:
WARNING: unmet direct dependencies detected for SND_SOC_SOF
Putting the same dependency on the selector, SND_SOC_SOF_IMX_COMMON, moves
the warning to that symbol and quietly demotes SND_SOC_SOF to m. That fixes
the link failure, but only through an unmet-dependency warning, which isn't
really expressing anything.
I think the underlying problem is that the provider can't be selected. The NHLT parser
isn't a module of its own. intel-nhlt.o is built into snd-intel-dspcfg:
sound/hda/core/Makefile:18: snd-intel-dspcfg-$(CONFIG_SND_INTEL_NHLT) += intel-nhlt.o
sound/hda/core/Makefile:19: obj-$(CONFIG_SND_INTEL_DSP_CONFIG) += snd-intel-dspcfg.o
SND_INTEL_NHLT is a bool that only decides whether that object joins the module.
A consumer therefore can't say "I need the NHLT parser". What it gets is decided by
SND_INTEL_DSP_CONFIG, which is about Intel DSP driver detection and gets selected by
SND_HDA_INTEL and others for unrelated reasons. No symbol means what the caller needs.
Moving the calls into Intel-specific code, as 194fe0fc3422 did for snd_intel_dsp_driver_probe,
doesn't look sufficient either. ipc4-topology.c fills ipc4_data->nhlt from the topology manifest
when the BIOS has none:
/* no NHLT in BIOS, so use the one from topology manifest */
So generic SOF can end up holding an NHLT table without any Intel platform code involved, and
it needs the parser itself. The field is even declared void * in ipc4-priv.h, which suggests the
layering was already felt to be wrong.
If that's right, the fix is to make the parser selectable. SND_INTEL_NHLT would get its own
tristate and module:
obj-$(CONFIG_SND_INTEL_NHLT) += snd-intel-nhlt.o
and its users, SND_SOC_SOF included, would select it. A select from a y symbol forces y, so the
y/m mismatch can't happen, with no IS_REACHABLE and no depends on.
I'm happy to write that if you think it's the right shape. I'd like to check first, since it moves
an object between modules and touches the Intel callers as well as this one.
The config and the failing link are here:
https://lore.kernel.org/r/20261107114944.561731-1-jude.gyimah87@gmail.com
Thanks,
Jude
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-25 20:53 UTC | newest]
Thread overview: 3+ 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
2026-11-25 20:53 ` Jude Gyimah
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®