mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 13:41:48 -04:00
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
This commit is contained in:
@@ -402,17 +402,31 @@ static ssize_t rfi_restriction_show(struct device *dev,
|
||||
return sysfs_emit(buf, "%llu\n", resp);
|
||||
}
|
||||
|
||||
/* ddr_data_rate */
|
||||
static const struct mmio_reg nvl_ddr_data_rate_reg = { 1, 0xE0, 10, 0x3FF, 2};
|
||||
|
||||
static const struct mmio_reg *ddr_data_rate_reg;
|
||||
|
||||
static ssize_t ddr_data_rate_show(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
u16 id = 0x0107;
|
||||
u64 resp;
|
||||
int ret;
|
||||
|
||||
ret = processor_thermal_send_mbox_read_cmd(to_pci_dev(dev), id, &resp);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (ddr_data_rate_reg) {
|
||||
u16 reg_val;
|
||||
|
||||
pci_read_config_word(to_pci_dev(dev), ddr_data_rate_reg->offset, ®_val);
|
||||
resp = (reg_val >> ddr_data_rate_reg->shift) & ddr_data_rate_reg->mask;
|
||||
resp = (resp * 3333) / 100;
|
||||
} else {
|
||||
const u16 id = 0x0107;
|
||||
int ret;
|
||||
|
||||
ret = processor_thermal_send_mbox_read_cmd(to_pci_dev(dev), id, &resp);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return sysfs_emit(buf, "%llu\n", resp);
|
||||
}
|
||||
@@ -461,6 +475,7 @@ int proc_thermal_rfim_add(struct pci_dev *pdev, struct proc_thermal_device *proc
|
||||
case PCI_DEVICE_ID_INTEL_NVL_H_THERMAL:
|
||||
case PCI_DEVICE_ID_INTEL_NVL_S_THERMAL:
|
||||
dlvr_mmio_regs_table = nvl_dlvr_mmio_regs;
|
||||
ddr_data_rate_reg = &nvl_ddr_data_rate_reg;
|
||||
break;
|
||||
default:
|
||||
dlvr_mmio_regs_table = dlvr_mmio_regs;
|
||||
|
||||
@@ -526,7 +526,7 @@ void intel_hfi_offline(unsigned int cpu)
|
||||
mutex_lock(&hfi_instance_lock);
|
||||
cpumask_clear_cpu(cpu, hfi_instance->cpus);
|
||||
|
||||
if (!cpumask_weight(hfi_instance->cpus))
|
||||
if (cpumask_empty(hfi_instance->cpus))
|
||||
hfi_disable();
|
||||
|
||||
mutex_unlock(&hfi_instance_lock);
|
||||
|
||||
Reference in New Issue
Block a user