Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8563521ybn; Tue, 1 Oct 2019 09:52:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlJBx5AQxdWPsvDfWTbCyWG0zY/wf59RYY0HOkAWvVAHR2fIT5ncGiZeqVh49DfNltDN1W X-Received: by 2002:a17:907:20c1:: with SMTP id qq1mr24314018ejb.87.1569948738594; Tue, 01 Oct 2019 09:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569948738; cv=none; d=google.com; s=arc-20160816; b=sxAAJFRfEjiaGPlh0tV2OXBQ+9nlRG6WJLZnwr0ZZlM2iEt4VujDvqg1gPLO66ftl5 0e+DdIgAEG0hc1qKGWHxjrAENN3CcIVr3g98BmmWpjN16IXzwiFNPoES4zRGEoiVVpFT sHAsRDb5ksIafw+zENDW0miWmvU52Hkf7wng/YaYO9sGQgZ604Ul30HAZMq3v9t0YURh aCB68UUcA2+FEoZbeJA0mFg45+EagQc9goJdQo2c9YdlGLtI6X2gW4xEXB0wuzEQw+je JHxOnOY+jtCKT11GpcHkSHtpJX7wXN1V05zBBLd/Ob8ZdGaMTRv+ogJvfO7ZmlDRecx3 Wszg== 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=aXJNL4GF/fQoloUGVH39WoEbHxtpMw7Qfx4PIsnAPW0=; b=ZTzDta6Az9/hws6R2sQAKhEfilHiNCLu+Qrrf5f1mA1PcmfC1bMyfKmfJN0G/M98oH cjwO1+vMZMvGkZeziI78ZMcjpI6bQEaUGcliusS88oFX0fnsuP6p7BkdDl7+1HVVGoFk tvLhiGODbfGYp24XIs0KUlSwMl+T4941tKJ1mXCehA+vjpQW8AQvQdpxizLi3O4dXL9D c5ZpU7pP0eLKem+oTUsz84H3H1ohUHgUCVlm0/ftqC0kptUCsbalRAklRvp0LBL35iD2 PC5KK6deDDAZcaWcT6Fcffor4Mfx5gnM5gASNg3RsI9vNUOH+itS1IXQrdCZoLIsUJav 2Ttg== 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 n6si8900139eju.100.2019.10.01.09.51.53; Tue, 01 Oct 2019 09:52:18 -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 S1729543AbfJAQDt (ORCPT + 99 others); Tue, 1 Oct 2019 12:03:49 -0400 Received: from mga18.intel.com ([134.134.136.126]:44854 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727274AbfJAQDs (ORCPT ); Tue, 1 Oct 2019 12:03:48 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2019 09:03:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,571,1559545200"; d="scan'208";a="216117152" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 01 Oct 2019 09:03:46 -0700 Received: from abapat-mobl1.amr.corp.intel.com (unknown [10.251.1.101]) by linux.intel.com (Postfix) with ESMTP id 1AC725803FA; Tue, 1 Oct 2019 09:03:46 -0700 (PDT) Subject: Re: [alsa-devel] [PATCH] ASoC: SOF: imx: fix reverse CONFIG_SND_SOC_SOF_OF dependency To: Arnd Bergmann Cc: Mark Brown , Hulk Robot , YueHaibing , Daniel Baluta , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , ALSA Development Mailing List , Linux ARM , "linux-kernel@vger.kernel.org" References: <20191001142026.1124917-1-arnd@arndb.de> From: Pierre-Louis Bossart Message-ID: Date: Tue, 1 Oct 2019 11:03:45 -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: 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 10:41 AM, Arnd Bergmann wrote: > On Tue, Oct 1, 2019 at 5:32 PM Pierre-Louis Bossart > wrote: >> 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. > > Yes, I think that would work here as well, but it keeps even more > information about the specific drivers in the generic code. It also > requires adding more 'select' statements that tend to cause more > problems. > > The same could be done with a Kconfig-only solution avoiding > 'select' such as: > > 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 > def_tristate SND_SOC_SOF_OF > depends on SND_SOC_SOF_IMX8_SUPPORT Ah, nice, thanks for the suggestion! That would be my preference, we have a similar select for PCI and ACPI parts in sound/soc/sof/Kconfig and I was looking for a means to do this more elegantly. I can submit a new fix or let you sent a v2, whatever is more convenient.