ia64/linux-2.6.18-xen.hg

changeset 662:e86f9e05144a

linux: make Xen cpufreq handling also work without _PSD objects

_PSD objects are optional according to the ACPI spec.

Also eliminate a pointless static variable.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Sep 08 14:02:13 2008 +0100 (2008-09-08)
parents 7886619f623e
children 035670ec617c
files arch/i386/kernel/acpi/processor_extcntl_xen.c drivers/acpi/processor_extcntl.c
line diff
     1.1 --- a/arch/i386/kernel/acpi/processor_extcntl_xen.c	Mon Sep 08 13:13:35 2008 +0100
     1.2 +++ b/arch/i386/kernel/acpi/processor_extcntl_xen.c	Mon Sep 08 14:02:13 2008 +0100
     1.3 @@ -32,8 +32,6 @@
     1.4  #include <acpi/processor.h>
     1.5  #include <asm/hypercall.h>
     1.6  
     1.7 -static int xen_processor_pmbits;
     1.8 -
     1.9  static int xen_cx_notifier(struct acpi_processor *pr, int action)
    1.10  {
    1.11  	int ret, count = 0, i;
    1.12 @@ -215,13 +213,13 @@ static struct processor_extcntl_ops xen_
    1.13  
    1.14  void arch_acpi_processor_init_extcntl(const struct processor_extcntl_ops **ops)
    1.15  {
    1.16 -	xen_processor_pmbits = (xen_start_info->flags & SIF_PM_MASK) >> 8;
    1.17 +	unsigned int pmbits = (xen_start_info->flags & SIF_PM_MASK) >> 8;
    1.18  
    1.19 -	if (xen_processor_pmbits & XEN_PROCESSOR_PM_CX)
    1.20 +	if (pmbits & XEN_PROCESSOR_PM_CX)
    1.21  		xen_extcntl_ops.pm_ops[PM_TYPE_IDLE] = xen_cx_notifier;
    1.22 -	if (xen_processor_pmbits & XEN_PROCESSOR_PM_PX)
    1.23 +	if (pmbits & XEN_PROCESSOR_PM_PX)
    1.24  		xen_extcntl_ops.pm_ops[PM_TYPE_PERF] = xen_px_notifier;
    1.25 -	if (xen_processor_pmbits & XEN_PROCESSOR_PM_TX)
    1.26 +	if (pmbits & XEN_PROCESSOR_PM_TX)
    1.27  		xen_extcntl_ops.pm_ops[PM_TYPE_THR] = xen_tx_notifier;
    1.28  
    1.29  	*ops = &xen_extcntl_ops;
     2.1 --- a/drivers/acpi/processor_extcntl.c	Mon Sep 08 13:13:35 2008 +0100
     2.2 +++ b/drivers/acpi/processor_extcntl.c	Mon Sep 08 14:02:13 2008 +0100
     2.3 @@ -203,13 +203,22 @@ static int processor_extcntl_get_perform
     2.4  	 * processor objects to external logic. In this case, it's preferred
     2.5  	 * to use ACPI ID instead.
     2.6  	 */
     2.7 -	pr->performance->domain_info.num_processors = 0;
     2.8 +	pdomain = &pr->performance->domain_info;
     2.9 +	pdomain->num_processors = 0;
    2.10  	ret = acpi_processor_get_psd(pr);
    2.11 -	if (ret < 0)
    2.12 -		goto err_out;
    2.13 +	if (ret < 0) {
    2.14 +		/*
    2.15 +		 * _PSD is optional - assume no coordination if absent (or
    2.16 +		 * broken), matching native kernels' behavior.
    2.17 +		 */
    2.18 +		pdomain->num_entries = ACPI_PSD_REV0_ENTRIES;
    2.19 +		pdomain->revision = ACPI_PSD_REV0_REVISION;
    2.20 +		pdomain->domain = pr->acpi_id;
    2.21 +		pdomain->coord_type = DOMAIN_COORD_TYPE_SW_ALL;
    2.22 +		pdomain->num_processors = 1;
    2.23 +	}
    2.24  
    2.25  	/* Some sanity check */
    2.26 -	pdomain = &pr->performance->domain_info;
    2.27  	if ((pdomain->revision != ACPI_PSD_REV0_REVISION) ||
    2.28  	    (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) ||
    2.29  	    ((pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ALL) &&