WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Xen PM: Enter all ACPI S states on boot C

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Xen PM: Enter all ACPI S states on boot CPU.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Jul 2007 03:15:35 -0700
Delivery-date: Fri, 27 Jul 2007 03:13:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1184924331 -3600
# Node ID ae672309bb95c2d9fb7d6898bbbfbc72ade0a811
# Parent  bb5c23bbc7b7e233dc0db3834a73ee3e0f00d545
Xen PM: Enter all ACPI S states on boot CPU.
Signed-off-by: Kevin Tian <kevin.tian@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/acpi/power.c |   34 +++++++++++-----------------------
 1 files changed, 11 insertions(+), 23 deletions(-)

diff -r bb5c23bbc7b7 -r ae672309bb95 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c Fri Jul 20 09:38:27 2007 +0100
+++ b/xen/arch/x86/acpi/power.c Fri Jul 20 10:38:51 2007 +0100
@@ -124,7 +124,7 @@ static int enter_state(u32 state)
 
     if ( !spin_trylock(&pm_lock) )
         return -EBUSY;
-    
+
     pmprintk(XENLOG_INFO, "PM: Preparing system for %s sleep\n",
         acpi_states[state]);
 
@@ -153,12 +153,15 @@ static int enter_state(u32 state)
 
     switch ( state )
     {
-        case ACPI_STATE_S3:
-            do_suspend_lowlevel();
-            break;
-        default:
-            error = -EINVAL;
-            break;
+    case ACPI_STATE_S3:
+        do_suspend_lowlevel();
+        break;
+    case ACPI_STATE_S5:
+        acpi_enter_sleep_state(ACPI_STATE_S5);
+        break;
+    default:
+        error = -EINVAL;
+        break;
     }
 
     pmprintk(XENLOG_INFO, "Back to C!\n");
@@ -181,14 +184,6 @@ static int enter_state(u32 state)
     thaw_domains();
     spin_unlock(&pm_lock);
     return error;
-}
-
-static void acpi_power_off(void)
-{
-    pmprintk(XENLOG_INFO, "%s called\n", __FUNCTION__);
-    local_irq_disable();
-    /* Some SMP machines only can poweroff in boot CPU */
-    acpi_enter_sleep_state(ACPI_STATE_S5);
 }
 
 static long enter_state_helper(void *data)
@@ -227,7 +222,7 @@ int acpi_enter_sleep(struct xenpf_enter_
     if ( !(sleep->pm1a_cnt_val & ACPI_BITMASK_SLEEP_ENABLE) )
     {
         outw((u16)sleep->pm1a_cnt_val, acpi_sinfo.pm1a_cnt);
-        if (acpi_sinfo.pm1b_cnt)
+        if ( acpi_sinfo.pm1b_cnt )
             outw((u16)sleep->pm1b_cnt_val, acpi_sinfo.pm1b_cnt);
         return 0;
     }
@@ -236,13 +231,6 @@ int acpi_enter_sleep(struct xenpf_enter_
     acpi_sinfo.pm1a_cnt_val = sleep->pm1a_cnt_val;
     acpi_sinfo.pm1b_cnt_val = sleep->pm1b_cnt_val;
     acpi_sinfo.sleep_state = sleep->sleep_state;
-
-    /* ACPI power-off method. */
-    if ( acpi_sinfo.sleep_state == ACPI_STATE_S5 )
-    {
-        for ( ; ; )
-            acpi_power_off();
-    }
 
     return continue_hypercall_on_cpu(0, enter_state_helper, &acpi_sinfo);
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Xen PM: Enter all ACPI S states on boot CPU., Xen patchbot-unstable <=