]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
platform/x86: lenovo: Decouple lenovo-wmi-gamezone and lenovo-wmi-other
authorRong Zhang <i@rong.moe>
Sun, 10 May 2026 04:25:36 +0000 (04:25 +0000)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 11 May 2026 11:29:07 +0000 (14:29 +0300)
commite8d5460ad3fd22409f2566ecbe2c82d94aabc246
tree78494c18c3320d3449d97297a42d557b6b455292
parent71f3843e0f81e3c097a088c1121154bb9a44da0a
platform/x86: lenovo: Decouple lenovo-wmi-gamezone and lenovo-wmi-other

Currently, lenovo-wmi-gamezone depends on lenovo-wmi-other as the former
imports symbols from the latter. The imported symbols are just used to
register a notifier block. However, there is no runtime dependency
between both drivers, and either of them can run without the other,
which is the major purpose of using the notifier framework.

Such a link-time dependency is non-optimal. A previous attempt to "fix"
it made LENOVO_WMI_GAMEZONE select LENOVO_WMI_TUNING, which was
fundamentally broken and resulted in undefined Kconfig behavior, as
`select' cannot be used on a symbol with potentially unmet dependencies.

Decouple both drivers by moving the thermal mode notifier chain to
lenovo-wmi-helpers. Methods for notifier block (un)registration are
exported for lenovo-wmi-gamezone, while a method for querying the
current thermal mode are exported for lenovo-wmi-other.

This turns the dependency graph from

            +------------ lenovo-wmi-gamezone
            |                     |
            v                     |
    lenovo-wmi-helpers            |
            ^                     |
            |                     V
            +------------ lenovo-wmi-other

into

            +------------ lenovo-wmi-gamezone
            |
            v
    lenovo-wmi-helpers
            ^
            |
            +------------ lenovo-wmi-other

To make it clear, the name of the notifier chain is also renamed from
`om_chain_head' to `tm_chain_head', indicating that it's used to query
the current thermal mode.

No functional change intended.

Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Fixes: 6e38b9fcbfa3 ("platform/x86: lenovo: gamezone needs "other mode"")
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603252259.gHvJDyh3-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202603260302.X0NjQOda-lkp@intel.com/
Signed-off-by: Rong Zhang <i@rong.moe>
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
Link: https://patch.msgid.link/20260510042546.436874-7-derekjohn.clark@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/lenovo/Kconfig
drivers/platform/x86/lenovo/wmi-gamezone.c
drivers/platform/x86/lenovo/wmi-helpers.c
drivers/platform/x86/lenovo/wmi-helpers.h
drivers/platform/x86/lenovo/wmi-other.c
drivers/platform/x86/lenovo/wmi-other.h [deleted file]