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] x86, hpet: Avoud double initialisation on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86, hpet: Avoud double initialisation on boot or after S3.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 Nov 2008 08:10:44 -0800
Delivery-date: Wed, 19 Nov 2008 08:13:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1227098911 0
# Node ID 876bffced2b8d9102bcba20d154f72ffbdeb7ac5
# Parent  9958ef441af035913f5c595350c5dfe1196f206b
x86, hpet: Avoud double initialisation on boot or after S3.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/acpi/power.c  |    3 +++
 xen/arch/x86/hpet.c        |    8 +++++---
 xen/include/asm-x86/acpi.h |    3 +++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff -r 9958ef441af0 -r 876bffced2b8 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c Wed Nov 19 12:40:23 2008 +0000
+++ b/xen/arch/x86/acpi/power.c Wed Nov 19 12:48:31 2008 +0000
@@ -30,6 +30,8 @@
 
 #include <acpi/cpufreq/cpufreq.h>
 
+uint32_t system_reset_counter = 1;
+
 static char opt_acpi_sleep[20];
 string_param("acpi_sleep", opt_acpi_sleep);
 
@@ -163,6 +165,7 @@ static int enter_state(u32 state)
     {
     case ACPI_STATE_S3:
         do_suspend_lowlevel();
+        system_reset_counter++;
         break;
     case ACPI_STATE_S5:
         acpi_enter_sleep_state(ACPI_STATE_S5);
diff -r 9958ef441af0 -r 876bffced2b8 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c       Wed Nov 19 12:40:23 2008 +0000
+++ b/xen/arch/x86/hpet.c       Wed Nov 19 12:48:31 2008 +0000
@@ -264,12 +264,14 @@ int hpet_legacy_irq_tick(void)
 
 u64 hpet_setup(void)
 {
-    u64 hpet_rate;
+    static u64 hpet_rate;
+    static u32 system_reset_latch;
     u32 hpet_id, hpet_period, cfg;
     int i;
 
-    if ( hpet_address == 0 )
-        return 0;
+    if ( system_reset_latch == system_reset_counter )
+        return hpet_rate;
+    system_reset_latch = system_reset_counter;
 
     set_fixmap_nocache(FIX_HPET_BASE, hpet_address);
 
diff -r 9958ef441af0 -r 876bffced2b8 xen/include/asm-x86/acpi.h
--- a/xen/include/asm-x86/acpi.h        Wed Nov 19 12:40:23 2008 +0000
+++ b/xen/include/asm-x86/acpi.h        Wed Nov 19 12:48:31 2008 +0000
@@ -166,4 +166,7 @@ extern u8 x86_acpiid_to_apicid[];
 
 extern int acpi_dmar_init(void);
 
+/* Incremented whenever we transition through S3. Value is 1 during boot. */
+extern uint32_t system_reset_counter;
+
 #endif /*__X86_ASM_ACPI_H*/

_______________________________________________
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] x86, hpet: Avoud double initialisation on boot or after S3., Xen patchbot-unstable <=