summaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
authorAli Ahmet Memis <ali@iusegentoo.com>2026-08-03 10:21:48 +0000
committerGuenter Roeck <linux@roeck-us.net>2026-09-09 18:16:35 -0700
commitc88a6338ae485e4d6210cc74cdb7664d6476c925 (patch)
treef857ba16bd432fd25a928910fd5d3f178ea3ca47 /scripts/basic
parent06d48355bf41028c1321acda6a4391cd70098be8 (diff)
downloadlinux-c88a6338ae485e4d6210cc74cdb7664d6476c925.tar.gz
linux-c88a6338ae485e4d6210cc74cdb7664d6476c925.zip
hwmon: (nct6694) do not expose enable on DTIN temperature channels
The driver registers 26 temperature channels, all advertising HWMON_T_ENABLE, and indexes the enable bitmap with the raw channel: data->hwmon_en.tin_en[channel / 8] |= BIT(channel % 8); tin_en is two bytes and only covers the 5 THR and 5 TDP channels (index 0-9). The 16 DTIN channels (index 10-25) are enabled by the firmware and were never meant to carry an enable bit. Because the control structure is packed, writing temp17_enable and above indexes past tin_en into the fin_en bytes that follow it, so it toggles fan enable state instead; nct6694_hwmon_init() then sends the whole structure back to the device, and reads report fan state as temperature state. It stays within the structure, so this is not a memory safety problem, but on a board that uses the fan channels it is not harmless. Give the DTIN channels a temperature config without HWMON_T_ENABLE so the core never creates their enable attribute. The enable path is then reachable only for the first 10 channels, which stay within tin_en, and fin_en is left alone. The DTIN input and limit attributes are unchanged. Fixes: 197e779d29d8 ("hwmon: Add Nuvoton NCT6694 HWMON support") Suggested-by: Ming Yu <tmyu0@nuvoton.com> Link: https://lore.kernel.org/all/20260802124730.20387-1-ali@iusegentoo.com/ Signed-off-by: Ali Ahmet Memis <ali@iusegentoo.com> Link: https://patch.msgid.link/20260803102148.14196-1-ali@iusegentoo.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions