Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4772946pxy; Tue, 27 Apr 2021 12:15:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznFQ/aLtyLbO29EhMW54TR8sdRZeM+HGJHYItUFP1xq+aYfqDgNjpBx91igrQYU1KfbbRS X-Received: by 2002:aa7:dc0b:: with SMTP id b11mr6474320edu.124.1619550901210; Tue, 27 Apr 2021 12:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619550901; cv=none; d=google.com; s=arc-20160816; b=wwxQQIEgsk3MDawHkzZ0J/texXQnW1yUcIwEzcmB0G5lqTvlEZUtnxMIcWra4649Ug fORigdqev/acTt+Xw5zfdIup7Ypb2OWu39mK+mO7hqwMPXHAH2Z/rUrDFcNmOWaDLnB/ DreckoW87zZOPI4kL31tD46vQU1azLd2HF5Tfx3aX9/wzXm7wzQUyHaH7mbM+BEr36LI Ocb4y+T4z+uHOOzoeTKqdZzPv+4nq59GBcgjN6oMxlaCQr2w3//Qp6PKG6ztBsaDMqpR LCN//pu3bmVa+4fd9dZE0x1Z2+qcupJ1/2ZG/esL4HdpzAtfdjggqKZh9QwsNrPF9fi7 2hMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=iXcEOqTtht9z8MCPm8CyumhbhM3SCbn77K/T7Lo1Ov0=; b=0UypIeRs7WuCxZtTL8JR2WxL7fmntF1DKYqtJuLYHjeWd5/t4n+1/WbbLUTXgAtbaF 5gcF3/br3UZNs2lJC+gd8MrNKnAGnKBn5l0JgndIw6KrRnHHFOBPpWvQpVxDIArWeMwr 9Y602uz+IJw7UTCUgmcSUUsI8iTmyOsPOWXGiNKID7TYOVxCIkl/6pYIC7Uph1XzE1aY lp93mrZCLhEVO0Y8PiZgm1JEBoUmJZg8PNITUxI4oLFgklJDc6myfcPYOU57XT/VPJtx nTN69WDOirJR6qDHoHOgjAtX1ispIMvksrEmzQenbDvhyaK76LYKGVwFDEhG4qKmhfnE FJMw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z19si3485296edd.240.2021.04.27.12.14.37; Tue, 27 Apr 2021 12:15:01 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236571AbhD0TO3 (ORCPT + 99 others); Tue, 27 Apr 2021 15:14:29 -0400 Received: from mga01.intel.com ([192.55.52.88]:8751 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230219AbhD0TO3 (ORCPT ); Tue, 27 Apr 2021 15:14:29 -0400 IronPort-SDR: cV1K1I54DsI4oiyibkpbXgUSW2tGpYaSu9jDrp/9RgJ1VuesNqVtroKLSyuR8aa+NrjvY8V/V4 iFV3COVKUVlg== X-IronPort-AV: E=McAfee;i="6200,9189,9967"; a="217288757" X-IronPort-AV: E=Sophos;i="5.82,255,1613462400"; d="scan'208";a="217288757" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 12:13:42 -0700 IronPort-SDR: +rOSHwtLe8CEYYVmyPnlHC5j9E/FP9srmO0txOhRNV0IkwGLgyM/mDHNBL1w06oGeUgKRA70Hb qY9z8QiVHApg== X-IronPort-AV: E=Sophos;i="5.82,255,1613462400"; d="scan'208";a="457801829" Received: from aimam2-mobl1.amr.corp.intel.com (HELO [10.212.7.187]) ([10.212.7.187]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2021 12:13:41 -0700 Subject: Re: sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe' To: Arnd Bergmann Cc: kernel test robot , kbuild-all@lists.01.org, Linux Kernel Mailing List , Takashi Iwai , Kai Vehmanen , Guennadi Liakhovetski , Bard Liao , Mark Brown , Ranjani Sridharan References: <202104271905.1C7oj9q3-lkp@intel.com> <1d9958ea-aaae-0e45-7009-f12e4a4ae325@linux.intel.com> From: Pierre-Louis Bossart Message-ID: Date: Tue, 27 Apr 2021 14:13:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> ld: sound/soc/sof/intel/byt.o: in function `sof_baytrail_probe': >>>>> sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe' >>>>> ld: sound/soc/sof/intel/byt.o:(.data+0x44): undefined reference to `sof_acpi_remove' >>>>> ld: sound/soc/sof/intel/byt.o:(.data+0x94): undefined reference to `sof_acpi_pm' >> >> Ack, this is again the partition between Baytrail and Merrifield that's >> problematic in the corner case where ACPI is compiled as module and PCI >> as built-in. It's a bit academic since the PCI probe wouldn't work, but >> still it's not well partitioned. >> >> I've been wanting to change this for a while, and split the common atom >> parts from the ACPI/PCI parts. I guess it's time to fix this for good. > > I wonder why I never see these in randconfig builds here. I can reproduce it > with the .config from the link above though, and I see these relevant config > lines: > > CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL=y > CONFIG_SND_SOC_SOF_INTEL_ATOM_HIFI_EP=y > CONFIG_SND_SOC_SOF_MERRIFIELD=y > CONFIG_SND_SOC_SOF_ACPI=m > CONFIG_SND_SOC_SOF_ACPI_DEV=m > CONFIG_SND_SOC_SOF_BAYTRAIL=m yes, we end-up with a bad configuration with BAYTRAIL as m and Merrifield as y. That's broken since they share the same file. > An easy workaround would be to move the first 500 or so lines of > sound/soc/sof/intel/byt.c into a separate file and #include that from > distinct baytrail and merrifield modules, at the cost of a bit of > object code duplication and a somewhat dirty hack. I have a fix being tested here: https://github.com/thesofproject/linux/pull/2874 The idea is what you suggested, move the common parts to a new file but I used an 'atom' module instead #include to avoid duplication. The exported functions are namespaced to avoid polluting the global symbol map. The only other change needed is in the Makefile, We already have CONFIG_SND_SOC_SOF_INTEL_ATOM_HIFI_EP in the Kconfig and that can be used for this module. > Another option would be a Kconfig hack to prevent the broken > configuration, such as > > diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig > index eebe784ff652..b2039b4af9cf 100644 > --- a/sound/soc/sof/intel/Kconfig > +++ b/sound/soc/sof/intel/Kconfig > @@ -85,6 +85,8 @@ config SND_SOC_SOF_MERRIFIELD > tristate "SOF support for Tangier/Merrifield" > default SND_SOC_SOF_PCI > select SND_SOC_SOF_INTEL_ATOM_HIFI_EP > + # Merrifield can't be built-in if snd-sof-acpi-intel-byt.ko is a module > + depends on SND_SOC_SOF_BAYTRAIL || !SND_SOC_SOF_BAYTRAIL > help > This adds support for Sound Open Firmware for Intel(R) platforms > using the Tangier/Merrifield processors. It'd rather do this the right way with a proper code partitioning, I was tempted to do it multiple times and I've had it with this code.