ia64/linux-2.6.18-xen.hg

changeset 675:37802a5c9f53

acpi: fix processor handling in presence of external control

- avoid leaking stuff in acpi_processor_remove()
- remove a pointless change to native code in acpi_processor_hotplug()
(struct acpi_processor's id field is unsigned)
- don't set up processor_extcntl_ops when nothing controlled by Xen
(thus processor_cntl_external() will always return false, allowing
ACPI code to retain native behavior)

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Sep 22 15:55:16 2008 +0100 (2008-09-22)
parents 5f3c40a4c214
children 916aae9cc11a
files arch/i386/kernel/acpi/processor_extcntl_xen.c drivers/acpi/pci_link.c drivers/acpi/processor_core.c
line diff
     1.1 --- a/arch/i386/kernel/acpi/processor_extcntl_xen.c	Thu Sep 18 10:44:15 2008 +0100
     1.2 +++ b/arch/i386/kernel/acpi/processor_extcntl_xen.c	Mon Sep 22 15:55:16 2008 +0100
     1.3 @@ -233,6 +233,8 @@ void arch_acpi_processor_init_extcntl(co
     1.4  {
     1.5  	unsigned int pmbits = (xen_start_info->flags & SIF_PM_MASK) >> 8;
     1.6  
     1.7 +	if (!pmbits)
     1.8 +		return;
     1.9  	if (pmbits & XEN_PROCESSOR_PM_CX)
    1.10  		xen_extcntl_ops.pm_ops[PM_TYPE_IDLE] = xen_cx_notifier;
    1.11  	if (pmbits & XEN_PROCESSOR_PM_PX)
     2.1 --- a/drivers/acpi/pci_link.c	Thu Sep 18 10:44:15 2008 +0100
     2.2 +++ b/drivers/acpi/pci_link.c	Mon Sep 22 15:55:16 2008 +0100
     2.3 @@ -762,7 +762,7 @@ static int acpi_pci_link_add(struct acpi
     2.4  
     2.5        end:
     2.6  	/* disable all links -- to be activated on use */
     2.7 -	acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL);
     2.8 +	//acpi_ut_evaluate_object(device->handle, "_DIS", 0, NULL);
     2.9  	mutex_unlock(&acpi_link_lock);
    2.10  
    2.11  	if (result)
     3.1 --- a/drivers/acpi/processor_core.c	Thu Sep 18 10:44:15 2008 +0100
     3.2 +++ b/drivers/acpi/processor_core.c	Mon Sep 22 15:55:16 2008 +0100
     3.3 @@ -664,7 +664,7 @@ static int acpi_processor_remove(struct 
     3.4  
     3.5  	pr = (struct acpi_processor *)acpi_driver_data(device);
     3.6  
     3.7 -	if (pr->id >= NR_CPUS) {
     3.8 +	if (!processor_cntl_external() && pr->id >= NR_CPUS) {
     3.9  		kfree(pr);
    3.10  		return 0;
    3.11  	}
    3.12 @@ -816,12 +816,7 @@ acpi_processor_hotplug_notify(acpi_handl
    3.13  			return;
    3.14  		}
    3.15  
    3.16 -#ifdef CONFIG_XEN
    3.17 -		if ((pr->id >= 0) && (pr->id < NR_CPUS)
    3.18 -		    && (cpu_present(pr->id)))
    3.19 -#else
    3.20  		if ((pr->id < NR_CPUS) && (cpu_present(pr->id)))
    3.21 -#endif /* CONFIG_XEN */
    3.22  			kobject_uevent(&device->kobj, KOBJ_OFFLINE);
    3.23  
    3.24  		if (processor_cntl_external())