Skip to content

msi-ec: add hwmon fan RPM monitoring for WMI1 hardware#772

Open
mohammad-abbas-mehdi wants to merge 1 commit into
BeardOverflow:mainfrom
mohammad-abbas-mehdi:hwmon-tachometer-gv62
Open

msi-ec: add hwmon fan RPM monitoring for WMI1 hardware#772
mohammad-abbas-mehdi wants to merge 1 commit into
BeardOverflow:mainfrom
mohammad-abbas-mehdi:hwmon-tachometer-gv62

Conversation

@mohammad-abbas-mehdi

Copy link
Copy Markdown

Summary

Registers a hwmon device exposing read-only fan1_input / fan2_input on 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:

CPU fan GPU fan
cooler boost off ~2,800 RPM 0 RPM (stopped)
cooler boost on ~6,700 RPM ~7,000 RPM

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 interface msi-wmi-platform already 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

WMI2 coexistence

Where msi-wmi-platform is 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_input track the tachometer rather than the commanded percentage, and cooler boost moves the reading as shown above.

EC dump — GV62 7RD (16J9EMS1.112)
|      | _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f
|------+------------------------------------------------
| 0x0_ | 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
| 0x1_ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
| 0x2_ | 00 00 00 00 00 00 00 00 00 00 00 80 c0 06 49 4b  |..............IK|
| 0x3_ | 02 05 00 0d 51 0a 05 00 54 0f 30 2a 88 01 c0 00  |....Q...T.0*....|
| 0x4_ | 98 08 34 00 86 0d e4 f9 06 07 f2 29 05 0c 0c 30  |..4........)...0|
| 0x5_ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
| 0x6_ | 00 00 00 00 00 00 00 00 3d 0a 37 3d 43 49 4f 4f  |........=.7=CIOO|
| 0x7_ | 64 42 28 30 38 42 4c 56 56 00 0a 08 08 08 08 08  |dB(08BLVV.......|
| 0x8_ | 33 36 37 3c 41 46 4b 4b 63 00 00 36 3e 46 4e 56  |367<AFKKc..6>FNV|
| 0x9_ | 56 00 0a 07 07 07 07 07 02 16 7d 02 16 63 00 00  |V.........}..c..|
| 0xa_ | 31 36 4a 39 45 4d 53 31 2e 31 31 32 31 31 30 39  |16J9EMS1.1121109|
| 0xb_ | 32 30 31 37 31 35 3a 30 34 3a 32 38 5c 0d 00 00  |201715:04:28\...|
| 0xc_ | 00 07 31 00 00 9e 40 00 00 00 00 00 00 74 00 00  |..1...@......t..|
| 0xd_ | 00 00 40 00 73 00 01 00 00 00 00 80 00 00 00 00  |..@.s...........|
| 0xe_ | e2 02 00 80 10 00 00 00 00 00 0d 00 00 83 00 0d  |................|
| 0xf_ | 00 00 80 82 0c 00 0c 00 00 00 00 00 00 00 00 00  |................|

Notes

  • Single commit, Signed-off-by present.
  • MODULE_VERSION unchanged at 0.13 — no unilateral version bump.
  • checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.

AI Disclosure (per project AI Policy)

  • LLM: Claude (Anthropic) — Agent tool: Claude Code (CLI)
  • AI role: driver code structure, code comments, and drafting of the commit message and this description.
  • Contributor role: problem identification, EC register research, all architectural decisions, hardware measurement and validation on physical hardware, and line-by-line review of everything the agent produced.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant