From: Mark Lord My Foxconn motherboard has ICH8 + AWARD BIOS. The BIOS seems to prefer to maintain the RTC alarm in BCD format rather than binary. The existing code in linux/drivers/acpi/sleep/proc.c has a nasty bug that prevents BCD mode from working: the code converts binary to BCD three times in a row, each time taking the previous result. This thoroughly mangles the alarm timestamp, and never worked. The patch below fixes it, by removing the first two (bogus) conversions, and leaving only the final conversion in place. Tested & working on my system here. Note for future enhancement: fix the code to either handle 12-hour mode (as opposed to the more sensible 24-hour mode) timekeeping, or at least have it complain loudly when 12-hour mode is detected. Signed-off-by: Mark Lord Cc: David Brownell Cc: Len Brown Cc: Andrew Morton Signed-off-by: Andrew Morton --- drivers/acpi/sleep/proc.c | 17 ----------------- 1 file changed, 17 deletions(-) diff -puN drivers/acpi/sleep/proc.c~fix-proc-acpi-alarm-to-work-with-bcd-alarm-encodings-award drivers/acpi/sleep/proc.c --- a/drivers/acpi/sleep/proc.c~fix-proc-acpi-alarm-to-work-with-bcd-alarm-encodings-award +++ a/drivers/acpi/sleep/proc.c @@ -258,14 +258,6 @@ acpi_system_write_alarm(struct file *fil spin_lock_irq(&rtc_lock); rtc_control = CMOS_READ(RTC_CONTROL); - if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BIN_TO_BCD(yr); - BIN_TO_BCD(mo); - BIN_TO_BCD(day); - BIN_TO_BCD(hr); - BIN_TO_BCD(min); - BIN_TO_BCD(sec); - } if (adjust) { yr += CMOS_READ(RTC_YEAR); @@ -278,15 +270,6 @@ acpi_system_write_alarm(struct file *fil spin_unlock_irq(&rtc_lock); - if (!(rtc_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { - BCD_TO_BIN(yr); - BCD_TO_BIN(mo); - BCD_TO_BIN(day); - BCD_TO_BIN(hr); - BCD_TO_BIN(min); - BCD_TO_BIN(sec); - } - if (sec > 59) { min++; sec -= 60; _