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-linus-v4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fixes from Guenter Roeck:

- Add support for new Ryzen chips to k10temp driver
... making Phoronix happy

- Fix inconsistent chip access in nct6683 driver

- Handle absence of few types of sensors in scmi driver

* tag 'hwmon-for-linus-v4.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
hwmon: (k10temp) Add support for AMD Ryzen w/ Vega graphics
hwmon: (k10temp) Add temperature offset for Ryzen 2700X
hwmon: (nct6683) Enable EC access if disabled at boot
hwmon: (scmi) handle absence of few types of sensors

+20 -6
+14 -3
drivers/hwmon/k10temp.c
··· 40 40 #define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463 41 41 #endif 42 42 43 + #ifndef PCI_DEVICE_ID_AMD_17H_RR_NB 44 + #define PCI_DEVICE_ID_AMD_17H_RR_NB 0x15d0 45 + #endif 46 + 43 47 /* CPUID function 0x80000001, ebx */ 44 48 #define CPUID_PKGTYPE_MASK 0xf0000000 45 49 #define CPUID_PKGTYPE_F 0x00000000 ··· 76 72 struct pci_dev *pdev; 77 73 void (*read_tempreg)(struct pci_dev *pdev, u32 *regval); 78 74 int temp_offset; 75 + u32 temp_adjust_mask; 79 76 }; 80 77 81 78 struct tctl_offset { ··· 89 84 { 0x17, "AMD Ryzen 5 1600X", 20000 }, 90 85 { 0x17, "AMD Ryzen 7 1700X", 20000 }, 91 86 { 0x17, "AMD Ryzen 7 1800X", 20000 }, 87 + { 0x17, "AMD Ryzen 7 2700X", 10000 }, 92 88 { 0x17, "AMD Ryzen Threadripper 1950X", 27000 }, 93 89 { 0x17, "AMD Ryzen Threadripper 1920X", 27000 }, 94 90 { 0x17, "AMD Ryzen Threadripper 1900X", 27000 }, ··· 135 129 136 130 data->read_tempreg(data->pdev, &regval); 137 131 temp = (regval >> 21) * 125; 132 + if (regval & data->temp_adjust_mask) 133 + temp -= 49000; 138 134 if (temp > data->temp_offset) 139 135 temp -= data->temp_offset; 140 136 else ··· 267 259 data->pdev = pdev; 268 260 269 261 if (boot_cpu_data.x86 == 0x15 && (boot_cpu_data.x86_model == 0x60 || 270 - boot_cpu_data.x86_model == 0x70)) 262 + boot_cpu_data.x86_model == 0x70)) { 271 263 data->read_tempreg = read_tempreg_nb_f15; 272 - else if (boot_cpu_data.x86 == 0x17) 264 + } else if (boot_cpu_data.x86 == 0x17) { 265 + data->temp_adjust_mask = 0x80000; 273 266 data->read_tempreg = read_tempreg_nb_f17; 274 - else 267 + } else { 275 268 data->read_tempreg = read_tempreg_pci; 269 + } 276 270 277 271 for (i = 0; i < ARRAY_SIZE(tctl_offset_table); i++) { 278 272 const struct tctl_offset *entry = &tctl_offset_table[i]; ··· 302 292 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) }, 303 293 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) }, 304 294 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) }, 295 + { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_RR_NB) }, 305 296 {} 306 297 }; 307 298 MODULE_DEVICE_TABLE(pci, k10temp_id_table);
+2 -2
drivers/hwmon/nct6683.c
··· 1380 1380 /* Activate logical device if needed */ 1381 1381 val = superio_inb(sioaddr, SIO_REG_ENABLE); 1382 1382 if (!(val & 0x01)) { 1383 - pr_err("EC is disabled\n"); 1384 - goto fail; 1383 + pr_warn("Forcibly enabling EC access. Data may be unusable.\n"); 1384 + superio_outb(sioaddr, SIO_REG_ENABLE, val | 0x01); 1385 1385 } 1386 1386 1387 1387 superio_exit(sioaddr);
+4 -1
drivers/hwmon/scmi-hwmon.c
··· 170 170 scmi_chip_info.info = ptr_scmi_ci; 171 171 chip_info = &scmi_chip_info; 172 172 173 - for (type = 0; type < hwmon_max && nr_count[type]; type++) { 173 + for (type = 0; type < hwmon_max; type++) { 174 + if (!nr_count[type]) 175 + continue; 176 + 174 177 scmi_hwmon_add_chan_info(scmi_hwmon_chan, dev, nr_count[type], 175 178 type, hwmon_attributes[type]); 176 179 *ptr_scmi_ci++ = scmi_hwmon_chan++;