linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe'
@ 2021-04-27 11:10 kernel test robot
  2021-04-27 16:07 ` Pierre-Louis Bossart
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2021-04-27 11:10 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: kbuild-all, linux-kernel, Takashi Iwai, Kai Vehmanen,
	Guennadi Liakhovetski, Bard Liao

[-- Attachment #1: Type: text/plain, Size: 3671 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4a0225c3d208cfa6e4550f2210ffd9114a952a81
commit: 8d4ba1be3d2257606e04aff412829d8972670750 ASoC: SOF: pci: split PCI into different drivers
date:   8 weeks ago
config: i386-randconfig-r024-20210426 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8d4ba1be3d2257606e04aff412829d8972670750
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 8d4ba1be3d2257606e04aff412829d8972670750
        # save the attached .config to linux build tree
        make W=1 W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   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'


vim +1057 sound/soc/sof/intel/byt.c

8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1032  
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1033  static int sof_baytrail_probe(struct platform_device *pdev)
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1034  {
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1035  	struct device *dev = &pdev->dev;
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1036  	const struct sof_dev_desc *desc;
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1037  	const struct acpi_device_id *id;
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1038  	int ret;
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1039  
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1040  	id = acpi_match_device(dev->driver->acpi_match_table, dev);
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1041  	if (!id)
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1042  		return -ENODEV;
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1043  
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1044  	ret = snd_intel_acpi_dsp_driver_probe(dev, id->id);
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1045  	if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1046  		dev_dbg(dev, "SOF ACPI driver not selected, aborting probe\n");
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1047  		return -ENODEV;
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1048  	}
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1049  
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1050  	desc = device_get_match_data(&pdev->dev);
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1051  	if (!desc)
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1052  		return -ENODEV;
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1053  
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1054  	if (desc == &sof_acpi_baytrail_desc && soc_intel_is_byt_cr(pdev))
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1055  		desc = &sof_acpi_baytrailcr_desc;
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1056  
8a49cd11e68ed0 Arnd Bergmann 2021-03-01 @1057  	return sof_acpi_probe(pdev, desc);
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1058  }
8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1059  

:::::: The code at line 1057 was first introduced by commit
:::::: 8a49cd11e68ed0e6a687de04d25c06553bf96b0c ASoC: SOF: ACPI: avoid reverse module dependency

:::::: TO: Arnd Bergmann <arnd@arndb.de>
:::::: CC: Takashi Iwai <tiwai@suse.de>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 40167 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe'
  2021-04-27 11:10 sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe' kernel test robot
@ 2021-04-27 16:07 ` Pierre-Louis Bossart
  2021-04-27 18:42   ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2021-04-27 16:07 UTC (permalink / raw)
  To: kernel test robot
  Cc: kbuild-all, linux-kernel, Takashi Iwai, Kai Vehmanen,
	Guennadi Liakhovetski, Bard Liao, Arnd Bergmann, Mark Brown,
	Ranjani Sridharan



On 4/27/21 6:10 AM, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   4a0225c3d208cfa6e4550f2210ffd9114a952a81
> commit: 8d4ba1be3d2257606e04aff412829d8972670750 ASoC: SOF: pci: split PCI into different drivers
> date:   8 weeks ago
> config: i386-randconfig-r024-20210426 (attached as .config)
> compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> reproduce (this is a W=1 build):
>          # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8d4ba1be3d2257606e04aff412829d8972670750
>          git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>          git fetch --no-tags linus master
>          git checkout 8d4ba1be3d2257606e04aff412829d8972670750
>          # save the attached .config to linux build tree
>          make W=1 W=1 ARCH=i386
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>     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.

