diff mbox

[platform-drivers-x86:testing,6/6] drivers/platform/x86/Kconfig:128:error: recursive dependency detected!

Message ID 20180308215037.GF11045@localhost.localdomain (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Darren Hart March 8, 2018, 9:50 p.m. UTC
On Thu, Mar 08, 2018 at 12:03:11PM -0800, Darren Hart wrote:
> On Fri, Mar 09, 2018 at 02:45:05AM +0800, kbuild test robot wrote:
> > tree:   git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git testing
> > head:   1fd7ad4be77160c4a6c6deca62c3b9c728836b7d
> > commit: 1fd7ad4be77160c4a6c6deca62c3b9c728836b7d [6/6] platform/x86: dell-smbios: Resolve dependency error on DCDBAS
> > config: sh-allmodconfig (attached as .config)
> > compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> > reproduce:
> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         git checkout 1fd7ad4be77160c4a6c6deca62c3b9c728836b7d
> >         # save the attached .config to linux build tree
> >         make.cross ARCH=sh 
> > 
> > All errors (new ones prefixed by >>):
> > 
> > >> drivers/platform/x86/Kconfig:128:error: recursive dependency detected!
> > >> drivers/platform/x86/Kconfig:128: symbol DELL_SMBIOS_USING_DCDBAS is selected by DELL_SMBIOS_SMM
> > >> drivers/platform/x86/Kconfig:145: symbol DELL_SMBIOS_SMM depends on DELL_SMBIOS
> > >> drivers/platform/x86/Kconfig:114: symbol DELL_SMBIOS depends on DELL_SMBIOS_USING_DCDBAS
> >    For a resolution refer to Documentation/kbuild/kconfig-language.txt
> >    subsection "Kconfig recursive dependency limitations"
> > 
> > vim +128 drivers/platform/x86/Kconfig
> 
> Well, apparently this needs more work. I don't know why I didn't see this
> recursive error with this version of my patch. I'll see if there is anything I
> can do...
> 
> Andy, this means we'll probably have to break testing and roll this back.

OK, I spent some time mapping this out and... oi, what a mess. Greg KH is here
at OSLS and I worked through this with him - he suggested just simplifying this
by forcing DELL_SMBIOS to be <= DCDBAS if DCDBAS is enabled. I've updated my
patch in testing to reflect this, and force pushed. Hopefully nobody but 0-day
is impacted. This is bad form, but sending something to Linus with Kconfig
errors would be worse.


From cc69c88fbeb915447b87e5179378d899d1f61554 Mon Sep 17 00:00:00 2001
Message-Id: <cc69c88fbeb915447b87e5179378d899d1f61554.1520545797.git.dvhart@infradead.org>
From: "Darren Hart (VMware)" <dvhart@infradead.org>
Date: Tue, 6 Mar 2018 18:01:04 -0800
Subject: [PATCH] platform/x86: dell-smbios: Resolve dependency error on DCDBAS

When the DELL_SMBIOS_SMM backend is enabled, the DELL_SMBIOS symbol
depends on DELL_DCDBAS, and we must avoid the situation where
DELL_SMBIOS=y and DCDBAS=m.

Adding the conditional dependency to DELL_SMBIOS such as:

depends !DELL_SMBIOS_SMM || (DCDBAS || DCDBAS=n)

results in the Kconfig tooling complaining about a circular dependency,
although it appears to work in practice.

Avoid the errors by simplifying the dependency and forcing DELL_SMBIOS
to be <= DCDBAS if DCDBAS is enabled (thanks to Greg KH for the
suggestion).

Cc: Mario.Limonciello@dell.com
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
---
 drivers/platform/x86/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Andy Shevchenko March 9, 2018, 12:16 p.m. UTC | #1
On Thu, 2018-03-08 at 13:50 -0800, Darren Hart wrote:
> On Thu, Mar 08, 2018 at 12:03:11PM -0800, Darren Hart wrote:
> > On Fri, Mar 09, 2018 at 02:45:05AM +0800, kbuild test robot wrote:


> > Well, apparently this needs more work. I don't know why I didn't see
> > this
> > recursive error with this version of my patch. I'll see if there is
> > anything I
> > can do...
> > 
> > Andy, this means we'll probably have to break testing and roll this
> > back.

Fine, sometimes crap happens.

> OK, I spent some time mapping this out and... oi, what a mess. Greg KH
> is here
> at OSLS and I worked through this with him - he suggested just
> simplifying this
> by forcing DELL_SMBIOS to be <= DCDBAS if DCDBAS is enabled. I've
> updated my
> patch in testing to reflect this, and force pushed. Hopefully nobody
> but 0-day
> is impacted. This is bad form, but sending something to Linus with
> Kconfig
> errors would be worse.

Agree.

> Avoid the errors by simplifying the dependency and forcing DELL_SMBIOS
> to be <= DCDBAS if DCDBAS is enabled (thanks to Greg KH for the
> suggestion).
> 
> Cc: Mario.Limonciello@dell.com
> Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>

Suggested-by: Greg KH?
Darren Hart March 9, 2018, 5:30 p.m. UTC | #2
On Fri, Mar 09, 2018 at 02:16:52PM +0200, Andy Shevchenko wrote:
> On Thu, 2018-03-08 at 13:50 -0800, Darren Hart wrote:
> > On Thu, Mar 08, 2018 at 12:03:11PM -0800, Darren Hart wrote:
> > > On Fri, Mar 09, 2018 at 02:45:05AM +0800, kbuild test robot wrote:
> 
> 
> > > Well, apparently this needs more work. I don't know why I didn't see
> > > this
> > > recursive error with this version of my patch. I'll see if there is
> > > anything I
> > > can do...
> > > 
> > > Andy, this means we'll probably have to break testing and roll this
> > > back.
> 
> Fine, sometimes crap happens.
> 
> > OK, I spent some time mapping this out and... oi, what a mess. Greg KH
> > is here
> > at OSLS and I worked through this with him - he suggested just
> > simplifying this
> > by forcing DELL_SMBIOS to be <= DCDBAS if DCDBAS is enabled. I've
> > updated my
> > patch in testing to reflect this, and force pushed. Hopefully nobody
> > but 0-day
> > is impacted. This is bad form, but sending something to Linus with
> > Kconfig
> > errors would be worse.
> 
> Agree.
> 
> > Avoid the errors by simplifying the dependency and forcing DELL_SMBIOS
> > to be <= DCDBAS if DCDBAS is enabled (thanks to Greg KH for the
> > suggestion).
> > 
> > Cc: Mario.Limonciello@dell.com
> > Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
> 
> Suggested-by: Greg KH?

I debated that, thought that was perhaps overstating it. :shrug:
diff mbox

Patch

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 022c837..e55b008 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -105,8 +105,14 @@  config ASUS_LAPTOP
 
 	  If you have an ACPI-compatible ASUS laptop, say Y or M here.
 
+#
+# If the DELL_SMBIOS_SMM feature is enabled, the DELL_SMBIOS driver
+# becomes dependent on the DCDBAS driver. The "depends" line prevents a
+# configuration where DELL_SMBIOS=y while DCDBAS=m.
+#
 config DELL_SMBIOS
 	tristate "Dell SMBIOS driver"
+	depends on DCDBAS || DCDBAS=n
 	---help---
 	This provides support for the Dell SMBIOS calling interface.
 	If you have a Dell computer you should enable this option.