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,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 739FDC433DB for ; Mon, 4 Jan 2021 15:06:14 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DA9F42076D for ; Mon, 4 Jan 2021 15:06:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA9F42076D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6A0BA1683; Mon, 4 Jan 2021 16:05:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6A0BA1683 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1609772772; bh=1a7DZwg2NqfYM9U/mJznBpNlMVs+55dPU7KRwDy6PTA=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aB0fTzNEZ24nezbRKQ5U8R8MTHhsesmQszczTt9E2tXu3td16+9/npXBfhgUAXOE8 lL4mBOfeuhz+XQS175R8CfdURG3Hcs/sX2XxWHIfb+XJgp2OwiHINqEnJs7h6r9qZO vB8I7/jEy+5hXMWTtY+DdVQ+rGz0/9E73KGW1GmM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CEC72F80165; Mon, 4 Jan 2021 16:05:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6BA1F8025E; Mon, 4 Jan 2021 16:05:19 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8552CF80165; Mon, 4 Jan 2021 16:05:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8552CF80165 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 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 Cc: Arnd Bergmann , alsa-devel@alsa-project.org, Kai Vehmanen , Arnd Bergmann , linux-kernel@vger.kernel.org, Takashi Iwai , Pierre-Louis Bossart , Liam Girdwood , Mark Brown , Ranjani Sridharan , Daniel Baluta , sound-open-firmware@alsa-project.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 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 C7E46C433DB for ; Mon, 4 Jan 2021 15:05:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D01022211 for ; Mon, 4 Jan 2021 15:05:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726612AbhADPFw (ORCPT ); Mon, 4 Jan 2021 10:05:52 -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