Skip to contentSkip to conversation

platform/x86: lenovo: gamezone needs "other mode"

PATCH In review Arnd Bergmann 3 participants 5 messages Jul 9, 2025 – Jul 11, 2025

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

PATCH 1/1 platform/x86: lenovo: gamezone needs "other mode"

From: Arnd Bergmann <[email protected]>

Registering the "other mode" notifier fails if that is disabled:

x86_64-linux-ld: drivers/platform/x86/lenovo/wmi-gamezone.o: in function `lwmi_gz_probe':
wmi-gamezone.c:(.text+0x336): undefined reference to `devm_lwmi_om_register_notifier'

This could be fixed by adding a stub helper, but a Kconfig 'select' seems simpler here.

Fixes 22024ac5366f ("platform/x86: Add Lenovo Gamezone WMI Driver")
---
 drivers/platform/x86/lenovo/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/platform/x86/lenovo/Kconfig +1 -2
index b76157b35296..e9e1c3268373 100644
@@ -250,8 +250,7 @@ config LENOVO_WMI_GAMEZONE
 	depends on ACPI_WMI
 	depends on DMI
 	select ACPI_PLATFORM_PROFILE
-	select LENOVO_WMI_EVENTS
-	select LENOVO_WMI_HELPERS
+	select LENOVO_WMI_TUNING
 	help
 	  Say Y here if you have a WMI aware Lenovo Legion device and would like to use the
 	  platform-profile firmware interface to manage power usage.
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 21 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Registering the "other mode" notifier fails if that is disabled:

x86_64-linux-ld: drivers/platform/x86/lenovo/wmi-gamezone.o: in function `lwmi_gz_probe':
wmi-gamezone.c:(.text+0x336): undefined reference to `devm_lwmi_om_register_notifier'

This could be fixed by adding a stub helper, but a Kconfig 'select' seems simpler here.

Fixes 22024ac5366f ("platform/x86: Add Lenovo Gamezone WMI Driver")
---
 drivers/platform/x86/lenovo/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/platform/x86/lenovo/Kconfig +0 -0
index b76157b35296..e9e1c3268373 100644

drivers/platform/x86/lenovo/Kconfig config LENOVO_WMI_GAMEZONE · line 253

Quoted 6 lines
drivers/platform/x86/lenovo/Kconfig +1 -2
@@ -250,8 +250,7 @@ config LENOVO_WMI_GAMEZONE
 	depends on ACPI_WMI
 	depends on DMI
 	select ACPI_PLATFORM_PROFILE
-	select LENOVO_WMI_EVENTS
-	select LENOVO_WMI_HELPERS
+	select LENOVO_WMI_TUNING

Why did you remove the other two?

Do select propagate properly these days across another select? I was under impression they don't which is one of the reasons use of select is discouraged.

Signature · 1 line
 i.
#2 lore raw
Quoted 14 lines · Ilpo Järvinen

drivers/platform/x86/lenovo/Kconfig config LENOVO_WMI_GAMEZONE · line 253

Quoted 10 lines · Arnd Bergmann

index b76157b35296..e9e1c3268373 100644

drivers/platform/x86/lenovo/Kconfig +1 -2
@@ -250,8 +250,7 @@ config LENOVO_WMI_GAMEZONE
 	depends on ACPI_WMI
 	depends on DMI
 	select ACPI_PLATFORM_PROFILE
-	select LENOVO_WMI_EVENTS
-	select LENOVO_WMI_HELPERS
+	select LENOVO_WMI_TUNING

Why did you remove the other two?

Quoted 1 line

Do select propagate properly these days across another select?

Yes, as far as I know it has always done this, with the one exception that it does not propagate when trying to select another symbol that has missing dependencies

Quoted 2 lines

I was under impression they don't which is one of the reasons use of select is discouraged.

I have seen that mentioned before in commit logs, but I think this was a misunderstanding. Using 'select' is still discouraged, but for other reasons:

- complexity quickly gets out of hand when selecting something that has other dependencies, as the driver selecting them must duplicate all those dependencies and keep them in sync

- mixing 'depends on' and 'select' for the same dependency in different drivers tends to cause dependency loops

- selecting user-visible symbols has side-effects if another symbol depends on that, e.g. the "select I2C" in some subsystems causes the I2C submenu to appear.

Arnd

maintainer
#3 lore raw
Quoted 24 lines · Arnd Bergmann
Quoted 14 lines · Ilpo Järvinen

drivers/platform/x86/lenovo/Kconfig config LENOVO_WMI_GAMEZONE · line 253

Quoted 10 lines · Arnd Bergmann

index b76157b35296..e9e1c3268373 100644

drivers/platform/x86/lenovo/Kconfig +1 -2
@@ -250,8 +250,7 @@ config LENOVO_WMI_GAMEZONE
 	depends on ACPI_WMI
 	depends on DMI
 	select ACPI_PLATFORM_PROFILE
-	select LENOVO_WMI_EVENTS
-	select LENOVO_WMI_HELPERS
+	select LENOVO_WMI_TUNING

Why did you remove the other two?

Quoted 1 line

Do select propagate properly these days across another select?

Yes, as far as I know it has always done this, with the one exception that it does not propagate when trying to select another symbol that has missing dependencies

Quoted 2 lines

I was under impression they don't which is one of the reasons use of select is discouraged.

Quoted 7 lines

I have seen that mentioned before in commit logs, but I think this was a misunderstanding. Using 'select' is still discouraged, but for other reasons:

- complexity quickly gets out of hand when selecting something that has other dependencies, as the driver selecting them must duplicate all those dependencies and keep them in sync

Okay, thanks for these clarifications.

I think I'll take this patch but change it to still keep the other selects as wmi-gamezone.c is directly using those too anyway.

Quoted 9 lines

- mixing 'depends on' and 'select' for the same dependency in different drivers tends to cause dependency loops

- selecting user-visible symbols has side-effects if another symbol depends on that, e.g. the "select I2C" in some subsystems causes the I2C submenu to appear.

Arnd

Signature · 1 line
 i.
#4 lore raw
Quoted 4 lines · Ilpo Järvinen

On Fri, 11 Jul 2025, Arnd Bergmann wrote:

I think I'll take this patch but change it to still keep the other selects as wmi-gamezone.c is directly using those too anyway.

Sounds good to me, thanks!

Arnd