Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13884174pxu; Mon, 4 Jan 2021 07:06:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTbQID4y8zmLmb0MnZ2SC6pPEDuDgmcJFZ3nknF3XVToeBfa4vI7mUaw0JMnmwqsbZgxQD X-Received: by 2002:aa7:d593:: with SMTP id r19mr18328113edq.246.1609772816525; Mon, 04 Jan 2021 07:06:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609772816; cv=none; d=google.com; s=arc-20160816; b=KJJUZn22I1R3LS/MJt34P+8UhD/SMnazovjOUdpok+FSbR2RARRrvSl4o+aqpI/ToN dFBhv3BRrDKpwBvw4zJxAJnMDanz+n0FaPV0lBNRI2vmnY7nzeUfJffoIsp/MXhA30wL 7f+KfMzjbBri7XGr3FE0mGPenEL71d8pSl9BNQFUd8R/WfQJvy5BmQYALPOr5IcCBvYA xYZ3Z0GikE7plPWmjt/AyXiVadNvl4JYq5xCO77s5//cfUoyyjw0w1M1jziw1u5f/tkr T01bb3EN6nOyFdmm6ZdWZ9j+mPWGLInjSCdUPSaz3fG132CQ+qTgfWqd3tkYrJ79M99Y Bh1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=T/qpJ3qN5eie5qPwGeS7p1PR4IO3Cy1saaIx5ex1sDs=; b=QMbIjEQ5G5qRxjr5QVcwsJzDtN2iQoFJm3ynleVt7YzVa/qTwMgVwVsut6Im3t8mcn XXttj+s0+oqk1+PvlBTXVmb9D4CsEusxsnP20OYA4RtQ4HnAvTOse0uJja/bv0q0pCyv LVrs+RdAMeiOUwDYxgLfDk0dpyX0nZwV4XzsH4uZAYSXgnCt3eBamLZCmsVGd9bUkLef yM64RyWmDyBLQsPDmpyH6T5pmdeIhuGX4BxM4l3rrUbAfHmj989/WtUXpBZ+KYI3OSym aTkHOGZLam6Ig3TT9Z3zj/LgyDp9Jx/387I/G0NOnpHmREGQJRkgJJPipJ64uyso04lM cJxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si28731044eje.114.2021.01.04.07.06.32; Mon, 04 Jan 2021 07:06:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726258AbhADPFv (ORCPT + 99 others); Mon, 4 Jan 2021 10:05:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:57894 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725889AbhADPFv (ORCPT ); Mon, 4 Jan 2021 10:05:51 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C8F47AE05; Mon, 4 Jan 2021 15:05:09 +0000 (UTC) Date: Mon, 04 Jan 2021 16:05:09 +0100 Message-ID: From: Takashi Iwai To: Jaroslav Kysela Cc: Arnd Bergmann , Liam Girdwood , Mark Brown , Arnd Bergmann , Takashi Iwai , Pierre-Louis Bossart , Ranjani Sridharan , Kai Vehmanen , Daniel Baluta , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org Subject: Re: [PATCH] ALSA: hda: fix SND_INTEL_DSP_CONFIG dependency In-Reply-To: <3c19a5d5-8883-f917-a96a-f51bb188d115@perex.cz> References: <20210103135257.3611821-1-arnd@kernel.org> <3c19a5d5-8883-f917-a96a-f51bb188d115@perex.cz> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 04 Jan 2021 16:00:05 +0100, Jaroslav Kysela wrote: > > Dne 03. 01. 21 v 14:52 Arnd Bergmann napsal(a): > > From: Arnd Bergmann > > > > The sof-pci-dev driver fails to link when built into the kernel > > and CONFIG_SND_INTEL_DSP_CONFIG is set to =m: > > > > arm-linux-gnueabi-ld: sound/soc/sof/sof-pci-dev.o: in function `sof_pci_probe': > > sof-pci-dev.c:(.text+0x1c): undefined reference to `snd_intel_dsp_driver_probe' > > > > All other drivers using this interface already use a 'select > > SND_INTEL_DSP_CONFIG' statement to force the it to be present, so it > > seems reasonable to do the same here. > > > > The stub implementation in the header makes the problem harder to find, > > as it avoids the link error when SND_INTEL_DSP_CONFIG is completely > > disabled, without any obvious upsides. Remove these stubs to make it > > clearer that the driver is in fact needed here. > > > > Fixes: 82d9d54a6c0e ("ALSA: hda: add Intel DSP configuration / probe code") > > Signed-off-by: Arnd Bergmann > > --- > > include/sound/intel-dsp-config.h | 17 ----------------- > > sound/soc/sof/Kconfig | 2 ++ > > 2 files changed, 2 insertions(+), 17 deletions(-) > > > > diff --git a/include/sound/intel-dsp-config.h b/include/sound/intel-dsp-config.h > > index d4609077c258..94667e870029 100644 > > --- a/include/sound/intel-dsp-config.h > > +++ b/include/sound/intel-dsp-config.h > > @@ -18,24 +18,7 @@ enum { > > SND_INTEL_DSP_DRIVER_LAST = SND_INTEL_DSP_DRIVER_SOF > > }; > > > > -#if IS_ENABLED(CONFIG_SND_INTEL_DSP_CONFIG) > > The SOF drivers selects the DSP config code only when required (for specific > platforms - see sound/soc/sof/intel/Kconfig). > > It seems that the above if should be modified as: > > #if IS_BUILDIN(CONFIG_SND_INTEL_DSP_CONFIG) || (defined(MODULE) && > IS_MODULE(CONFIG_SND_INTEL_DSP_CONFIG)) > > So the buildin drivers which do not require the DSP config probe can be > compiled without this dependency. As I wrote in another post, a part of the problem is that SOF PCI and ACPI drivers call snd_intel_dsp_driver_probe() unconditionally, even if no Intel driver is bound. So even if changing like the above (or better to use IS_REACHABLE() macro) works around the issue, the call pattern needs to be reconsidered. thanks, Takashi