> vim +1057 sound/soc/sof/intel/byt.c
> 
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1032
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1033  static int sof_baytrail_probe(struct platform_device *pdev)
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1034  {
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1035  	struct device *dev = &pdev->dev;
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1036  	const struct sof_dev_desc *desc;
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1037  	const struct acpi_device_id *id;
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1038  	int ret;
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1039
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1040  	id = acpi_match_device(dev->driver->acpi_match_table, dev);
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1041  	if (!id)
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1042  		return -ENODEV;
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1043
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1044  	ret = snd_intel_acpi_dsp_driver_probe(dev, id->id);
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1045  	if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1046  		dev_dbg(dev, "SOF ACPI driver not selected, aborting probe\n");
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1047  		return -ENODEV;
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1048  	}
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1049
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1050  	desc = device_get_match_data(&pdev->dev);
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1051  	if (!desc)
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1052  		return -ENODEV;
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1053
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1054  	if (desc == &sof_acpi_baytrail_desc && soc_intel_is_byt_cr(pdev))
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1055  		desc = &sof_acpi_baytrailcr_desc;
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1056
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01 @1057  	return sof_acpi_probe(pdev, desc);
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1058  }
> 8a49cd11e68ed0 Arnd Bergmann 2021-03-01  1059
> 
> :::::: The code at line 1057 was first introduced by commit
> :::::: 8a49cd11e68ed0e6a687de04d25c06553bf96b0c ASoC: SOF: ACPI: avoid reverse module dependency
> 
> :::::: TO: Arnd Bergmann <arnd@arndb.de>
> :::::: CC: Takashi Iwai <tiwai@suse.de>
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe'
  2021-04-27 16:07 ` Pierre-Louis Bossart
@ 2021-04-27 18:42   ` Arnd Bergmann
  2021-04-27 19:13     ` Pierre-Louis Bossart
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2021-04-27 18:42 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: kernel test robot, kbuild-all, Linux Kernel Mailing List,
	Takashi Iwai, Kai Vehmanen, Guennadi Liakhovetski, Bard Liao,
	Mark Brown, Ranjani Sridharan

On Tue, Apr 27, 2021 at 6:07 PM Pierre-Louis Bossart
<pierre-louis.bossart@linux.intel.com> wrote:
> On 4/27/21 6:10 AM, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   4a0225c3d208cfa6e4550f2210ffd9114a952a81
> > commit: 8d4ba1be3d2257606e04aff412829d8972670750 ASoC: SOF: pci: split PCI into different drivers
> > date:   8 weeks ago
> > config: i386-randconfig-r024-20210426 (attached as .config)
> > compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
> > reproduce (this is a W=1 build):
> >          # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8d4ba1be3d2257606e04aff412829d8972670750
> >          git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> >          git fetch --no-tags linus master
> >          git checkout 8d4ba1be3d2257606e04aff412829d8972670750
> >          # save the attached .config to linux build tree
> >          make W=1 W=1 ARCH=i386
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> >
> > All errors (new ones prefixed by >>):
> >
> >     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

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.

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.

        Arnd

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe'
  2021-04-27 18:42   ` Arnd Bergmann
@ 2021-04-27 19:13     ` Pierre-Louis Bossart
  2021-04-27 20:01       ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2021-04-27 19:13 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kernel test robot, kbuild-all, Linux Kernel Mailing List,
	Takashi Iwai, Kai Vehmanen, Guennadi Liakhovetski, Bard Liao,
	Mark Brown, Ranjani Sridharan



>>>      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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe'
  2021-04-27 19:13     ` Pierre-Louis Bossart
@ 2021-04-27 20:01       ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2021-04-27 20:01 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: kernel test robot, kbuild-all, Linux Kernel Mailing List,
	Takashi Iwai, Kai Vehmanen, Guennadi Liakhovetski, Bard Liao,
	Mark Brown, Ranjani Sridharan

On Tue, Apr 27, 2021 at 9:13 PM Pierre-Louis Bossart
<pierre-louis.bossart@linux.intel.com> wrote:

> > 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.

Makes sense. I was slightly worried this would require exporting a ton
of symbols and possibly circular dependencies but looking at your patch,
it seems entirely fine.

      Arnd

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-27 20:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27 11:10 sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe' kernel test robot
2021-04-27 16:07 ` Pierre-Louis Bossart
2021-04-27 18:42   ` Arnd Bergmann
2021-04-27 19:13     ` Pierre-Louis Bossart
2021-04-27 20:01       ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).