diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index a9edbb4924a7..3836beade59f 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c @@ -568,9 +568,6 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu, u64 val; int err; - if (!housekeeping_cpu(cpu, HK_TYPE_MISC)) - return 0; - tdata = init_temp_data(pdata, cpu, pkg_flag); if (!tdata) return -ENOMEM; @@ -690,6 +687,14 @@ static int coretemp_cpu_online(unsigned int cpu) if (!cpu_has(c, X86_FEATURE_DTHERM)) return -ENODEV; + /* + * Keep isolated CPUs out of pdata->cpumask. Besides tracking the CPUs + * available to this driver, the mask is used to select the CPU on which + * to read the temperature MSRs. + */ + if (!housekeeping_cpu(cpu, HK_TYPE_MISC)) + return 0; + pdata = platform_get_drvdata(pdev); if (!pdata->hwmon_dev) { struct device *hwmon; @@ -719,8 +724,8 @@ static int coretemp_cpu_online(unsigned int cpu) } /* - * Check whether a thread sibling is already online. If not add the - * interface for this CPU core. + * Check whether a housekeeping thread sibling is already online. If + * not, add the interface for this CPU core. */ if (!cpumask_intersects(&pdata->cpumask, topology_sibling_cpumask(cpu))) coretemp_add_core(pdev, cpu, 0); @@ -750,9 +755,9 @@ static int coretemp_cpu_offline(unsigned int cpu) cpumask_clear_cpu(cpu, &pd->cpumask); /* - * If this is the last thread sibling, remove the CPU core - * interface, If there is still a sibling online, transfer the - * target cpu of that core interface to it. + * If this is the last housekeeping thread sibling, remove the CPU core + * interface. If there is still a housekeeping sibling online, transfer + * the target CPU of that core interface to it. */ target = cpumask_any_and(&pd->cpumask, topology_sibling_cpumask(cpu)); if (target >= nr_cpu_ids) { @@ -764,7 +769,8 @@ static int coretemp_cpu_offline(unsigned int cpu) } /* - * If all cores in this pkg are offline, remove the interface. + * If all housekeeping cores in this pkg are offline, remove the + * interface. */ tdata = get_temp_data(pd, -1); if (cpumask_empty(&pd->cpumask)) { @@ -777,7 +783,7 @@ static int coretemp_cpu_offline(unsigned int cpu) /* * Check whether this core is the target for the package - * interface. We need to assign it to some other cpu. + * interface. We need to assign it to some other housekeeping CPU. */ if (tdata && tdata->cpu == cpu) { target = cpumask_first(&pd->cpumask);