Skip to contentSkip to conversation

kconfig bug - select vs. depends

PATCH In review Bastian Blank 3 participants 5 messages Mar 14, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi folks

I work on the s390 kernel, linus/linux2.6.git, and found something which looks buggy. The kernel have HWMON enabled even if the dependencies does not allow it.

Dependency structure:

| menuconfig THERMAL
|         bool "Generic Thermal sysfs driver"
|         select HWMON
|         default y
| 
| menuconfig HWMON
|         tristate "Hardware Monitoring support"
|         depends on HAS_IOMEM
|         default y
| 
| config HAS_IOMEM
|         boolean
|         depends on !NO_IOMEM
|         default y
| 
| config NO_IOMEM
|         def_bool y

HWMON should never be selectable in this case, but the select forces it to yes:
| Hardware Monitoring support (HWMON) [Y/?] (NEW) y

Bastian

Signature · 2 lines
History tends to exaggerate.
		-- Col. Green, "The Savage Curtain", stardate 5906.4
#1 lore raw
Quoted 25 lines · On Fri, 14 Mar 2008 18:55:01 +0100 Bastian Blank wrote:

Hi folks

I work on the s390 kernel, linus/linux2.6.git, and found something which looks buggy. The kernel have HWMON enabled even if the dependencies does not allow it.

Dependency structure:

| menuconfig THERMAL
|         bool "Generic Thermal sysfs driver"
|         select HWMON
|         default y
| 
| menuconfig HWMON
|         tristate "Hardware Monitoring support"
|         depends on HAS_IOMEM
|         default y
| 
| config HAS_IOMEM
|         boolean
|         depends on !NO_IOMEM
|         default y
| 
| config NO_IOMEM
|         def_bool y
Quoted 3 lines

HWMON should never be selectable in this case, but the select forces it to yes:
| Hardware Monitoring support (HWMON) [Y/?] (NEW) y

Yes, that's a known & longstanding problem (that select does not follow/honor dependencies).

BTW, why does THERMAL default to y?

---
~Randy

#2 lore raw

PATCH 1/1 THERMAL must not select HWMON

On Fri, Mar 14, 2008 at 11:21:12AM -0700, Randy Dunlap wrote:

[ select forces HWMON to yes even if deps are never applicable ]

Quoted 2 lines

Yes, that's a known & longstanding problem (that select does not follow/honor dependencies).

Okay.

So THERMAL can't select HWMON, instead it needs to do a proper depends.

Bastian

drivers/thermal/Kconfig +1 -1
index 3ab313e..394912c 100644
@@ -4,7 +4,7 @@
 
 menuconfig THERMAL
 	bool "Generic Thermal sysfs driver"
-	select HWMON
+	depends on HWMON
 	default y
 	help
 	  Generic Thermal Sysfs driver offers a generic mechanism for
Signature · 1 line
You canna change the laws of physics, Captain; I've got to have thirty minutes!
#3 lore raw

Re: [PATCH] THERMAL must not select HWMON

Quoted 21 lines · On Fri, 14 Mar 2008 19:37:58 +0100 Bastian Blank <[email protected]> wrote:

On Fri, Mar 14, 2008 at 11:21:12AM -0700, Randy Dunlap wrote:

[ select forces HWMON to yes even if deps are never applicable ]

Quoted 2 lines

Yes, that's a known & longstanding problem (that select does not follow/honor dependencies).

Okay.

So THERMAL can't select HWMON, instead it needs to do a proper depends.

Bastian

drivers/thermal/Kconfig +0 -0
index 3ab313e..394912c 100644

drivers/thermal/Kconfig line 10

Quoted 8 lines
drivers/thermal/Kconfig +1 -1
@@ -4,7 +4,7 @@
 
 menuconfig THERMAL
 	bool "Generic Thermal sysfs driver"
-	select HWMON
+	depends on HWMON
 	default y
 	help
 	  Generic Thermal Sysfs driver offers a generic mechanism for

Sorry, but we have insufficient information here.

Presumably it fixes some build error, but the changelog should tell us (at least) what that error was, why it occurs and how the patch fixes it.

Often (for bugfixes) I'll go off and find this stuff out from the mailing list and put together a proper description. I also need to do this so I can work out whether the patch is needed in 2.6.25 or -stable. But I can't even find any reference to the original problem in the lkml archives.

#4 lore raw

Re: [PATCH] THERMAL must not select HWMON

Quoted 35 lines · On Fri, 14 Mar 2008 13:43:01 -0700 Andrew Morton wrote:
Quoted 21 lines · On Fri, 14 Mar 2008 19:37:58 +0100 Bastian Blank <[email protected]> wrote:

On Fri, Mar 14, 2008 at 11:21:12AM -0700, Randy Dunlap wrote:

[ select forces HWMON to yes even if deps are never applicable ]

Quoted 2 lines

Yes, that's a known & longstanding problem (that select does not follow/honor dependencies).

Okay.

So THERMAL can't select HWMON, instead it needs to do a proper depends.

Bastian

drivers/thermal/Kconfig +0 -0
index 3ab313e..394912c 100644

drivers/thermal/Kconfig line 10

Quoted 8 lines
drivers/thermal/Kconfig +1 -1
@@ -4,7 +4,7 @@
 
 menuconfig THERMAL
 	bool "Generic Thermal sysfs driver"
-	select HWMON
+	depends on HWMON
 	default y
 	help
 	  Generic Thermal Sysfs driver offers a generic mechanism for

Sorry, but we have insufficient information here.

Quoted 2 lines

Presumably it fixes some build error, but the changelog should tell us (at least) what that error was, why it occurs and how the patch fixes it.

Bastian can report if he actually had a build error or not.

What he reported on the linux-kbuild mailing list is that THERMAL selects HWMON. However, HWMON depends on HAS_IOMEM, but arch/s390 does not enable/support HAS_IOMEM. Bang.

Quoted 4 lines

Often (for bugfixes) I'll go off and find this stuff out from the mailing list and put together a proper description. I also need to do this so I can work out whether the patch is needed in 2.6.25 or -stable. But I can't even find any reference to the original problem in the lkml archives.

---
~Randy