ia64/linux-2.6.18-xen.hg

changeset 626:e39575a1d8af

acpi: Fix broken extctnl mechanism.

Fn arch_acpi_processor_init_extcntl need to be called before any
acpi_processor init stuff, otherwise many special paths for
xen-cpu-idle & xen-cpu-freq can't get executed. So keep
arch_acpi_processor_init_extcntl call in processor_extcntl_init and
call it very early, move other stuff of processor_extcntl_init into a
new fn processor_extcntl_prepare.

Signed-off-by: Wei Gang <gang.wei@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jul 28 11:26:33 2008 +0100 (2008-07-28)
parents 6d9e4b02bba4
children 2f1355579c9c
files drivers/acpi/processor_core.c drivers/acpi/processor_extcntl.c include/acpi/processor.h
line diff
     1.1 --- a/drivers/acpi/processor_core.c	Fri Jul 25 09:42:29 2008 +0100
     1.2 +++ b/drivers/acpi/processor_core.c	Mon Jul 28 11:26:33 2008 +0100
     1.3 @@ -526,6 +526,7 @@ static int acpi_processor_start(struct a
     1.4  	acpi_status status = AE_OK;
     1.5  	struct acpi_processor *pr;
     1.6  
     1.7 +	processor_extcntl_init();
     1.8  
     1.9  	pr = acpi_driver_data(device);
    1.10  
    1.11 @@ -579,7 +580,7 @@ static int acpi_processor_start(struct a
    1.12  
    1.13  	acpi_processor_power_init(pr, device);
    1.14  
    1.15 -	result = processor_extcntl_init(pr);
    1.16 +	result = processor_extcntl_prepare(pr);
    1.17  	if (result)
    1.18  		goto end;
    1.19  
     2.1 --- a/drivers/acpi/processor_extcntl.c	Fri Jul 25 09:42:29 2008 +0100
     2.2 +++ b/drivers/acpi/processor_extcntl.c	Mon Jul 28 11:26:33 2008 +0100
     2.3 @@ -105,13 +105,28 @@ int processor_notify_external(struct acp
     2.4  }
     2.5  
     2.6  /*
     2.7 + * External control logic can decide to grab full or part of physical
     2.8 + * processor control bits. Take a VMM for example, physical processors
     2.9 + * are owned by VMM and thus existence information like hotplug is
    2.10 + * always required to be notified to VMM. Similar is processor idle
    2.11 + * state which is also necessarily controlled by VMM. But for other
    2.12 + * control bits like performance/throttle states, VMM may choose to
    2.13 + * control or not upon its own policy.
    2.14 + */
    2.15 +void processor_extcntl_init(void)
    2.16 +{
    2.17 +	if (!processor_extcntl_ops)
    2.18 +		arch_acpi_processor_init_extcntl(&processor_extcntl_ops);
    2.19 +}
    2.20 +
    2.21 +/*
    2.22   * This is called from ACPI processor init, and targeted to hold
    2.23   * some tricky housekeeping jobs to satisfy external control model.
    2.24   * For example, we may put dependency parse stub here for idle
    2.25   * and performance state. Those information may be not available
    2.26   * if splitting from dom0 control logic like cpufreq driver.
    2.27   */
    2.28 -int __cpuinit processor_extcntl_init(struct acpi_processor *pr)
    2.29 +int processor_extcntl_prepare(struct acpi_processor *pr)
    2.30  {
    2.31  	/* parse cstate dependency information */
    2.32  	if (processor_pm_external())
    2.33 @@ -121,18 +136,6 @@ int __cpuinit processor_extcntl_init(str
    2.34  	if (processor_pmperf_external())
    2.35  		processor_extcntl_get_performance(pr);
    2.36  
    2.37 -	/*
    2.38 -	 * External control logic can decide to grab full or part of physical
    2.39 -	 * processor control bits. Take a VMM for example, physical processors
    2.40 -	 * are owned by VMM and thus existence information like hotplug is
    2.41 -	 * always required to be notified to VMM. Similar is processor idle
    2.42 -	 * state which is also necessarily controlled by VMM. But for other
    2.43 -	 * control bits like performance/throttle states, VMM may choose to
    2.44 -	 * control or not upon its own policy.
    2.45 -	 */
    2.46 -	if (!processor_extcntl_ops)
    2.47 -		arch_acpi_processor_init_extcntl(&processor_extcntl_ops);
    2.48 -
    2.49  	return 0;
    2.50  }
    2.51  
     3.1 --- a/include/acpi/processor.h	Fri Jul 25 09:42:29 2008 +0100
     3.2 +++ b/include/acpi/processor.h	Mon Jul 28 11:26:33 2008 +0100
     3.3 @@ -351,7 +351,8 @@ static inline int processor_pmthr_extern
     3.4  
     3.5  extern int processor_notify_external(struct acpi_processor *pr,
     3.6  			int event, int type);
     3.7 -extern int processor_extcntl_init(struct acpi_processor *pr);
     3.8 +extern void processor_extcntl_init(void);
     3.9 +extern int processor_extcntl_prepare(struct acpi_processor *pr);
    3.10  extern int acpi_processor_get_performance_info(struct acpi_processor *pr);
    3.11  extern int acpi_processor_get_psd(struct acpi_processor *pr);
    3.12  void arch_acpi_processor_init_extcntl(const struct processor_extcntl_ops **);
    3.13 @@ -365,7 +366,8 @@ static inline int processor_notify_exter
    3.14  {
    3.15  	return 0;
    3.16  }
    3.17 -static inline int processor_extcntl_init(struct acpi_processor *pr)
    3.18 +static inline void processor_extcntl_init(void) {}
    3.19 +static inline int processor_extcntl_prepare(struct acpi_processor *pr)
    3.20  {
    3.21  	return 0;
    3.22  }