From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760573AbdLSKRO (ORCPT ); Tue, 19 Dec 2017 05:17:14 -0500 Received: from mx2.suse.de ([195.135.220.15]:51407 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759541AbdLSKRK (ORCPT ); Tue, 19 Dec 2017 05:17:10 -0500 Date: Tue, 19 Dec 2017 11:17:06 +0100 Message-ID: From: Takashi Iwai To: Pierre-Louis Bossart Cc: alsa-devel@alsa-project.org, broonie@kernel.org, torvalds@linux-foundation.org, vinod.koul@intel.com, liam.r.girdwood@linux.intel.com, andriy.shevchenko@linux.intel.com, arnd@arndb.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/9] ASoC: Intel: Fix Kconfig with top-level selector In-Reply-To: <567e85e3-2906-86c8-9cd1-6210f811bd73@linux.intel.com> References: <20171215004451.30800-1-pierre-louis.bossart@linux.intel.com> <20171215004451.30800-2-pierre-louis.bossart@linux.intel.com> <567e85e3-2906-86c8-9cd1-6210f811bd73@linux.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 15 Dec 2017 13:30:28 +0100, Pierre-Louis Bossart wrote: > > On 12/15/17 5:07 AM, Takashi Iwai wrote: > > On Fri, 15 Dec 2017 01:44:43 +0100, > > Pierre-Louis Bossart wrote: > >> > >> +config SND_SOC_ACPI_INTEL_MATCH > >> + tristate > >> + depends on X86 && ACPI > >> + select SND_SOC_ACPI > > > > An item that is selected by others can only select, not depend. > > The depends need to be put for the items that select this instead. > > Initially the code was > > config SND_SOC_ACPI_INTEL_MATCH > tristate > select SND_SOC_ACPI if ACPI > > I changed it to use depends to make some 0-day reports go away, for > some reason this option was selected with ARCH=mn10300 and generated > warnings. I don't quite understand how that happened since X86 and > ACPI are clear dependencies in the items which select this option... > > Vinod also added a similar pattern with > > +config SND_SOC_INTEL_SST_TOPLEVEL > + bool "Intel ASoC SST drivers" > + default y > + depends on X86 || COMPILE_TEST > + select SND_SOC_INTEL_MACH > > +menuconfig SND_SOC_INTEL_MACH > + bool "Intel Machine drivers" > depends on SND_SOC_INTEL_SST_TOPLEVEL > > Maybe that needs to be removed as well? Having both depends and select on the top-level is OK. The only problem is when an item that is selected by others has another depends. For example, a simple-looking case like below is actually buggy: config BAR tristate depends on X config FOO tristate "foo" select BAR Here BAR would be enabled by FOO no matter what X is, even if X=n. That said, when an item is selected, its own dependency is ignored. For correcting this, the depends-on-X must be moved to the top-level who selects the item: config BAR tristate config FOO tristate "foo" depends on X select BAR Note that the reverse-select chain works as expected. The breakage is only the mixture of select and depends in the selected items. Takashi