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

Merge branch 'thermal-intel'

Merge updates of Intel thermal drivers for 7.1:

- Replace cpumask_weight() in intel_hfi_offline() with cpumask_empty()
which is generally more efficient (Yury Norov)

- Add support for reading DDR data rate from PCI config space on Nova
Lake platforms to the int340x thermal driver (Srinivas Pandruvada)

* thermal-intel:
thermal: intel: hfi: use cpumask_empty() in intel_hfi_offline()
thermal: intel: int340x: Read DDR data rate for Nova Lake

+21 -6
+20 -5
drivers/thermal/intel/int340x_thermal/processor_thermal_rfim.c
··· 402 402 return sysfs_emit(buf, "%llu\n", resp); 403 403 } 404 404 405 + /* ddr_data_rate */ 406 + static const struct mmio_reg nvl_ddr_data_rate_reg = { 1, 0xE0, 10, 0x3FF, 2}; 407 + 408 + static const struct mmio_reg *ddr_data_rate_reg; 409 + 405 410 static ssize_t ddr_data_rate_show(struct device *dev, 406 411 struct device_attribute *attr, 407 412 char *buf) 408 413 { 409 - u16 id = 0x0107; 410 414 u64 resp; 411 - int ret; 412 415 413 - ret = processor_thermal_send_mbox_read_cmd(to_pci_dev(dev), id, &resp); 414 - if (ret) 415 - return ret; 416 + if (ddr_data_rate_reg) { 417 + u16 reg_val; 418 + 419 + pci_read_config_word(to_pci_dev(dev), ddr_data_rate_reg->offset, &reg_val); 420 + resp = (reg_val >> ddr_data_rate_reg->shift) & ddr_data_rate_reg->mask; 421 + resp = (resp * 3333) / 100; 422 + } else { 423 + const u16 id = 0x0107; 424 + int ret; 425 + 426 + ret = processor_thermal_send_mbox_read_cmd(to_pci_dev(dev), id, &resp); 427 + if (ret) 428 + return ret; 429 + } 416 430 417 431 return sysfs_emit(buf, "%llu\n", resp); 418 432 } ··· 475 461 case PCI_DEVICE_ID_INTEL_NVL_H_THERMAL: 476 462 case PCI_DEVICE_ID_INTEL_NVL_S_THERMAL: 477 463 dlvr_mmio_regs_table = nvl_dlvr_mmio_regs; 464 + ddr_data_rate_reg = &nvl_ddr_data_rate_reg; 478 465 break; 479 466 default: 480 467 dlvr_mmio_regs_table = dlvr_mmio_regs;
+1 -1
drivers/thermal/intel/intel_hfi.c
··· 526 526 mutex_lock(&hfi_instance_lock); 527 527 cpumask_clear_cpu(cpu, hfi_instance->cpus); 528 528 529 - if (!cpumask_weight(hfi_instance->cpus)) 529 + if (cpumask_empty(hfi_instance->cpus)) 530 530 hfi_disable(); 531 531 532 532 mutex_unlock(&hfi_instance_lock);