Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'hwmon-for-v5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

- Update/fix inspur-ipsps1 and k10temp Documentation

- Fix nct7904 driver

- Fix HWMON_P_MIN_ALARM mask in hwmon core

* tag 'hwmon-for-v5.4-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: docs: Extend inspur-ipsps1 title underline
hwmon: (nct7904) Add array fan_alarm and vsen_alarm to store the alarms in nct7904_data struct.
docs: hwmon: Include 'inspur-ipsps1.rst' into docs
hwmon: Fix HWMON_P_MIN_ALARM mask
hwmon: (k10temp) Update documentation and add temp2_input info
hwmon: (nct7904) Fix the incorrect value of vsen_mask in nct7904_data struct

+47 -9
+1
Documentation/hwmon/index.rst
··· 7 7 8 8 hwmon-kernel-api 9 9 pmbus-core 10 + inspur-ipsps1 10 11 submitting-patches 11 12 sysfs-interface 12 13 userspace-tools
+1 -1
Documentation/hwmon/inspur-ipsps1.rst
··· 1 1 Kernel driver inspur-ipsps1 2 - ======================= 2 + =========================== 3 3 4 4 Supported chips: 5 5
+17 -1
Documentation/hwmon/k10temp.rst
··· 21 21 22 22 * AMD Family 14h processors: "Brazos" (C/E/G/Z-Series) 23 23 24 - * AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity", "Kaveri", "Carrizo" 24 + * AMD Family 15h processors: "Bulldozer" (FX-Series), "Trinity", "Kaveri", 25 + "Carrizo", "Stoney Ridge", "Bristol Ridge" 25 26 26 27 * AMD Family 16h processors: "Kabini", "Mullins" 28 + 29 + * AMD Family 17h processors: "Zen", "Zen 2" 30 + 31 + * AMD Family 18h processors: "Hygon Dhyana" 32 + 33 + * AMD Family 19h processors: "Zen 3" 27 34 28 35 Prefix: 'k10temp' 29 36 ··· 117 110 If the BIOS has enabled hardware temperature control, the threshold at 118 111 which the processor will throttle itself to avoid damage is available in 119 112 temp1_crit and temp1_crit_hyst. 113 + 114 + On some AMD CPUs, there is a difference between the die temperature (Tdie) and 115 + the reported temperature (Tctl). Tdie is the real measured temperature, and 116 + Tctl is used for fan control. While Tctl is always available as temp1_input, 117 + the driver exports Tdie temperature as temp2_input for those CPUs which support 118 + it. 119 + 120 + Models from 17h family report relative temperature, the driver aims to 121 + compensate and report the real temperature.
+27 -6
drivers/hwmon/nct7904.c
··· 99 99 u8 enable_dts; 100 100 u8 has_dts; 101 101 u8 temp_mode; /* 0: TR mode, 1: TD mode */ 102 + u8 fan_alarm[2]; 103 + u8 vsen_alarm[3]; 102 104 }; 103 105 104 106 /* Access functions */ ··· 216 214 SMI_STS5_REG + (channel >> 3)); 217 215 if (ret < 0) 218 216 return ret; 219 - *val = (ret >> (channel & 0x07)) & 1; 217 + if (!data->fan_alarm[channel >> 3]) 218 + data->fan_alarm[channel >> 3] = ret & 0xff; 219 + else 220 + /* If there is new alarm showing up */ 221 + data->fan_alarm[channel >> 3] |= (ret & 0xff); 222 + *val = (data->fan_alarm[channel >> 3] >> (channel & 0x07)) & 1; 223 + /* Needs to clean the alarm if alarm existing */ 224 + if (*val) 225 + data->fan_alarm[channel >> 3] ^= 1 << (channel & 0x07); 220 226 return 0; 221 227 default: 222 228 return -EOPNOTSUPP; ··· 308 298 SMI_STS1_REG + (index >> 3)); 309 299 if (ret < 0) 310 300 return ret; 311 - *val = (ret >> (index & 0x07)) & 1; 301 + if (!data->vsen_alarm[index >> 3]) 302 + data->vsen_alarm[index >> 3] = ret & 0xff; 303 + else 304 + /* If there is new alarm showing up */ 305 + data->vsen_alarm[index >> 3] |= (ret & 0xff); 306 + *val = (data->vsen_alarm[index >> 3] >> (index & 0x07)) & 1; 307 + /* Needs to clean the alarm if alarm existing */ 308 + if (*val) 309 + data->vsen_alarm[index >> 3] ^= 1 << (index & 0x07); 312 310 return 0; 313 311 default: 314 312 return -EOPNOTSUPP; ··· 933 915 934 916 data->temp_mode = 0; 935 917 for (i = 0; i < 4; i++) { 936 - val = (ret & (0x03 << i)) >> (i * 2); 918 + val = (ret >> (i * 2)) & 0x03; 937 919 bit = (1 << i); 938 - if (val == 0) 920 + if (val == 0) { 939 921 data->tcpu_mask &= ~bit; 940 - else if (val == 0x1 || val == 0x2) 941 - data->temp_mode |= bit; 922 + } else { 923 + if (val == 0x1 || val == 0x2) 924 + data->temp_mode |= bit; 925 + data->vsen_mask &= ~(0x06 << (i * 2)); 926 + } 942 927 } 943 928 944 929 /* PECI */
+1 -1
include/linux/hwmon.h
··· 235 235 #define HWMON_P_LABEL BIT(hwmon_power_label) 236 236 #define HWMON_P_ALARM BIT(hwmon_power_alarm) 237 237 #define HWMON_P_CAP_ALARM BIT(hwmon_power_cap_alarm) 238 - #define HWMON_P_MIN_ALARM BIT(hwmon_power_max_alarm) 238 + #define HWMON_P_MIN_ALARM BIT(hwmon_power_min_alarm) 239 239 #define HWMON_P_MAX_ALARM BIT(hwmon_power_max_alarm) 240 240 #define HWMON_P_LCRIT_ALARM BIT(hwmon_power_lcrit_alarm) 241 241 #define HWMON_P_CRIT_ALARM BIT(hwmon_power_crit_alarm)