Skip to content

ASoC: Intel: boards: fix HDAudio codec unmet dependencies - #1768

Closed
plbossart wants to merge 2 commits into
thesofproject:topic/sof-devfrom
plbossart:fix/hdaudio-codec-unmet-dependencies
Closed

plbossart wants to merge 2 commits into
thesofproject:topic/sof-devfrom
plbossart:fix/hdaudio-codec-unmet-dependencies

Conversation

@plbossart

Copy link
Copy Markdown
Member

The SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH option can be selected as
module or built-in, without taking into account the selections done at
a higher level (as done with other Kconfigs), leading to unmet
dependencies (e.g. with i386-randconfig-e003-20200206)

Adding a test for the SOF selection constrains the result and makes
the problem go away.

Reported-by: kbuild test robot lkp@intel.com
Fixes: aa2b4a5 ('ASoC: Intel: boards: fix incorrect HDMI Kconfig dependency')
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com

@plbossart
plbossart requested a review from kv2019i February 6, 2020 17:43
@plbossart
plbossart requested a review from lgirdwood as a code owner February 6, 2020 17:43
config SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH
tristate "SKL/KBL/BXT/APL with HDA Codecs"
select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA_AUDIO_CODEC
select SND_HDA_CODEC_HDMI if SND_SOC_SOF_HDA && SND_SOC_SOF_HDA_AUDIO_CODEC

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart Change looks good, but I don't really grasp how this only affects the generic driver. The kconfig rules look identical to other machine drivers, but somehow the module/builtin conflict only happens here...?

@plbossart plbossart Feb 6, 2020 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests where actually different, they only used a boolean for SKL-HDAUDIO, while they used an SOF_GEMINILAKE for example in other places. And what happens is that this removes the possibility of building the machine driver as built-in while SOF is build as a module

It seems the 'if' has side effects, it's not a pure yes/no flow.

@kv2019i

kv2019i commented Feb 7, 2020

Copy link
Copy Markdown
Collaborator

Hmm, I'm still getting an error on this with your patch:

sound/soc/intel/boards/hda_dsp_common.o: In function hda_dsp_hdmi_build_controls': /home/kvehmane/build/linux-sofdev/sound/soc/intel/boards/hda_dsp_common.c:76: undefined reference to snd_hda_codec_build_controls'
Makefile:1078: recipe for target 'vmlinux' failed

It seems the additional checks are not sufficient if all the dependencies are modules.

@kv2019i

kv2019i commented Feb 7, 2020

Copy link
Copy Markdown
Collaborator

@plbossart How about this instead:
#1772

... I tried bunch of different options, but I couldn't fix the build on my local setup. Then I tried this option and ta-daa it works. It seems much safer option. Of the downsides, having snd-hda-codec-hdmi built unnecessarily for SST is not an issue (nor the rare case if someone wants to use hdac-hdmi with older platforms with SOF).

The bigger downside is that if SND_HDA_CODEC_HDMI is not selected, a bunch of SOF board files are unavailable for selection as well. This is bad, but practically, who would this impact. Distros will for sure have SND_HDA_CODEC_HDMI always in use.

@plbossart

Copy link
Copy Markdown
Member Author

@plbossart How about this instead:
#1772

... I tried bunch of different options, but I couldn't fix the build on my local setup. Then I tried this option and ta-daa it works. It seems much safer option. Of the downsides, having snd-hda-codec-hdmi built unnecessarily for SST is not an issue (nor the rare case if someone wants to use hdac-hdmi with older platforms with SOF).

The bigger downside is that if SND_HDA_CODEC_HDMI is not selected, a bunch of SOF board files are unavailable for selection as well. This is bad, but practically, who would this impact. Distros will for sure have SND_HDA_CODEC_HDMI always in use.

can you share the .config that breaks this solution?

Also I am concerned about breaking make olddefconfig. We should double check e..g if Chrome enables SND_HDA_CODEC_HDMI before making it a dependency. @cujomalainey can you help here?

@kv2019i

kv2019i commented Feb 7, 2020

Copy link
Copy Markdown
Collaborator

@plbossart wrote:

can you share the .config that breaks this solution?

I got this with i386-randconfig-e003-20200206 from the report (md5sum 0dbebc3c9e40bd0f683fcd4f3f4ac63b). I did test it on top of sof-dev though. I copied the file as .config, run make olddefconfig and tried to build. Kconfig didn't complain but at end of build process, linking the kernel binary fails as some dependencies are configured as modules.

Maybe I missed something, but it seems there's nothing forcing the generic machine driver not to be builtin, unless we have the "depends on" in there.

@plbossart

Copy link
Copy Markdown
Member Author

@plbossart wrote:

can you share the .config that breaks this solution?

I got this with i386-randconfig-e003-20200206 from the report (md5sum 0dbebc3c9e40bd0f683fcd4f3f4ac63b). I did test it on top of sof-dev though. I copied the file as .config, run make olddefconfig and tried to build. Kconfig didn't complain but at end of build process, linking the kernel binary fails as some dependencies are configured as modules.

Maybe I missed something, but it seems there's nothing forcing the generic machine driver not to be builtin, unless we have the "depends on" in there.

ok, I missed a dependency on the SKL driver (which I had removed manually), we really can't select HDAudio codec support on both sides, it will just not work in the same distro. I added a mutual exclusion to solve this issue,

But that approach will backfire on us if we want to support KBL with the SKL driver+HDaudio, so I guess we really have to allow the machine driver to be built-in, which really forces us to remove the select. Gah.

…iver uses

SOF and SKL can be compiled separately as built-in or modules, which
is problematic for the shared machine driver.

Add a mutual exclusion to solve this issue.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
The SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH option can be selected as
module or built-in, without taking into account the selections done at
a higher level (as done with other Kconfigs), leading to unmet
dependencies (e.g. with i386-randconfig-e003-20200206)

Adding a test for the SOF selection constrains the result and makes
the problem go away.

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: aa2b4a5 ('ASoC: Intel: boards: fix incorrect HDMI Kconfig dependency')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@plbossart
plbossart force-pushed the fix/hdaudio-codec-unmet-dependencies branch from d8f0d4b to 4a6ed46 Compare February 7, 2020 16:55
@plbossart

plbossart commented Feb 7, 2020 •

Copy link
Copy Markdown
Member Author

closing PR #1772 is a better solution.

@plbossart plbossart closed this Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants