[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <078669ca-1995-3403-2f86-6c4554623125@linux.intel.com>
Date: Mon, 10 Mar 2025 18:46:23 +0200 (EET)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Kurt Borja <kuurtb@...il.com>, Masahiro Yamada <masahiroy@...nel.org>,
linux-kbuild@...r.kernel.org
cc: Hans de Goede <hdegoede@...hat.com>, platform-driver-x86@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] platform/x86: dell: Fix ALIENWARE_WMI dependencies
Hi Kbuild/config people,
Could you please take a look at this select problem.
I attempted to solve this kconfig select logic problem a few years back
but IIRC, my solution leaked memory or had some other problem I could not
find solution to (and now the code has changed enough I couldn't even get
my buggy solution easily forward-ported so I just dropped the solution and
left just the test case into the patch).
As the Kconfig problem back then got resolved through other means, I never
mentioned this back then but seems the same problem likely happens here
in some other form (bool selecting tristate that ends up getting only =m).
On Mon, 10 Mar 2025, Kurt Borja wrote:
> On Mon Mar 10, 2025 at 9:29 AM -05, Ilpo Järvinen wrote:
> > On Sun, 9 Mar 2025, Kurt Borja wrote:
> >
> >> If ACPI_PLATFORM_PROFILE is selected by ALIENWARE_WMI_WMAX, the former
> >> is forced to be at least =m, because the latter is a bool.
> >>
> >> This allows the following config:
> >>
> >> CONFIG_ALIENWARE_WMI=y
> >> CONFIG_ACPI_PLATFORM_PROFILE=m
> >
> > Hi,
> >
> > selecting from =y should not result in =m for the other symbol. This is
> > a bug in Kconfig infrastructure.
> >
> > I ran across this a few years back and even had a test case to prove the
> > select bug but back then the original problem eventually was solved in a
> > different way which no longer hit the problem. I never could figure out
> > how to fix the kconfig logic though without breaking something and it
> > ended up into low priority bin and never got solved.
> >
> > Sadly, it seems I've lost the test case patch that exhibits the bug
> > somewhere... I'll try to look for it from my archived files.
>
> That's funny.
>
> I thought this was a Kconfig quirk, that resulted from the following
> hierarchy:
>
> Type 0 1 2
> =============== ======= ======= =======
> Bool n y
I think y should be 2 in both cases so select should cause the selected
symbol to becomes =y but there's a logic problem deep in select logic in
the kconfig code.
I've attached the multi-select based reproducer test case. make
testconfig runs kconfig selftests and results in CONFIG_A3=m despite
CONFIG_C3=y selecting it.
Please do not apply the test case before the problem is fixed.
> Tristate n m y
>
> So a <bool> selecting the <tristate> would force it to be at least =m.
>
> The same thing happens with depend, where a dependecy would be fulfilled
> for a <bool> if a <tristate> was at least =m. That's why in the kernel
> robot report the linking error was also due to the HWMON dependency.
>
> Anyway, this patch could serve as a workaround if you feel it's
> necessary. I'm going to put the HWMON dependecy in the ALIENWARE_WMI
> symbol for my other series.
>
>
--
i.
View attachment "select_bug.patch" of type "text/x-diff" (3160 bytes)
Powered by blists - more mailing lists