From patchwork Tue Mar 15 14:51:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Pisati X-Patchwork-Id: 86993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 8C7FCB6EFE for ; Wed, 16 Mar 2011 01:51:22 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1PzVaW-0000Ha-Uy; Tue, 15 Mar 2011 14:51:08 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1PzVaU-0000HU-G4 for kernel-team@lists.ubuntu.com; Tue, 15 Mar 2011 14:51:06 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1PzVaU-0006Jh-El for ; Tue, 15 Mar 2011 14:51:06 +0000 Received: from dynamic-adsl-94-36-131-169.clienti.tiscali.it ([94.36.131.169] helo=[192.168.0.32]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PzVaU-0000wB-BS for kernel-team@lists.ubuntu.com; Tue, 15 Mar 2011 14:51:06 +0000 Message-ID: <4D7F7CD8.10609@canonical.com> Date: Tue, 15 Mar 2011 15:51:04 +0100 From: Paolo Pisati User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: kernel-team@lists.ubuntu.com Subject: [lucid/mvl-dove, maverick/mvl-dove] SRU: Setting rtc wakealarm through sysfs interface fails X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com SRU Justification: Impact: alarm date are always improperly set to 2091. Fix: see attached patch. Testcase: sudo sh -c "echo `date '+%s' -d '+ 5 minutes'` > /sys/class/rtc/rtc0/wakealarm" && cat /proc/driver/rtc you will notice that alrm_date is 2091. BugLink: https://bugs.launchpad.net/ubuntu/+bug/503546 This affects lucid/mvl-dove and maverick/mvl-dove. Acked-by: Eric Miao Acked-by: Eric Miao From 39771eca99a21077d163fe150c086d99391d119d Mon Sep 17 00:00:00 2001 From: Paolo Pisati Date: Mon, 14 Mar 2011 17:50:13 +0100 Subject: [PATCH] rtc dove: fix reading back alarm's date. When reading back next alarm year, correctly mask out the RTC_ALARM_VALID constant: this prevents all alarms to _apparently_ be pending in 2091. BugLink: https://bugs.launchpad.net/ubuntu/+bug/503546 Signed-off-by: Paolo Pisati --- drivers/rtc/rtc-mv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c index daf7c5e..8446717 100755 --- a/drivers/rtc/rtc-mv.c +++ b/drivers/rtc/rtc-mv.c @@ -112,7 +112,7 @@ static int mv_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) day = rtc_date & 0x3f; month = (rtc_date >> RTC_MONTH_OFFS) & 0x3f; - year = (rtc_date >> RTC_YEAR_OFFS) & 0xff; + year = (rtc_date >> RTC_YEAR_OFFS) & 0x7f; alm->time.tm_sec = bcd2bin(second); alm->time.tm_min = bcd2bin(minute); -- 1.7.1