hwmon: it87: Add basic IT8613E fan monitoring support
Subsystems (3)
RFC PATCH 1/1 hwmon: it87: Add basic IT8613E fan monitoring support
The IT8613E is not recognized by the in-tree it87 driver. Full support was proposed previously but withdrawn after problems were found in the temperature and PWM paths.
Add conservative support limited to fan input monitoring. Detect device ID 0x8613, check the fan pin muxes, use the existing 16-bit tachometer layout, and expose enabled fan inputs read-only. Do not expose voltage, temperature, PWM, limit, beep, or alarm interfaces.
The device ID and fan pin-mux checks follow the earlier v4 proposal by Benoit Masson.
Tested on a system with an IT8613E at 0xa30, revision 12. Only fan2_input was exposed, with stable readings between 1268 and 1320 RPM. In a back-to-back comparison, the in-tree driver with force_id=0x8622 reported 1483 RPM and the out-of-tree driver reported 1442 RPM.
--- Documentation/hwmon/it87.rst | 10 ++++++ drivers/hwmon/it87.c | 65 ++++++++++++++++++++++++++++++++---- 2 files changed, 68 insertions(+), 7 deletions(-)
Documentation/hwmon/it87.rst +10 -0
@@ -11,6 +11,16 @@ Supported chips: Datasheet: Not publicly available + * IT8613E + + Prefix: 'it8613' + + Addresses scanned: from Super I/O config space (8 I/O ports) + + Datasheet: Not publicly available + + Only fan input monitoring is currently supported. + * IT8620E Prefix: 'it8620'
drivers/hwmon/it87.c +58 -7
149 lines not on this page · raw message
base-commit: 75f2c0b3690702c90863c2e138cb5520670845ea
Signature · 1 line
2.55.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Unconditional execution of PWM, limit, and voltage configuration in it87_resume() bypasses chip…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unconditional execution of PWM, limit, and voltage configuration in it87_resume() bypasses chip safety guards. --
commit 38aeab66f2bad568170fc7c7a3bf957b47ace77f
Author: Jerome Tollet <[email protected]>
hwmon: it87: Add basic IT8613E fan monitoring support
The IT8613E is not recognized by the in-tree it87 driver. Full support was proposed previously but withdrawn after problems were found in the temperature and PWM paths.
Add conservative support limited to fan input monitoring. Detect device ID 0x8613, check the fan pin muxes, use the existing 16-bit tachometer layout, and expose enabled fan inputs read-only.
Quoted 4 lines
drivers/hwmon/it87.c +0
-0
[ ... ]
Quoted 11 lines
drivers/hwmon/it87.c +2
-1@@ -3355,7 +3396,8 @@ static void it87_init_device(struct platform_device *pdev) data->auto_pwm[i][3 ] =0x7f ;/* Full speed, hard-coded */ } -it87_check_limit_regs (data); +if (!has_fan_input_only (data)) +it87_check_limit_regs (data);/* * Temperature channels are not forcibly enabled, as they can be
drivers/hwmon/it87.c static void it87_init_device(struct platform_device *pdev) · line 3412
Quoted 8 lines
drivers/hwmon/it87.c +2
-1@@ -3364,7 +3406,8 @@ static void it87_init_device(struct platform_device *pdev)* run-time through the temp{1-3}_type sysfs accessors if needed. */ -it87_check_voltage_monitors_reset (data); +if (!has_fan_input_only (data)) +it87_check_voltage_monitors_reset (data);it87_check_tachometers_reset (pdev);
[Severity: High]
Since we need to guard these register writes during initialization, do we also need to guard them during system resume?
Looking at it87_resume() in drivers/hwmon/it87.c, these functions are called unconditionally:
static int it87_resume(struct device *dev)
{
...
it87_check_pwm(dev);
it87_check_limit_regs(data);
it87_check_voltage_monitors_reset(data);
...
}Could this bypass the has_fan_input_only() guards on the resume path and attempt to write to unsupported PWM, voltage limit, and VIN enable registers on the IT8613E chip?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1