Skip to contentSkip to conversation

platform: arm64: drop the vacuous THERMAL dependency from EC_ASUS_GLYMUR

PATCH In review Haiyue Wang 3 participants 3 messages Oct 29

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

PATCH 1/1 platform: arm64: drop the vacuous THERMAL dependency from EC_ASUS_GLYMUR

'depends on THERMAL || THERMAL=n' is always true and is semantically a no-op, but it couples NEW_LEDS, which is selected here, to THERMAL and closes a Kconfig dependency loop. The C tools stay silent because they fold the always-true expression to 'y' before running dependency loop detection; kconfiglib, used by the Yocto kernel config audit, does not fold and rejects the config at parse time.

The loop is easy to expose with the in-tree tools, using the technique from commit b33a654a5bd6 ("drm/tiny: Kconfig: Remove always-y THERMAL dep. from TINYDRM_REPAPER"),
https://git.kernel.org/linus/b33a654a5bd6: temporarily make THERMAL tristate so the folding stops, then any config target reports it:

  $ sed -i 's/bool "Thermal drivers"/tristate "Thermal drivers"/' \
      drivers/thermal/Kconfig
  $ make allnoconfig
  error: recursive dependency detected!
	symbol POWER_SUPPLY is selected by HID_ASUS
	symbol HID_ASUS depends on LEDS_CLASS
	symbol LEDS_CLASS depends on NEW_LEDS
	symbol NEW_LEDS is selected by EC_ASUS_GLYMUR
	symbol EC_ASUS_GLYMUR depends on THERMAL
	symbol THERMAL is selected by AB8500_BM
	symbol AB8500_BM depends on POWER_SUPPLY

Drop the vacuous line to break the loop; the driver still builds both with and without THERMAL.

Fixes db3a9dddab5f ("platform: arm64: Add a driver for the EC found on ASUS Glymur machines")
Assisted-by LLM
---
 drivers/platform/arm64/Kconfig | 1 -
 1 file changed, 1 deletion(-)
drivers/platform/arm64/Kconfig +0 -1
index 2a84775a13a9..3f879410b311 100644
@@ -40,7 +40,6 @@ config EC_ASUS_GLYMUR
 	depends on HWMON
 	depends on INPUT
 	depends on PM
-	depends on THERMAL || THERMAL=n
 	select NEW_LEDS
 	select LEDS_CLASS
 	help
Signature · 1 line
2.56.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Haiyue Wang

'depends on THERMAL || THERMAL=n' is always true and is semantically a no-op, but it couples NEW_LEDS, which is selected here, to THERMAL and closes a Kconfig dependency loop. The C tools stay silent because they fold the always-true expression to 'y' before running dependency loop detection; kconfiglib, used by the Yocto kernel config audit, does not fold and rejects the config at parse time.

The loop is easy to expose with the in-tree tools, using the technique from commit b33a654a5bd6 ("drm/tiny: Kconfig: Remove always-y THERMAL dep. from TINYDRM_REPAPER"),
https://git.kernel.org/linus/b33a654a5bd6: temporarily make THERMAL tristate so the folding stops, then any config target reports it:

  $ sed -i 's/bool "Thermal drivers"/tristate "Thermal drivers"/' \
      drivers/thermal/Kconfig
  $ make allnoconfig
  error: recursive dependency detected!
	symbol POWER_SUPPLY is selected by HID_ASUS
	symbol HID_ASUS depends on LEDS_CLASS
	symbol LEDS_CLASS depends on NEW_LEDS
	symbol NEW_LEDS is selected by EC_ASUS_GLYMUR
	symbol EC_ASUS_GLYMUR depends on THERMAL
	symbol THERMAL is selected by AB8500_BM
	symbol AB8500_BM depends on POWER_SUPPLY
Quoted 7 lines

Drop the vacuous line to break the loop; the driver still builds both with and without THERMAL.

Fixes db3a9dddab5f ("platform: arm64: Add a driver for the EC found on ASUS Glymur machines")
Assisted-by LLM

---

Konrad

maintainer
#2 lore raw
In reply to Haiyue Wang
Quoted 8 lines · Haiyue Wang

'depends on THERMAL || THERMAL=n' is always true and is semantically a no-op, but it couples NEW_LEDS, which is selected here, to THERMAL and closes a Kconfig dependency loop. The C tools stay silent because they fold the always-true expression to 'y' before running dependency loop detection; kconfiglib, used by the Yocto kernel config audit, does not fold and rejects the config at parse time.

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-fixes branch. Note it will show up in the public platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/1] platform: arm64: drop the vacuous THERMAL dependency from EC_ASUS_GLYMUR

      commit: 6cea839b2de04818e1b638b68993a1b94eb17081

--
i.