login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
June
»
24
Re: [PATCH] RTC: Fix CMOS time error after writing /proc/acpi/alarm
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Zhao Yakui <yakui.zhao@...>
To: Chen, Huacai <huacai.chen@...>
Cc: <linux-acpi@...>, <linux-pm@...>, <rtc-linux@...>, <lenb@...>, <p_gortmaker@...>, <a.zummo@...>, <linux-kernel@...>
Subject:
Re: [PATCH] RTC: Fix CMOS time error after writing /proc/acpi/alarm
Date: Tuesday, June 24, 2008 - 2:37 am
On Mon, 2008-06-23 at 18:52 +0800, Chen, Huacai wrote:
quoted text
> From: Huacai Chen <huacai.chen@intel.com> > > 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 > Then the system time may be reset to the date of manufacture after > rebooting. This patch fixed this issue. > Signed-off-by: Huacai Chen <huacai.chen@intel.com> > Acked-by: Pavel Machek <pavel@suse.cz> > --- > diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c > index 224c57c..c9fdf7b 100644 > --- a/drivers/acpi/sleep/proc.c > +++ b/drivers/acpi/sleep/proc.c > @@ -315,8 +315,11 @@ acpi_system_write_alarm(struct file *file, > cmos_bcd_write(day, acpi_gbl_FADT.day_alarm, > rtc_control); > if (acpi_gbl_FADT.month_alarm) > cmos_bcd_write(mo, acpi_gbl_FADT.month_alarm, > rtc_control); > - if (acpi_gbl_FADT.century) > + if (acpi_gbl_FADT.century) { > + if (adjust) > + yr += cmos_bcd_read(acpi_gbl_FADT.century, > rtc_control) * 100; > cmos_bcd_write(yr / 100, acpi_gbl_FADT.century, > rtc_control); > + }
this is OK.
quoted text
> /* enable the rtc alarm interrupt */ > rtc_control |= RTC_AIE; > CMOS_WRITE(rtc_control, RTC_CONTROL); > --- > This is for Linux 2.6.26-rc7. > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to
majordomo@vger.kernel.org
> More majordomo info at
http://vger.kernel.org/majordomo-info.html
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH] RTC: Fix CMOS time error after writing /proc/acpi/al...
, Chen, Huacai
, (Mon Jun 23, 6:52 am)
Re: [PATCH] RTC: Fix CMOS time error after writing /proc/acp...
, Alessandro Zummo
, (Wed Jun 25, 4:44 am)
Re: [PATCH] RTC: Fix CMOS time error after writing /proc/acp...
, Zhao Yakui
, (Tue Jun 24, 2:37 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Heiko Carstens
Re: -mm merge plans for 2.6.23 -- sys_fallocate
Linus Torvalds
Linux 2.6.21-rc4
Michael Kerrisk
nanosleep() uses CLOCK_MONOTONIC, should be CLOCK_REALTIME?
Linus Torvalds
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
git
:
linux-netdev
:
Gary Thomas
Marvell 88E609x switch?
Gerrit Renker
[PATCH 15/37] dccp: Set per-connection CCIDs via socket options
David Miller
[GIT]: Networking
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
2 users
and
928 guests
online.
Online users
Nelson
lwdumeno
Syndicate