Re: [PATCH] ASoC: SOF: ipc4-topology: fix link failure with SND_INTEL_DSP_CONFIG=m
From: Jude Gyimah
Date: Wed Nov 25 2026 - 15:54:00 EST
> 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@xxxxxxxxx
Thanks,
Jude