xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 07/11] x86/intel_pstate: changes in cpufreq_del_cpu for CPU offline
@ 2015-06-11  8:28 Wei Wang
  2015-06-11 14:04 ` Julien Grall
  2015-06-19  9:43 ` Jan Beulich
  0 siblings, 2 replies; 11+ messages in thread
From: Wei Wang @ 2015-06-11  8:28 UTC (permalink / raw)
  To: xen-devel, jbeulich; +Cc: andrew.cooper3, Wei Wang

cpufreq_cpu_policy is used in intel_pstate_set_pstate(), so we change
to NULL it after the call of cpufreq_driver->exit. Otherwise, a
calltrace will show up on your screen due to the reference of a NULL
pointer when you power down the system.

Signed-off-by: Wei Wang <wei.w.wang@intel.com>
---
 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 6003a8c..a8772e8 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->policy && (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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-23  8:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-11  8:28 [PATCH v3 07/11] x86/intel_pstate: changes in cpufreq_del_cpu for CPU offline Wei Wang
2015-06-11 14:04 ` Julien Grall
2015-06-12  2:01   ` Wang, Wei W
2015-06-12 11:39     ` Julien Grall
2015-06-15  0:31       ` Wang, Wei W
2015-06-15  9:13         ` Jan Beulich
2015-06-19  9:43 ` Jan Beulich
2015-06-23  6:16   ` Wang, Wei W
2015-06-23  8:08     ` Jan Beulich
2015-06-23  8:21       ` Wang, Wei W
2015-06-23  8:47         ` Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).