public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tino Keitel <tino.keitel@gmx.de>
To: Mark Lord <lkml@rtr.ca>
Cc: Len Brown <lenb@kernel.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	David Brownell <david-b@pacbell.net>,
	lkml <linux-kernel@vger.kernel.org>,
	rtc-linux@googlegroups.com, linux-acpi@vger.kernel.org
Subject: Re: PATCH: /proc/acpi/alarm: handle day-of-month wraparound on readback
Date: Tue, 2 Dec 2008 11:29:25 +0100	[thread overview]
Message-ID: <20081202102925.GA3194@dose.home.local> (raw)
In-Reply-To: <4934188E.6080701@rtr.ca>

On Mon, Dec 01, 2008 at 12:02:06 -0500, Mark Lord wrote:
> Mark Lord wrote:
>> Fix month wrap issue with readback from /proc/acpi/alarm
>> This bug has been around *forever*.
>>
>> $ echo '2008-12-01 10:36:20' > /proc/acpi/alarm
>> $ cat /proc/acpi/alarm
>> 2008-11-01 10:36:20
>>
>> Note how the readback above shows the month incorrectly.
>> But with this patch applied, it shows the correct month (12).
> ..
>
> I should add, that the above test requires that the alarm
> be set for any day of the *next* month from the current month.
> My MythTV box does a readback test any time it programs a wakeup,
> and noticed the bug over this past weekend (2008-11-30).

Why not just use the new RTC drivers and /sys/class/rtc/rtc0/wakealarm?
MythTV already provides seconds since epoch for the wakeup time, so you
can use this value without converting it:

$ cat /usr/local/bin/myth-setwaketime
#!/bin/sh

SYSFS_WAKE_FILE="/sys/class/rtc/rtc0/wakealarm"

echo -n "Wakeup time is "
date -d @$1

if ! test -w "$SYSFS_WAKE_FILE" ; then
	exit 1
fi

echo 0 > "$SYSFS_WAKE_FILE"
echo "$1" > "$SYSFS_WAKE_FILE"

  reply	other threads:[~2008-12-02 10:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23  3:42 [patch 2.6.26-rc7] rtc_read_alarm() handles wraparound David Brownell
2008-06-25  8:59 ` [rtc-linux] " Alessandro Zummo
2008-12-01 16:57 ` PATCH: /proc/acpi/alarm: handle day-of-month wraparound on readback Mark Lord
2008-12-01 17:02   ` Mark Lord
2008-12-02 10:29     ` Tino Keitel [this message]
2008-12-02 18:54       ` Mark Lord
2008-12-01 18:18   ` Len Brown
2008-12-01 22:13     ` Mark Lord
2008-12-09 15:46       ` [PATCH] " Mark Lord
2008-12-10  5:35         ` Len Brown
2008-12-01 22:15     ` PATCH: " Mark Lord
2008-12-01 22:32       ` [rtc-linux] " Alessandro Zummo
2008-12-02 18:57         ` Mark Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081202102925.GA3194@dose.home.local \
    --to=tino.keitel@gmx.de \
    --cc=a.zummo@towertech.it \
    --cc=david-b@pacbell.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@rtr.ca \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox