[lkml]   [2021]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: sound/soc/sof/intel/byt.c:1057: undefined reference to `sof_acpi_probe'

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

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:

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
> + # Merrifield can't be built-in if snd-sof-acpi-intel-byt.ko is a module
> 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.

 \ /
  Last update: 2021-04-27 21:18    [W:0.216 / U:8.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site