mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jude Gyimah <jude.gyimah87@gmail.com>
To: arnd@arndb.de, lgirdwood@gmail.com,
	peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com,
	daniel.baluta@nxp.com, kai.vehmanen@linux.intel.com,
	pierre-louis.bossart@linux.dev, Vijendar.Mukunda@amd.com
Cc: broonie@kernel.org, perex@perex.cz, tiwai@suse.com,
	sound-open-firmware@alsa-project.org,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: SOF: ipc4-topology: fix link failure with SND_INTEL_DSP_CONFIG=m
Date: Wed, 25 Nov 2026 21:53:43 +0100	[thread overview]
Message-ID: <20261125205343.56030-1-jude.gyimah87@gmail.com> (raw)
In-Reply-To: <c8c7c888-4b9c-490d-afd5-0b49ae98b5cf@app.fastmail.com>

> 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

      reply	other threads:[~2026-11-25 20:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 18:37 Jude Gyimah
2026-11-25 19:28 ` Arnd Bergmann
2026-11-25 20:53   ` Jude Gyimah [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261125205343.56030-1-jude.gyimah87@gmail.com \
    --to=jude.gyimah87@gmail.com \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®