From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796297979; b=FD5ghF68xY0xwI/4Dx96h4KhVtr6iNBqeYmSz1OW3kD9S+8ZutdiMvOmWByZOpoGzkQm EwTP0317Uotk/D6uzDW8bKm4EFmOgZuDHiyywtGSnUzVpuonv6Mtubk6Dj7LKtJlpwnpb Pg+p0D2MHPej0SmdJMm4s8tUtSFccFEwtZAVzm8E822FNGV2yDBXUl0UC32lACnbHfeic ibzc62jLSoh4j2RTayJvpYhlnBw98T5AQHEe5ZW1ZmiDeUGCMiYQIwI2cUMSp8ihhOxGA CSBJ9cGRh1rqj/59YlXWaTNlBE60S6FBta1XRLB/zq2BKoIPZRdTLjohkLfBVhq8X/A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796297979; h=DMARC-Filter:Received:DKIM-Signature:DKIM-Signature:DKIM-Signature: DKIM-Signature:Received:Received:Date:Message-ID:From:To:Cc:Subject: In-Reply-To:References:User-Agent:MIME-Version:Content-Type: X-Spamd-Result:X-Rspamd-Server:X-Rspamd-Action:X-Spam-Flag: X-Spam-Score:X-Spam-Level:X-Rspamd-Queue-Id; bh=/LYsd9nOlLxg9nvHKgHT9SHwLXX9KGdLiCVUmsxLsYA=; b=TDuPHTWXwQA1+kcEygHgA3+5V/PmzD+aIssZPIEe6IHelSlAZHKWi2c4D06+Zn7iUIK5 1FTpi1pBh27WSHMz/VMCLS6yv//w+BEanLyXDGomjNbG1ixV2gIUgYyjt9JXOMNbxACsM QX3ieSemXnV1+kmGdYoyj1YpZOALmYPzF1nTUA2SLBqA8X4q3gPF4Uf5x4C3A5lAXmofw 6ToRsEBuaQPwzxUkfrMhOCUPUytOaCtNuiDFOwDeAmTg5Df7yjONoEEOCQDdsQnKSEQvm xcXCfqgJ3zoaOyqjY7ewli0OXj3tSUZcv7FeJN3CUhq/wr/QAlV69qoYV27+/BHzwWg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b="lN4CJ2/X"; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Ylq3b3Ts; dkim=pass header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b="lN4CJ2/X"; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Ylq3b3Ts; arc=none smtp.remote-ip=195.135.223.130 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4CD3606A692; Thu, 3 Dec 2026 11:39:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E4CD3606A692 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=lN4CJ2/X; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Ylq3b3Ts; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=lN4CJ2/X; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Ylq3b3Ts Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 15F7D34FCE; Thu, 3 Dec 2026 11:39:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1796297977; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/LYsd9nOlLxg9nvHKgHT9SHwLXX9KGdLiCVUmsxLsYA=; b=lN4CJ2/XTw6cpMIEJfCjvp7DfTmX8/I7hA9BN1J5+GnPotARB/nSbp6ACVZMqVE9eLMLv5 IZOQdBlfwoQjPnOMCRlmVA31h7ACCN1kodqlLeJ4dDXfWtGIl6LytG2tnTzDk4vEvmycB6 21lvn3IMnprOHqzYPYtbfcDiuAWVt1Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1796297977; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/LYsd9nOlLxg9nvHKgHT9SHwLXX9KGdLiCVUmsxLsYA=; b=Ylq3b3TsIss0bA8LZHWmlq6QUks7H+opbNZD1OYjRmodq6JSqU1QUY/wSUT93JfZBZHFMh 5qYr+/+vX2qCzbBg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="lN4CJ2/X"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Ylq3b3Ts DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1796297977; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/LYsd9nOlLxg9nvHKgHT9SHwLXX9KGdLiCVUmsxLsYA=; b=lN4CJ2/XTw6cpMIEJfCjvp7DfTmX8/I7hA9BN1J5+GnPotARB/nSbp6ACVZMqVE9eLMLv5 IZOQdBlfwoQjPnOMCRlmVA31h7ACCN1kodqlLeJ4dDXfWtGIl6LytG2tnTzDk4vEvmycB6 21lvn3IMnprOHqzYPYtbfcDiuAWVt1Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1796297977; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/LYsd9nOlLxg9nvHKgHT9SHwLXX9KGdLiCVUmsxLsYA=; b=Ylq3b3TsIss0bA8LZHWmlq6QUks7H+opbNZD1OYjRmodq6JSqU1QUY/wSUT93JfZBZHFMh 5qYr+/+vX2qCzbBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 746521348F; Thu, 3 Dec 2026 11:39:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id LMoPEfhUEWsvagAAD6G6ig (envelope-from ); Thu, 03 Dec 2026 11:39:36 +0000 Date: Thu, 03 Dec 2026 12:39:35 +0100 Message-ID: <87bj72vbig.wl-tiwai@suse.de> From: Takashi Iwai To: Jude Gyimah Cc: perex@perex.cz, tiwai@suse.com, lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, daniel.baluta@nxp.com, broonie@kernel.org, kai.vehmanen@linux.intel.com, pierre-louis.bossart@linux.dev, Vijendar.Mukunda@amd.com, jaska.uimonen@linux.intel.com, arnd@arndb.de, sound-open-firmware@alsa-project.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: hda: give the NHLT parser a module of its own In-Reply-To: <20261202140733.116024-1-jude.gyimah87@gmail.com> References: <20261202140733.116024-1-jude.gyimah87@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/30.2 Mule/6.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spamd-Result: default: False [-11.01 / 50.00]; SUSE_INTERNAL_BYPASS(-9.00)[]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FREEMAIL_TO(0.00)[gmail.com]; RCPT_COUNT_TWELVE(0.00)[16]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; FREEMAIL_CC(0.00)[perex.cz,suse.com,gmail.com,linux.intel.com,nxp.com,kernel.org,linux.dev,amd.com,arndb.de,alsa-project.org,vger.kernel.org]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_VIA_SMTP_AUTH(0.00)[]; TAGGED_RCPT(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -11.01 X-Spam-Level: X-Rspamd-Queue-Id: 15F7D34FCE On Wed, 02 Dec 2026 15:07:33 +0100, Jude Gyimah wrote: > > snd-sof calls the NHLT parser from generic code, and with a non-Intel SOF > platform built in and the Intel option modular 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' > > SND_SOC_SOF_IMX_COMMON=y selects SND_SOC_SOF, while > SND_SOC_SOF_INTEL_COMMON=m leaves SND_INTEL_DSP_CONFIG=m. > > There is no symbol to depend on to prevent that. intel-nhlt.o is built > into snd-intel-dspcfg, and SND_INTEL_NHLT is a bool that only decides > whether the object joins that module, so the parser's level is really > decided by SND_INTEL_DSP_CONFIG, which is about Intel DSP driver > detection and gets selected by SND_HDA_INTEL for unrelated reasons. > > Moving the calls into Intel code, as commit 194fe0fc3422 ("ASoC: SOF: > pci: move DSP_CONFIG use to platform-specific drivers") did for > snd_intel_dsp_driver_probe, would not be enough: ipc4-topology.c fills > ipc4_data->nhlt from the topology manifest when the BIOS has none, so > generic SOF can hold a table with no Intel code involved and has to be > able to parse it. > > Make the parser selectable instead. SND_INTEL_NHLT becomes a tristate > with its own module, and whoever parses an NHLT table selects it; a > select from a built-in symbol forces the target built in, so the > mismatch stops being expressible. SND_INTEL_SOUNDWIRE_ACPI beside it is > already arranged this way. > > Kconfig and Makefile change together because neither is right alone: > either order leaves SND_INTEL_NHLT=y with SND_INTEL_DSP_CONFIG=n, where > the object is not built but the header still declares the functions. > > IS_REACHABLE() would be worse than the link error. With the guard false > the #else stub of snd_sof_get_nhlt_endpoint_data() returns 0 without > setting *dst or *len, and the caller reads 0 as success, so SSP and DMIC > copiers would be prepared with no NHLT payload at all. Selecting the > parser keeps the real implementation: ipc4-topology.o still references > intel_nhlt_get_endpoint_blob in the configuration above. > > Tested on arm64 at v7.3. That configuration links with no undefined > references and no Kconfig warning, SND_INTEL_NHLT following SND_SOC_SOF > to y while SND_INTEL_DSP_CONFIG stays m. allnoconfig, defconfig, > allmodconfig and allyesconfig are warning-free and snd-intel-nhlt builds > as a module. > > 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 Applied to for-next branch. Thanks. Takashi