ia64/linux-2.6.18-xen.hg

changeset 628:b8916f4d48f6

Decouple xen controlled cpufreq path from dom0 CONFIG_CPU_FREQ,
since only processor_perflib.o is required for necessary freq
information parse. This avoids hacks to cpufreq drivers and
fortunately the change is not intrusive.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
Signed-off-by Jinsong Liu <jinsong.liu@inte.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jul 29 13:26:15 2008 +0100 (2008-07-29)
parents 2f1355579c9c
children 1d647ef26f3f
files arch/i386/kernel/acpi/Makefile arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c arch/i386/kernel/cpu/cpufreq/powernow-k8.c arch/x86_64/kernel/acpi/Makefile drivers/acpi/Makefile drivers/acpi/processor_core.c drivers/acpi/processor_extcntl.c drivers/acpi/processor_perflib.c drivers/cpufreq/Kconfig include/acpi/processor.h
line diff
     1.1 --- a/arch/i386/kernel/acpi/Makefile	Mon Jul 28 11:43:36 2008 +0100
     1.2 +++ b/arch/i386/kernel/acpi/Makefile	Tue Jul 29 13:26:15 2008 +0100
     1.3 @@ -4,7 +4,9 @@ obj-$(CONFIG_ACPI_SLEEP)	+= sleep.o wake
     1.4  
     1.5  ifneq ($(CONFIG_ACPI_PROCESSOR),)
     1.6  obj-y				+= cstate.o processor.o
     1.7 +ifneq ($(CONFIG_PROCESSOR_EXTERNAL_CONTROL),)
     1.8  obj-$(CONFIG_XEN)		+= processor_extcntl_xen.o
     1.9  endif
    1.10 +endif
    1.11  
    1.12  disabled-obj-$(CONFIG_XEN)	:= cstate.o wakeup.o
     2.1 --- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c	Mon Jul 28 11:43:36 2008 +0100
     2.2 +++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c	Tue Jul 29 13:26:15 2008 +0100
     2.3 @@ -568,17 +568,6 @@ acpi_cpufreq_init (void)
     2.4  {
     2.5  	dprintk("acpi_cpufreq_init\n");
     2.6  
     2.7 -#ifdef CONFIG_XEN
     2.8 -	/*
     2.9 -	 * This effectively blocks in-kernel cpufreq driver to interfere
    2.10 -	 * external control logic
    2.11 -	 */
    2.12 -	if (processor_pmperf_external()) {
    2.13 -		printk("CPUFREQ is controllerd externally...exit then!\n");
    2.14 -		return -1;
    2.15 -	}
    2.16 -#endif /* CONFIG_XEN */
    2.17 -
    2.18  	acpi_cpufreq_early_init_acpi();
    2.19  
    2.20  	return cpufreq_register_driver(&acpi_cpufreq_driver);
     3.1 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	Mon Jul 28 11:43:36 2008 +0100
     3.2 +++ b/arch/i386/kernel/cpu/cpufreq/powernow-k8.c	Tue Jul 29 13:26:15 2008 +0100
     3.3 @@ -1312,16 +1312,6 @@ static int __cpuinit powernowk8_init(voi
     3.4  {
     3.5  	unsigned int i, supported_cpus = 0;
     3.6  
     3.7 -#ifdef CONFIG_XEN
     3.8 -        /*
     3.9 -         * This effectively blocks in-kernel cpufreq driver to interfere
    3.10 -         * external control logic
    3.11 -         */
    3.12 -        if (processor_pmperf_external()) {
    3.13 -                return -ENODEV;
    3.14 -        }
    3.15 -#endif /* CONFIG_XEN */
    3.16 -
    3.17  	for_each_online_cpu(i) {
    3.18  		if (check_supported_cpu(i))
    3.19  			supported_cpus++;
     4.1 --- a/arch/x86_64/kernel/acpi/Makefile	Mon Jul 28 11:43:36 2008 +0100
     4.2 +++ b/arch/x86_64/kernel/acpi/Makefile	Tue Jul 29 13:26:15 2008 +0100
     4.3 @@ -6,8 +6,9 @@ ifneq ($(CONFIG_ACPI_PROCESSOR),)
     4.4  obj-y			+= processor.o
     4.5  processor-y		:= ../../../i386/kernel/acpi/processor.o ../../../i386/kernel/acpi/cstate.o
     4.6  processor-$(CONFIG_XEN)	:= ../../../i386/kernel/acpi/processor.o
     4.7 +ifneq ($(CONFIG_PROCESSOR_EXTERNAL_CONTROL),)
     4.8 +processor-$(CONFIG_XEN)	+= ../../../i386/kernel/acpi/processor_extcntl_xen.o
     4.9 +endif
    4.10  endif
    4.11  
    4.12 -obj-$(CONFIG_XEN)	+= processor_extcnt_xen.o
    4.13 -processor_extcnt_xen-$(CONFIG_XEN) := ../../../i386/kernel/acpi/processor_extcntl_xen.o
    4.14  disabled-obj-$(CONFIG_XEN) := wakeup.o
     5.1 --- a/drivers/acpi/Makefile	Mon Jul 28 11:43:36 2008 +0100
     5.2 +++ b/drivers/acpi/Makefile	Tue Jul 29 13:26:15 2008 +0100
     5.3 @@ -35,7 +35,7 @@ ifdef CONFIG_CPU_FREQ
     5.4  processor-objs	+= processor_perflib.o			
     5.5  endif
     5.6  ifdef CONFIG_PROCESSOR_EXTERNAL_CONTROL
     5.7 -processor-objs	+= processor_extcntl.o
     5.8 +processor-objs	+= processor_perflib.o processor_extcntl.o
     5.9  endif
    5.10  
    5.11  obj-y				+= sleep/
     6.1 --- a/drivers/acpi/processor_core.c	Mon Jul 28 11:43:36 2008 +0100
     6.2 +++ b/drivers/acpi/processor_core.c	Tue Jul 29 13:26:15 2008 +0100
     6.3 @@ -509,9 +509,7 @@ static int acpi_processor_get_info(struc
     6.4  		request_region(pr->throttling.address, 6, "ACPI CPU throttle");
     6.5  	}
     6.6  
     6.7 -#ifdef CONFIG_CPU_FREQ
     6.8  	acpi_processor_ppc_has_changed(pr);
     6.9 -#endif
    6.10  	acpi_processor_get_throttling_info(pr);
    6.11  	acpi_processor_get_limit_info(pr);
    6.12  
     7.1 --- a/drivers/acpi/processor_extcntl.c	Mon Jul 28 11:43:36 2008 +0100
     7.2 +++ b/drivers/acpi/processor_extcntl.c	Tue Jul 29 13:26:15 2008 +0100
     7.3 @@ -168,7 +168,6 @@ static int processor_extcntl_parse_csd(s
     7.4   * logic. So we have to collect raw performance information here 
     7.5   * when ACPI processor object is found and started.
     7.6   */
     7.7 -#ifdef CONFIG_CPU_FREQ
     7.8  static int processor_extcntl_get_performance(struct acpi_processor *pr)
     7.9  {
    7.10  	int ret;
    7.11 @@ -225,6 +224,3 @@ err_out:
    7.12  	kfree(perf);
    7.13  	return ret;
    7.14  }
    7.15 -#else
    7.16 -static int processor_extcntl_get_performance(struct acpi_processor *pr) { return 0; }
    7.17 -#endif
     8.1 --- a/drivers/acpi/processor_perflib.c	Mon Jul 28 11:43:36 2008 +0100
     8.2 +++ b/drivers/acpi/processor_perflib.c	Tue Jul 29 13:26:15 2008 +0100
     8.3 @@ -66,6 +66,7 @@ static DEFINE_MUTEX(performance_mutex);
     8.4  
     8.5  static int acpi_processor_ppc_status = 0;
     8.6  
     8.7 +#ifdef CONFIG_CPU_FREQ
     8.8  static int acpi_processor_ppc_notifier(struct notifier_block *nb,
     8.9  				       unsigned long event, void *data)
    8.10  {
    8.11 @@ -102,6 +103,7 @@ static int acpi_processor_ppc_notifier(s
    8.12  static struct notifier_block acpi_ppc_notifier_block = {
    8.13  	.notifier_call = acpi_processor_ppc_notifier,
    8.14  };
    8.15 +#endif	/* CONFIG_CPU_FREQ */
    8.16  
    8.17  static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
    8.18  {
    8.19 @@ -136,13 +138,16 @@ int acpi_processor_ppc_has_changed(struc
    8.20  	int ret = acpi_processor_get_platform_limit(pr);
    8.21  	if (ret < 0)
    8.22  		return (ret);
    8.23 -	else if (processor_pmperf_external())
    8.24 +	else
    8.25 +#ifdef CONFIG_CPU_FREQ
    8.26 +		return cpufreq_update_policy(pr->id);
    8.27 +#elif CONFIG_PROCESSOR_EXTERNAL_CONTROL
    8.28  		return processor_notify_external(pr,
    8.29  				PROCESSOR_PM_CHANGE, PM_TYPE_PERF);
    8.30 -	else
    8.31 -		return cpufreq_update_policy(pr->id);
    8.32 +#endif
    8.33  }
    8.34  
    8.35 +#ifdef CONFIG_CPU_FREQ
    8.36  void acpi_processor_ppc_init(void)
    8.37  {
    8.38  	if (!cpufreq_register_notifier
    8.39 @@ -161,6 +166,7 @@ void acpi_processor_ppc_exit(void)
    8.40  
    8.41  	acpi_processor_ppc_status &= ~PPC_REGISTERED;
    8.42  }
    8.43 +#endif	/* CONFIG_CPU_FREQ */
    8.44  
    8.45  static int acpi_processor_get_performance_control(struct acpi_processor *pr)
    8.46  {
    8.47 @@ -337,6 +343,7 @@ int acpi_processor_get_performance_info(
    8.48  	return 0;
    8.49  }
    8.50  
    8.51 +#ifdef CONFIG_CPU_FREQ
    8.52  int acpi_processor_notify_smm(struct module *calling_module)
    8.53  {
    8.54  	acpi_status status;
    8.55 @@ -404,6 +411,7 @@ int acpi_processor_notify_smm(struct mod
    8.56  }
    8.57  
    8.58  EXPORT_SYMBOL(acpi_processor_notify_smm);
    8.59 +#endif	/* CONFIG_CPU_FREQ */
    8.60  
    8.61  #ifdef CONFIG_X86_ACPI_CPUFREQ_PROC_INTF
    8.62  /* /proc/acpi/processor/../performance interface (DEPRECATED) */
     9.1 --- a/drivers/cpufreq/Kconfig	Mon Jul 28 11:43:36 2008 +0100
     9.2 +++ b/drivers/cpufreq/Kconfig	Tue Jul 29 13:26:15 2008 +0100
     9.3 @@ -1,5 +1,6 @@
     9.4  config CPU_FREQ
     9.5  	bool "CPU Frequency scaling"
     9.6 +	depends on !PROCESSOR_EXTERNAL_CONTROL
     9.7  	help
     9.8  	  CPU Frequency scaling allows you to change the clock speed of 
     9.9  	  CPUs on the fly. This is a nice method to save power, because 
    10.1 --- a/include/acpi/processor.h	Mon Jul 28 11:43:36 2008 +0100
    10.2 +++ b/include/acpi/processor.h	Tue Jul 29 13:26:15 2008 +0100
    10.3 @@ -254,6 +254,9 @@ static inline void acpi_processor_ppc_ex
    10.4  {
    10.5  	return;
    10.6  }
    10.7 +#ifdef CONFIG_PROCESSOR_EXTERNAL_CONTROL
    10.8 +int acpi_processor_ppc_has_changed(struct acpi_processor *pr);
    10.9 +#else
   10.10  static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr)
   10.11  {
   10.12  	static unsigned int printout = 1;
   10.13 @@ -266,6 +269,7 @@ static inline int acpi_processor_ppc_has
   10.14  	}
   10.15  	return 0;
   10.16  }
   10.17 +#endif				/* CONFIG_PROCESSOR_EXTERNAL_CONTROL */
   10.18  #endif				/* CONFIG_CPU_FREQ */
   10.19  
   10.20  /* in processor_throttling.c */