Re: [alsa-devel] [PATCH v5 08/11] ASoC: Intel: atom: Make PCI dependency explicit

From: Pierre-Louis Bossart
Date: Wed Jan 02 2019 - 15:33:11 EST


I have three opens with this ACPI/PCI change

1. the baseline change fails on my cross-compilation checks, see below the result of the attached script (simplification of the one I use to avoid 0day reports).

2. there are different patterns to express the dependency on PCI e.g.

Âconfig MMC_SDHCI_ACPI
ÂÂÂÂ tristate "SDHCI support for ACPI enumerated SDHCI controllers"
ÂÂÂÂ depends on MMC_SDHCI && ACPI
-ÂÂÂ select IOSF_MBI if X86
+ÂÂÂ select IOSF_MBI if (X86 && PCI)

but

config SND_SST_ATOM_HIFI2_PLATFORM_ACPI
ÂÂÂÂ tristate "ACPI HiFi2 (Baytrail, Cherrytrail) Platforms"
ÂÂÂÂ default ACPI
-ÂÂÂ depends on X86 && ACPI
+ÂÂÂ depends on X86 && ACPI && PCI
ÂÂÂÂ select SND_SST_IPC_ACPI
ÂÂÂÂ select SND_SST_ATOM_HIFI2_PLATFORM
ÂÂÂÂ select SND_SOC_ACPI_INTEL_MATCH

IOSF is only needed for Baytrail-CR detection, and the code will compile fine without it, so maybe it'd be a better model if you used the following diff?

diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
index 2fd1b61e8331..68af0ea5c96c 100644
--- a/sound/soc/intel/Kconfig
+++ b/sound/soc/intel/Kconfig
@@ -95,7 +95,7 @@ config SND_SST_ATOM_HIFI2_PLATFORM_ACPI
ÂÂÂÂÂÂÂ select SND_SST_IPC_ACPI
ÂÂÂÂÂÂÂ select SND_SST_ATOM_HIFI2_PLATFORM
ÂÂÂÂÂÂÂ select SND_SOC_ACPI_INTEL_MATCH
-ÂÂÂÂÂÂ select IOSF_MBI
+ÂÂÂÂÂÂ select IOSF_MBI if PCI

3. All the Intel machine drivers depend on X86_INTEL_LPSS which depends on PCI. But for Baytrail/Haswell/Broadwell we have only a dependency on ACPI, so we expose drivers that can be selected but fail on probe since there are no machine drivers. I am not sure if we want to be strict and only expose meaningful configurations, or allow for more compilations tests and corner cases?

-Pierre


cross-compilation issue:

git checkout next-20190102

make CROSS_COMPILE=/opt/gcc-8.1.0-nolibc/ia64-linux/bin/ia64-linux- --jobs=16 allmodconfig ARCH=ia64
 HOSTCC scripts/basic/fixdep
 HOSTCC scripts/kconfig/conf.o
 YACC scripts/kconfig/zconf.tab.c
 LEX scripts/kconfig/zconf.lex.c
 HOSTCC scripts/kconfig/confdata.o
 HOSTCC scripts/kconfig/expr.o
 HOSTCC scripts/kconfig/symbol.o
 YACC scripts/kconfig/zconf.tab.h
 HOSTCC scripts/kconfig/preprocess.o
 HOSTCC scripts/kconfig/zconf.tab.o
 HOSTCC scripts/kconfig/zconf.lex.o
 HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --allmodconfig Kconfig
arch/ia64/Kconfig:128:error: recursive dependency detected!
arch/ia64/Kconfig:128:ÂÂÂ choice <choice> contains symbol IA64_HP_SIM
arch/ia64/Kconfig:202:ÂÂÂ symbol IA64_HP_SIM is part of choice PM
kernel/power/Kconfig:144:ÂÂÂ symbol PM is selected by PM_SLEEP
kernel/power/Kconfig:104:ÂÂÂ symbol PM_SLEEP depends on HIBERNATE_CALLBACKS
kernel/power/Kconfig:31:ÂÂÂ symbol HIBERNATE_CALLBACKS is selected by HIBERNATION
kernel/power/Kconfig:34:ÂÂÂ symbol HIBERNATION depends on SWAP
init/Kconfig:250:ÂÂÂ symbol SWAP depends on BLOCK
block/Kconfig:5:ÂÂÂ symbol BLOCK is selected by UBIFS_FS
fs/ubifs/Kconfig:1:ÂÂÂ symbol UBIFS_FS depends on MISC_FILESYSTEMS
fs/Kconfig:227:ÂÂÂ symbol MISC_FILESYSTEMS is selected by ACPI_APEI
drivers/acpi/apei/Kconfig:8:ÂÂÂ symbol ACPI_APEI depends on ACPI
drivers/acpi/Kconfig:9:ÂÂÂ symbol ACPI depends on ARCH_SUPPORTS_ACPI
drivers/acpi/Kconfig:6:ÂÂÂ symbol ARCH_SUPPORTS_ACPI is selected by IA64_HP_SIM
arch/ia64/Kconfig:202:ÂÂÂ symbol IA64_HP_SIM is part of choice <choice>
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"

#!/bin/bash

set -e

test_fast() {

PLATFORM="$1"
make mrproper
../make.cross allmodconfig ARCH=$PLATFORM
../make.cross olddefconfig ARCH=$PLATFORM
../make.cross ARCH=$PLATFORM modules_prepare
}

test_compile() {

PLATFORM="$1"
make mrproper

make defconfig ARCH=$PLATFORM

echo "modules first"
../make.cross ARCH=$PLATFORM
if [ "$PLATFORM" = "x86_64" ]; then
../make.cross bindeb-pkg ARCH=$PLATFORM
fi


echo "all yes second"
perl -pi.bak -e 's/=m/=y/g' .config
../make.cross olddefconfig ARCH=$PLATFORM
../make.cross ARCH=$PLATFORM
if [ "$PLATFORM" = "x86_64" ]; then
../make.cross bindeb-pkg ARCH=$PLATFORM
fi

}

test_platform() {

PLATFORM="$1"

test_fast $PLATFORM
# test_compile $PLATFORM
}

test_platform x86_64
test_platform i386
test_platform ia64
test_platform arm
test_platform arm64
test_platform sh
test_platform mips
test_platform s390
test_platform openrisc
test_platform sparc
test_platform sparc64
test_platform m68k

echo "X-compilation check PASS"