All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: linux-pm@lists.osdl.org
Cc: "linux-acpi@vger" <linux-acpi@vger.kernel.org>, linux-pm@osdl.org
Subject: Re: [PATCH 3/6] [-mm]: ACPI: duplicate ACPI sleep "alarm" attribute in	sysfs
Date: Sat, 6 Jan 2007 14:42:22 -0800	[thread overview]
Message-ID: <200701061442.22340.david-b@pacbell.net> (raw)
In-Reply-To: <1168083318.5619.37.camel@localhost.localdomain>

On Saturday 06 January 2007 3:35 am, Zhang Rui wrote:
> 
> Create /sys/power/alarm.

Urg.  This doesn't work with the RTC framework, which accepts the reality
that some systems have multiple RTCs ... /sys/class/rtc/rtcN/alarm is a
much more appropriate location for that RTC's alarm.

(How to handle RTCs with multiple alarms is a different issue; I'm just
assuming for now that one of them wil be designated primary.)


> The way it works is exactly the same as /proc/acpi/alarm.
> I.e. "#echo yyyy-mm-dd hh-mm-ss >/sys/power/alarm" supports existing absolute time.
> And "#echo +yyyy-mm-dd hh-mm-ss >/sys/power/alarm" supports a duration.

There was a proposal a while back to have /sys/class/rtc/rtcN/alarm
files -- for alarm-capable RTCs, they don't all have alarms -- have
only the absolute seconds.  "date" can do the math for you; e.g.

	# cd /sys/class/rtc/rtcN
	# date -d '5pm tuesday' "+%s" > alarm
	# date -d '5 hours 24 minutes 11 seconds' "+%s" > alarm
	# date -d '4pm 8 january 2007'  "+%s" > alarm

It's usually felt to be a Good Thing if the kernel doesn't have to be
in the business of parsing and validating complex input ...

(And "cat" of the alarm attribute would return either seconds since
the POSIX epoch, if the alarm's active, else the null string.)

- Dave

  reply	other threads:[~2007-01-06 22:42 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-06 11:35 [PATCH 3/6] [-mm]: ACPI: duplicate ACPI sleep "alarm" attribute in sysfs Zhang Rui
2007-01-06 22:42 ` David Brownell [this message]
2007-01-07  5:57   ` [linux-pm] " Matthew Garrett
2007-01-08  2:31     ` David Brownell
2007-01-08 10:10       ` Matthew Garrett
2007-01-08 20:39         ` David Brownell
2007-01-08 20:43           ` Matthew Garrett
2007-01-08 21:15             ` David Brownell
2007-01-08 10:13       ` Zhang Rui
2007-01-08 20:46         ` David Brownell
2007-01-07 11:19 ` Pavel Machek
2007-01-08  3:44   ` David Brownell
2007-01-08 11:36     ` Pavel Machek
2007-01-08 20:35       ` David Brownell
2007-01-25  4:21     ` Len Brown
2007-01-25  9:39       ` [linux-pm] " David Brownell
2007-01-25 19:47       ` Pavel Machek
2007-01-25 23:12         ` Len Brown
2007-01-25 23:28           ` Nigel Cunningham
2007-01-26  0:33           ` David Brownell
2007-01-26 17:07           ` Pavel Machek

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=200701061442.22340.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.osdl.org \
    --cc=linux-pm@osdl.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.