Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8471169ybn; Tue, 1 Oct 2019 08:33:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjphgP8vVee1KqRAPa1lLyZzG+ca248LtFBPo/6znlfOLCtYPtmAtkiBX2SVzLB8/QxmF9 X-Received: by 2002:a50:f703:: with SMTP id g3mr26155442edn.43.1569944023172; Tue, 01 Oct 2019 08:33:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569944023; cv=none; d=google.com; s=arc-20160816; b=FUCsPXBo0G/mKZd4sahLyQgE5WBkkO0gcXJbkUbPCBwY5ZgXy0dGv1BUjlOu3pOXB0 Nam8DNApkJw68dXFAtAxg8TL52/sPgES+ApiJpBCRbB+HrpnTtHSc6L8ZWJv0Xi94Ma7 /77Solopm1KxZ69hgSul+0aNmASfBEVrbdlkCnKobu+6NYmxHXAnWi7LV5oC0QyjXK/h k/KIYJM+9gSnEOkB7jTnXZex08tLkM4NwzvVW91QwgEoTir4VedYPTKUakkjjvUg4aW7 Q5YMK+zdL/uKsUsiNIvGn8eRBrAP6SnRontjtir9WSLhkB0lxjW7SP2/OnfWfRJPjFjS VONA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=JuVQsIKwjLr4+oz8sB87vWn4m2j47Y9VxoPs0qyWn4c=; b=YAFrkCLhYF8FKcM1c74UW5NOhYic0uSCxOV/u2c2xnqAJ6uWaXbn6H9gayZobrQbxX XR0En7cL2h6kLE3uXZCOOdQN/aA2krqgUfgfJFAj6miu4+qiAGQUTwA3yGk9JYzocy5H sLI6ma4wAKbFDfrJQJE40fuYnigBR0UkjgUDcG36LLuvDyam4XM4raZAJq8jwjcTmPsH fjrKTvDGDf/gQrdW9u1OHm5ZJ7RTFnA1M8jmV3XqBrdYUxYyoygDnFcYPUXiGOCHQSKL hgxpVSoqVEhghEvCrE1moI1w0qp2IGqBK6sb3YFVLb/ej21gS71SMB70vyEcOVAG1a8d dxmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si8810505edh.358.2019.10.01.08.33.17; Tue, 01 Oct 2019 08:33:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389757AbfJAPcE (ORCPT + 99 others); Tue, 1 Oct 2019 11:32:04 -0400 Received: from mga18.intel.com ([134.134.136.126]:41575 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388277AbfJAPcE (ORCPT ); Tue, 1 Oct 2019 11:32:04 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2019 08:32:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,571,1559545200"; d="scan'208";a="275026881" Received: from linux.intel.com ([10.54.29.200]) by orsmga001.jf.intel.com with ESMTP; 01 Oct 2019 08:32:00 -0700 Received: from abapat-mobl1.amr.corp.intel.com (unknown [10.251.1.101]) by linux.intel.com (Postfix) with ESMTP id D8A92580696; Tue, 1 Oct 2019 08:31:58 -0700 (PDT) Subject: Re: [alsa-devel] [PATCH] ASoC: SOF: imx: fix reverse CONFIG_SND_SOC_SOF_OF dependency To: Arnd Bergmann , Mark Brown Cc: Hulk Robot , YueHaibing , Daniel Baluta , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20191001142026.1124917-1-arnd@arndb.de> From: Pierre-Louis Bossart Message-ID: Date: Tue, 1 Oct 2019 10:31:58 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191001142026.1124917-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/1/19 9:20 AM, Arnd Bergmann wrote: > CONFIG_SND_SOC_SOF_IMX depends on CONFIG_SND_SOC_SOF, but is in > turn referenced by the sof-of-dev driver. This creates a reverse > dependency that manifests in a link error when CONFIG_SND_SOC_SOF_OF > is built-in but CONFIG_SND_SOC_SOF_IMX=m: > > sound/soc/sof/sof-of-dev.o:(.data+0x118): undefined reference to `sof_imx8_ops' > > Make the latter a 'bool' symbol and change the Makefile so the imx8 > driver is compiled the same way as the driver using it. > > A nicer way would be to reverse the layering and move all > the imx specific bits of sof-of-dev.c into the imx driver > itself, which can then call into the common code. Doing this > would need more testing and can be done if we add another > driver like the first one. Or use something like config SND_SOC_SOF_IMX8_SUPPORT bool "SOF support for i.MX8" depends on IMX_SCU depends on IMX_DSP config SND_SOC_SOF_IMX8 tristate config SND_SOC_SOF_OF depends on OF select SND_SOC_SOF_IMX8 if SND_SOC_SOF_IMX8_SUPPORT That way you propagate the module/built-in information. That's how we fixed those issues for the Intel parts. > > Fixes: f4df4e4042b0 ("ASoC: SOF: imx8: Fix COMPILE_TEST error") > Fixes: 202acc565a1f ("ASoC: SOF: imx: Add i.MX8 HW support") > Signed-off-by: Arnd Bergmann > --- > sound/soc/sof/imx/Kconfig | 2 +- > sound/soc/sof/imx/Makefile | 4 +++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/sound/soc/sof/imx/Kconfig b/sound/soc/sof/imx/Kconfig > index 5acae75f5750..a3891654a1fc 100644 > --- a/sound/soc/sof/imx/Kconfig > +++ b/sound/soc/sof/imx/Kconfig > @@ -12,7 +12,7 @@ config SND_SOC_SOF_IMX_TOPLEVEL > if SND_SOC_SOF_IMX_TOPLEVEL > > config SND_SOC_SOF_IMX8 > - tristate "SOF support for i.MX8" > + bool "SOF support for i.MX8" > depends on IMX_SCU > depends on IMX_DSP > help > diff --git a/sound/soc/sof/imx/Makefile b/sound/soc/sof/imx/Makefile > index 6ef908e8c807..9e8f35df0ff2 100644 > --- a/sound/soc/sof/imx/Makefile > +++ b/sound/soc/sof/imx/Makefile > @@ -1,4 +1,6 @@ > # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) > snd-sof-imx8-objs := imx8.o > > -obj-$(CONFIG_SND_SOC_SOF_IMX8) += snd-sof-imx8.o > +ifdef CONFIG_SND_SOC_SOF_IMX8 > +obj-$(CONFIG_SND_SOC_SOF_OF) += snd-sof-imx8.o > +endif >