ia64/xen-unstable

changeset 18558:b5f20f7ac2b3

CPUIDLE: Initialize timer broadcast mechanism for C2

Without this patch, while running on platforms on which the deepest
C-state is C2, acpi_processor_idle fns will call into NULL
function. This has been the case since 18518:e61c7833dc9d8.

Signed-off-by: Wei Gang <gang.wei@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Sep 26 17:12:56 2008 +0100 (2008-09-26)
parents 1420a6649cfa
children 6871f484430c
files xen/arch/x86/acpi/cpu_idle.c
line diff
     1.1 --- a/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 26 17:09:36 2008 +0100
     1.2 +++ b/xen/arch/x86/acpi/cpu_idle.c	Fri Sep 26 17:12:56 2008 +0100
     1.3 @@ -81,7 +81,7 @@ static void print_acpi_power(uint32_t cp
     1.4      for ( i = 1; i < power->count; i++ )
     1.5      {
     1.6          printk((power->last_state == &power->states[i]) ? "   *" : "    ");
     1.7 -        printk("C%d:\t\t", i);
     1.8 +        printk("C%d:\t", i);
     1.9          printk("type[C%d] ", power->states[i].type);
    1.10          printk("latency[%03d] ", power->states[i].latency);
    1.11          printk("usage[%08d] ", power->states[i].usage);
    1.12 @@ -487,8 +487,12 @@ static int check_cx(struct acpi_processo
    1.13          return -ENODEV;
    1.14      }
    1.15  
    1.16 -    if ( cx->type == ACPI_STATE_C3 )
    1.17 +    switch ( cx->type )
    1.18      {
    1.19 +    case ACPI_STATE_C2:
    1.20 +        if ( local_apic_timer_c2_ok )
    1.21 +            break;
    1.22 +    case ACPI_STATE_C3:
    1.23          /* We must be able to use HPET in place of LAPIC timers. */
    1.24          if ( hpet_broadcast_is_available() )
    1.25          {
    1.26 @@ -551,6 +555,8 @@ static int check_cx(struct acpi_processo
    1.27              }
    1.28              acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0);
    1.29          }
    1.30 +
    1.31 +        break;
    1.32      }
    1.33  
    1.34      return 0;