From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Wang Subject: [PATCH v4 08/11] x86/intel_pstate: changes in cpufreq_del_cpu for CPU offline Date: Thu, 25 Jun 2015 19:16:50 +0800 Message-ID: <1435231010-22637-1-git-send-email-wei.w.wang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: jbeulich@suse.com, andrew.cooper3@citrix.com, xen-devel@lists.xen.org Cc: Wei Wang List-Id: xen-devel@lists.xenproject.org We change to NULL the cpufreq_cpu_policy pointer after the call of cpufreq_driver->exit, because the pointer is still needed in intel_pstate_set_pstate(). v4 changes: None. Signed-off-by: Wei Wang --- xen/drivers/cpufreq/cpufreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c index acc4bb5..d1b423f 100644 --- a/xen/drivers/cpufreq/cpufreq.c +++ b/xen/drivers/cpufreq/cpufreq.c @@ -335,12 +335,11 @@ int cpufreq_del_cpu(unsigned int cpu) /* for HW_ALL, stop gov for each core of the _PSD domain */ /* for SW_ALL & SW_ANY, stop gov for the 1st core of the _PSD domain */ - if (hw_all || (cpumask_weight(cpufreq_dom->map) == - perf->domain_info.num_processors)) + if (!policy->internal_gov && (hw_all || (cpumask_weight(cpufreq_dom->map) == + perf->domain_info.num_processors))) __cpufreq_governor(policy, CPUFREQ_GOV_STOP); cpufreq_statistic_exit(cpu); - per_cpu(cpufreq_cpu_policy, cpu) = NULL; cpumask_clear_cpu(cpu, policy->cpus); cpumask_clear_cpu(cpu, cpufreq_dom->map); @@ -349,6 +348,7 @@ int cpufreq_del_cpu(unsigned int cpu) free_cpumask_var(policy->cpus); xfree(policy); } + per_cpu(cpufreq_cpu_policy, cpu) = NULL; /* for the last cpu of the domain, clean room */ /* It's safe here to free freq_table, drv_data and policy */ -- 1.9.1