xen changeset 18125(
ab1d7db3facb) changed some px init logic, which
has some effect to Px statistic and S3 suspend/resume logic.
This patch change Px control protection corresponding to changeset
18125.
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
{
int cpu;
- /* to protect the case when Px was controlled by dom0-kernel */
- /* or when CPU_FREQ not set in which case ACPI Px objects not parsed */
+ /* to protect the case when Px was not controlled by xen */
for_each_online_cpu(cpu) {
struct processor_performance *perf = &processor_pminfo[cpu].perf;
- if (!perf->init)
+ if (!(perf->init & XEN_PX_INIT))
return;
}
{
int cpu, ret = 0;
- /* 1. to protect the case when Px was controlled by dom0-kernel */
- /* or when CPU_FREQ not set in which case ACPI Px objects not parsed */
+ /* 1. to protect the case when Px was not controlled by xen */
/* 2. set state and resume flag to sync cpu to right state and freq */
for_each_online_cpu(cpu) {
struct processor_performance *perf = &processor_pminfo[cpu].perf;
struct cpufreq_policy *policy = &xen_px_policy[cpu];
- if (!perf->init)
+ if (!(perf->init & XEN_PX_INIT))
goto err;
perf->state = 0;
policy->resume = 1;
struct pm_px *pxpt = &px_statistic_data[op->cpuid];
struct processor_pminfo *pmpt = &processor_pminfo[op->cpuid];
- /* to protect the case when Px was controlled by dom0-kernel */
- /* or when CPU_FREQ not set in which case ACPI Px objects not parsed */
- if ( !pmpt->perf.init && (op->type & PMSTAT_CATEGORY_MASK) == PMSTAT_PX )
+ /* to protect the case when Px was not controlled by xen */
+ if ( (!(pmpt->perf.init & XEN_PX_INIT)) &&
+ (op->type & PMSTAT_CATEGORY_MASK) == PMSTAT_PX )
return -EINVAL;
if ( !cpu_online(op->cpuid) )
if ( pxpt->init == ( XEN_PX_PCT | XEN_PX_PSS |
XEN_PX_PSD | XEN_PX_PPC ) )
{
- pxpt->init |= 0x80000000;
+ pxpt->init |= XEN_PX_INIT;
cpu_count++;
}
if ( cpu_count == num_online_cpus() )
#include <public/platform.h>
#include <public/sysctl.h>
+#define XEN_PX_INIT 0x80000000
+
int get_cpu_id(u8);
int acpi_cpufreq_init(void);
int powernow_cpufreq_init(void);