msi-ec: add hwmon fan RPM monitoring for WMI1 hardware#772
Open
mohammad-abbas-mehdi wants to merge 1 commit into
Open
msi-ec: add hwmon fan RPM monitoring for WMI1 hardware#772mohammad-abbas-mehdi wants to merge 1 commit into
mohammad-abbas-mehdi wants to merge 1 commit into
Conversation
Register a hwmon device exposing read-only fan1_input and fan2_input channels, reporting fan speed measured from the EC's period-encoded tachometer registers rather than the EC's commanded fan-curve percentage. The commanded percentage becomes stale whenever the EC bypasses its own fan curve, for example during cooler boost, while the tachometer continues to reflect the fan's actual speed. Exposing the data through hwmon makes it available to sensors, node_exporter and desktop monitoring tools without any msi-ec specific knowledge. This is the same interface msi-wmi-platform already uses on WMI2 hardware. Fan channels are gated per board: a board configuration must provide a tachometer address for the corresponding channel to appear. Boards without a known address expose no fan channels. On WMI2 hardware msi-wmi-platform already provides fan RPM through hwmon. Where the WMI platform GUID is present, fan channels are suppressed to avoid duplicate hwmon entries; if the GUID is absent on a WMI2 board they are registered as a fallback. Add rt_fan_tach_address to the per-board CPU and GPU configuration structs, and an is_wmi2 flag to the board configuration struct. Also add a board configuration for the MSI GV62 7RD (MS-16J9, 16J9EMS1.112), a WMI1 device used to validate this change. Fan and thermal addresses are confirmed on hardware; the remaining features are left unset pending confirmation. hwmon registration is non-fatal: the platform device and the existing sysfs interface remain functional if it fails. Signed-off-by: Mohammad Abbas Mehdi <mohammad-abbas-mehdi@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Registers a hwmon device exposing read-only
fan1_input/fan2_inputon WMI1 hardware, reporting fan speed measured from the EC's tachometer.What this improves over the current fan reporting
The driver today exposes fan speed as a percentage — the EC's commanded fan-curve step. That is the control target, not the fan's actual speed, and it becomes misleading whenever the EC bypasses its own curve. Cooler boost is the clear case: the fan spins up sharply, the percentage does not follow.
Measured on an MSI GV62 7RD:
The commanded percentage barely moves across that transition. Measured vs. commanded is the crux: the existing percentage answers "what did the EC ask for"; this answers "what is the fan actually doing".
Why hwmon rather than a platform sysfs attribute
hwmon is the kernel-standard interface for this data, so
sensors,node_exporter, desktop monitors and extensions like Vitals pick it up automatically with no msi-ec specific knowledge. It is the same interfacemsi-wmi-platformalready uses on WMI2 — this brings parity to WMI1, which has no equivalent.PR #475 (@Jiogo18) addresses the same gap via a custom platform sysfs attribute. This differs in exposing the data to the whole standard monitoring ecosystem rather than requiring per-tool knowledge of msi-ec internals.
What this does not do
coretemp/amdgpu, per @glpnk's point in Feature: expose CPU and GPU temperatures via Linux hwmon subsystem #739.WMI2 coexistence
Where
msi-wmi-platformis present on WMI2 hardware, fan channels are suppressed to avoid duplicate hwmon entries, aligned with the stated direction of migrating WMI2 logic there. If the GUID is absent on a WMI2 board, the channels register as a fallback.Hardware validation
Validated on MSI GV62 7RD (MS-16J9,
16J9EMS1.112, WMI1).A board configuration is included as the validation vehicle: fan and thermal addresses are confirmed on hardware; the remaining features are deliberately left unset pending confirmation. This is a partial bringup, not full device support.
Verified after a cold boot: the hwmon device registers,
fan1_input/fan2_inputtrack the tachometer rather than the commanded percentage, and cooler boost moves the reading as shown above.EC dump — GV62 7RD (16J9EMS1.112)
Notes
Signed-off-bypresent.MODULE_VERSIONunchanged at0.13— no unilateral version bump.checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.AI Disclosure (per project AI Policy)