From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 333E1C433E6 for ; Mon, 4 Jan 2021 14:10:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3A6520770 for ; Mon, 4 Jan 2021 14:10:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727266AbhADOKH (ORCPT ); Mon, 4 Jan 2021 09:10:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:50978 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbhADOKG (ORCPT ); Mon, 4 Jan 2021 09:10:06 -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 EBD93AF2B; Mon, 4 Jan 2021 14:09:24 +0000 (UTC) Date: Mon, 04 Jan 2021 15:09:24 +0100 Message-ID: From: Takashi Iwai To: Arnd Bergmann Cc: Liam Girdwood , Mark Brown , Arnd Bergmann , Jaroslav Kysela , 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: <20210103135257.3611821-1-arnd@kernel.org> References: <20210103135257.3611821-1-arnd@kernel.org> 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 Sun, 03 Jan 2021 14:52:32 +0100, Arnd Bergmann wrote: > > 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 IMO, the problem is rather the unconditional calls of snd_intel_dsp_driver_probe() in snd-soc-sof-pci and snd-soc-sof-acpi drivers. Those calls should be done only if Intel drivers are involved. So, wrapping the call with ifdef CONFIG_SND_SOC_SOF_INTEL_PCI or CONFIG_SND_SOC_SOF_INTEL_ACPI would work better (although those are a bit uglier). thanks, Takashi > --- > 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) > - > int snd_intel_dsp_driver_probe(struct pci_dev *pci); > int snd_intel_acpi_dsp_driver_probe(struct device *dev, const u8 acpi_hid[ACPI_ID_LEN]); > > -#else > - > -static inline int snd_intel_dsp_driver_probe(struct pci_dev *pci) > -{ > - return SND_INTEL_DSP_DRIVER_ANY; > -} > - > -static inline > -int snd_intel_acpi_dsp_driver_probe(struct device *dev, const u8 acpi_hid[ACPI_ID_LEN]) > -{ > - return SND_INTEL_DSP_DRIVER_ANY; > -} > - > -#endif > - > #endif > diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig > index 031dad5fc4c7..051fd3d27047 100644 > --- a/sound/soc/sof/Kconfig > +++ b/sound/soc/sof/Kconfig > @@ -12,6 +12,7 @@ if SND_SOC_SOF_TOPLEVEL > config SND_SOC_SOF_PCI > tristate "SOF PCI enumeration support" > depends on PCI > + select SND_INTEL_DSP_CONFIG > select SND_SOC_SOF > select SND_SOC_ACPI if ACPI > help > @@ -23,6 +24,7 @@ config SND_SOC_SOF_PCI > config SND_SOC_SOF_ACPI > tristate "SOF ACPI enumeration support" > depends on ACPI || COMPILE_TEST > + select SND_INTEL_DSP_CONFIG > select SND_SOC_SOF > select SND_SOC_ACPI if ACPI > select IOSF_MBI if X86 && PCI > -- > 2.29.2 >