From: Armin Wolf W_Armin@gmx.de
[ Upstream commit 53d3bd48ef6ff1567a75ca77728968f5ab493cb4 ]
The Dell OptiPlex 7040 supports the legacy SMM interface for reading sensors and performing fan control. Whitelist this machine so that this driver loads automatically.
Closes: https://github.com/Wer-Wolf/i8kutils/issues/15 Signed-off-by: Armin Wolf W_Armin@gmx.de Link: https://lore.kernel.org/r/20250917181036.10972-5-W_Armin@gmx.de Signed-off-by: Guenter Roeck linux@roeck-us.net Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
- Change scope and intent: The patch only adds a single DMI whitelist entry for “Dell OptiPlex 7040” to the legacy SMM allowlist used by the dell-smm hwmon driver. It adds a new block in `i8k_dmi_table` with explicit vendor and exact product matches, no other logic changes. See drivers/hwmon/dell-smm-hwmon.c:1334–1339.
- How it affects behavior: The i8k_dmi_table is consulted to decide if legacy SMM probing is permitted. If the system is not in this table, the driver refuses legacy SMM unless overridden by module params; with newer code it falls back to WMI. The gating is in `dell_smm_legacy_check()`, which returns -ENODEV when the DMI table doesn’t match and neither `ignore_dmi` nor `force` is set (drivers/hwmon/dell-smm-hwmon.c:1756–1761). Adding 7040 lets the driver load and use the legacy SMM path on that system automatically.
- Autoloading safety and containment: The driver exposes a DMI modalias and will auto-load only on machines matching this entry. The new match is guarded by both `DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc.")` and `DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "OptiPlex 7040")`, ensuring no unintended matches (drivers/hwmon/dell-smm-hwmon.c:1334–1338, 1378).
- Precedent and consistency: Neighboring entries for similar models, OptiPlex 7050 and 7060, already exist and were accepted (drivers/hwmon/dell-smm-hwmon.c:1320–1332). Extending coverage to the 7040 is consistent with established support for this platform family and the commit message notes the 7040 supports legacy SMM for sensors and fan control.
- Risk assessment: - No architectural changes, no new interfaces; it’s a pure DMI whitelist addition in a single file. - SMM-specific risks are mitigated by existing vendor/model blacklists for known-problematic systems (e.g., fan support freeze blacklist; drivers/hwmon/dell-smm-hwmon.c:1482–1512). 7040 is not on any blacklist. - Security posture remains unchanged: fan control and serial number are already restricted by default to CAP_SYS_ADMIN (`restricted` default true; drivers/hwmon/dell-smm-hwmon.c:127–133).
- User impact: Fixes a real-world usability gap where the driver would not autoload on OptiPlex 7040 (previously requiring module parameters or leaving sensors/fan control unavailable). The commit references a user report (Closes: GitHub issue) and was accepted by the hwmon maintainer.
- Backport suitability: - Change is small, localized, and low risk. - It aligns with stable rules for adding device IDs to enable existing functionality. - Applies cleanly conceptually to older stable trees which also use `i8k_dmi_table` and `MODULE_DEVICE_TABLE(dmi, i8k_dmi_table)` (e.g., v6.1, v6.6), even though line positions differ.
Given the minimal, well-scoped nature of the change and clear user benefit without broader side effects, this is a good candidate for stable backport.
drivers/hwmon/dell-smm-hwmon.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c index 3f61b2d7935e4..5801128e16c3c 100644 --- a/drivers/hwmon/dell-smm-hwmon.c +++ b/drivers/hwmon/dell-smm-hwmon.c @@ -1280,6 +1280,13 @@ static const struct dmi_system_id i8k_dmi_table[] __initconst = { DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "OptiPlex 7050"), }, }, + { + .ident = "Dell OptiPlex 7040", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "OptiPlex 7040"), + }, + }, { .ident = "Dell Precision", .matches = {