Thread (5 messages) 5 messages, 3 authors, 13d ago

Re: [PATCH v3] hwmon: (lm75) Add support for Nuvoton NCT7715

From: sashiko-bot@kernel.org
Date: 2026-09-15 05:28:43
Also in: linux-hwmon

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] hwmon: lm75: NCT7715 initialization fails to clear bit 14 of config register
--

commit 7bd04866b8e88a3003be284539483cdda6599844
Author: Sheng-Yuan Huang [off-list ref]

hwmon: (lm75) Add support for Nuvoton NCT7715

This commit adds support for the Nuvoton NCT7715 temperature sensor to the
lm75 hardware monitoring driver. It introduces a new device parameter entry
that reuses much of the TMP112 handling for configuration and alarms.
quoted hunk ↗ jump to hunk
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -259,6 +260,16 @@ static const struct lm75_params device_params[] = {
 		.sample_times = (unsigned int []){ 30, 60, 120, 240 },
 		.resolutions = (u8 []) {9, 10, 11, 12 },
 	},
+	[nct7715] = {
+		.config_reg_16bits = true,
+		.set_mask = 0x8060,	/* 12-bit mode, 4 samples / second */
+		.clr_mask = 1 << 7,	/* no one-shot mode */
[Severity: Medium]
Will this leave bit 14 unchanged if it was previously set by a bootloader or
left over from a warm reboot?

During driver probe, lm75_generic_probe() calls lm75_write_config() to
initialize LM75_REG_CONF. The regmap update mask used is:
clr_mask | set_mask | LM75_SHUTDOWN

For nct7715, set_mask is 0x8060 and clr_mask is 0x0080. Bit 14 (0x4000) is
missing from both masks. Because of this, regmap_update_bits() will
silently ignore the 0 in bit 14 of set_mask and preserve its prior value
from the hardware configuration register.

If bit 14 remains set, can the sensor operate at 8 Hz instead of the
intended 4 Hz, leading to a mismatch between the hardware state and the
driver state which expects and reports a 250ms interval?

Should 0x4000 be included in clr_mask to ensure the hardware is properly
initialized to 4 samples / second?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260915052021.6959-1-syhuang3@nuvoton.com?part=1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help