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] [linux-2.6.18-xen] Fix CMOS time error after writing /pr

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] Fix CMOS time error after writing /proc/acpi/alarm
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Jun 2008 13:00:11 -0700
Delivery-date: Fri, 27 Jun 2008 13:00:08 -0700
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 1214574401 -3600
# Node ID e7b48c70c7270d46ba645fc643b63bb49860ea44
# Parent  043dc7488c1105670a78cd45efa459fc4defa52d
Fix CMOS time error after writing /proc/acpi/alarm

When writing /proc/acpi/alarm in adjust mode, e.g.
        echo "+0000-00-00 00:00:15" >/proc/acpi/alarm
The "century" field should be read and added to "year" field before
writing, otherwise the CMOS time will go back to 2000 years ago, e.g.
        # cat /proc/acpi/alarm
        0008-06-21 11:38:46=20
Then the system time may be reset to the date of manufacture after
rebooting. This patch fixes this issue.

Signed-off-by: Huacai Chen <huacai.chen@xxxxxxxxx>
---
 drivers/acpi/sleep/proc.c |    2 ++
 1 files changed, 2 insertions(+)

diff -r 043dc7488c11 -r e7b48c70c727 drivers/acpi/sleep/proc.c
--- a/drivers/acpi/sleep/proc.c Tue Jun 24 21:02:47 2008 +0100
+++ b/drivers/acpi/sleep/proc.c Fri Jun 27 14:46:41 2008 +0100
@@ -251,6 +251,8 @@ acpi_system_write_alarm(struct file *fil
 
        if (adjust) {
                yr += CMOS_READ(RTC_YEAR);
+               if (acpi_gbl_FADT->century)
+                       yr += CMOS_READ(acpi_gbl_FADT->century) * 100;
                mo += CMOS_READ(RTC_MONTH);
                day += CMOS_READ(RTC_DAY_OF_MONTH);
                hr += CMOS_READ(RTC_HOURS);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] Fix CMOS time error after writing /proc/acpi/alarm, Xen patchbot-linux-2.6.18-xen <=