All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nigel Cunningham <nigel@nigel.suspend2.net>
To: linux-pm@lists.linux-foundation.org
Cc: David Brownell <david-b@pacbell.net>,
	Marcelo Tosatti <marcelo@kvack.org>,
	linux-acpi@vger.kernel.org, Richard Hughes <hughsient@gmail.com>,
	rtc-linux@googlegroups.com
Subject: Re: [linux-pm] Re: Hibernate after alarm wakes from STR
Date: Tue, 10 Jul 2007 12:45:30 +1000	[thread overview]
Message-ID: <200707101245.31449.nigel@nigel.suspend2.net> (raw)
In-Reply-To: <200707090926.32826.david-b@pacbell.net>

[-- Attachment #1: Type: text/plain, Size: 2645 bytes --]

Hi.

On Tuesday 10 July 2007 02:26:32 David Brownell wrote:
> On Monday 09 July 2007, Marcelo Tosatti wrote:
> > On Sun, Jul 08, 2007 at 07:44:03PM -0700, David Brownell wrote:
> 
> > > Better a /sys/power/wakeup_event (or whatever) that's more easily
> > > found.  It could link to the device issuing the event.
> > 
> > As you mentioned, there might be two wakeup sources (RTC and power
> > button for instance) or even more at the same time.
> 
> Actually I though I said that there would be races.  Though come
> to think of it, one way they'd show up on a typical embedded system
> would be to have multiple wake IRQs pending ... you couldn't tell
> which one came first.  (The typical case would be a single event,
> of course.)  ACPI-ish systems would do that with GPEs and the
> magic "rtc woke" flag.
> 
> And then there are shared IRQ lines serving as wake sources.  There
> could be three wake-enabled devices on that line (plus others that
> aren't wake-enabled); the drivers returning IRQ_HANDLED should likely
> be reported as having been wake sources, but not the ones returning
> IRQ_NONE ...
> 
> ... so yes, systems might need to present multiple wake events.
> 
> 
> > Do you think its fine to simply but the device separated by spaces in
> > the wakeup_event file?
> > 
> > Sounds fine by me, but what about the one-value-per-file sysfs rule?
> 
> Better to have that node be a directory of links then, rather than
> a single link.
> 
> Note that I'm just throwing ideas out there.  I suspect that
> in the general case it may not be easy to map from wake event
> to device, without infrastructure that's now missing.

FWIW, I've recently added code to Suspend2 to allow it to (optionally) set the 
RTC wake alarm when it's finished writing the image and check the lid switch 
when waking, entering a different sleep state if the lid switch is still 
closed. It achieves this by letting the user set the name of an rtc alarm to 
use (the 'rtc0' in /sys/class/rtc/rtc0/*) and of a button to use (lid/LID 
in /proc/acpi/button/lid/LID/*). It then opens the button directory's state 
file and the rtc directory's since_epoch and wakealarm files, and uses them 
to determine read the time since epoch and set the wakealarm and determine 
whether the lid button is still closed.

I don't really like the opening /proc and /sysfs files in this way - whatever 
solution you come up with, could you consider exposing some way for kernel 
code to do this more neatly?

Regards,

Nigel
-- 
See http://www.tuxonice.net for Howtos, FAQs, mailing
lists, wiki and bugzilla info.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-07-10  2:45 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-30 23:57 Power Mangement Interfaces Jordan Crouse
2007-03-31  0:18 ` Johannes Berg
2007-03-31  0:21   ` Johannes Berg
2007-03-31  4:33     ` [linux-pm] " Gopi P.M.
2007-03-31 15:20     ` Jordan Crouse
2007-03-31 16:12     ` David Brownell
2007-03-31 15:16   ` Jordan Crouse
2007-04-02  7:38     ` [linux-pm] " Pavel Machek
2007-03-31 16:57   ` David Brownell
2007-04-04 16:15     ` Johannes Berg
2007-04-04 18:44       ` David Brownell
2007-04-04 21:49         ` Johannes Berg
2007-04-05  5:05           ` David Brownell
2007-04-05  8:02             ` Johannes Berg
2007-04-05  8:32         ` Zhang Rui
2007-03-31 16:52 ` David Brownell
2007-03-31 18:16   ` Jordan Crouse
2007-03-31 18:57     ` David Brownell
2007-04-01  1:01       ` Jordan Crouse
2007-04-01  3:01         ` David Brownell
2007-04-01  3:01         ` David Brownell
2007-04-01 16:56           ` Jordan Crouse
2007-04-01 16:56           ` Jordan Crouse
2007-04-02  0:28             ` David Brownell
2007-04-02  0:28             ` David Brownell
2007-04-02 16:55               ` Jordan Crouse
2007-04-02 17:53                 ` David Brownell
2007-04-02 17:53                 ` David Brownell
2007-07-08  3:46                 ` rtc-cmos not supporting RTC_AIE? Marcelo Tosatti
2007-07-08  3:46                 ` Marcelo Tosatti
2007-07-08  5:26                   ` David Brownell
2007-07-08  5:26                   ` David Brownell
2007-07-08 19:03                     ` Marcelo Tosatti
2007-07-08 19:17                       ` David Brownell
2007-07-08 19:17                       ` David Brownell
2007-07-08 19:31                         ` Richard Hughes
2007-07-08 19:31                         ` Richard Hughes
2007-07-08 20:15                           ` Hibernate after alarm wakes from STR David Brownell
2007-07-08 22:31                             ` Marcelo Tosatti
2007-07-08 22:31                             ` Marcelo Tosatti
2007-07-09  2:44                               ` David Brownell
2007-07-09  2:44                               ` David Brownell
2007-07-09  8:34                                 ` Richard Hughes
2007-07-09  8:34                                 ` Richard Hughes
2007-07-09 15:40                                 ` Marcelo Tosatti
2007-07-09 16:26                                   ` David Brownell
2007-07-10  2:45                                     ` Nigel Cunningham [this message]
2007-07-10 16:51                                       ` [linux-pm] " David Brownell
2007-07-10 22:16                                         ` Nigel Cunningham
2007-07-11  0:45                                           ` Matthew Garrett
2007-07-11  0:53                                             ` Nigel Cunningham
2007-07-11  1:23                                               ` Matthew Garrett
2007-07-11  1:39                                                 ` Nigel Cunningham
2007-07-11  1:59                                                   ` Matthew Garrett
2007-07-11  1:59                                                   ` [linux-pm] " Matthew Garrett
2007-07-11  3:14                                                     ` Nigel Cunningham
2007-07-11 10:09                                                       ` Rafael J. Wysocki
2007-07-11 10:09                                                       ` [linux-pm] " Rafael J. Wysocki
2007-07-11 10:14                                                         ` Nigel Cunningham
2007-07-11 10:31                                                           ` Rafael J. Wysocki
2007-07-11 10:31                                                           ` [linux-pm] " Rafael J. Wysocki
2007-07-11 10:14                                                         ` Nigel Cunningham
2007-07-11  3:14                                                     ` Nigel Cunningham
2007-07-11  1:39                                                 ` Nigel Cunningham
2007-07-11  1:23                                               ` Matthew Garrett
2007-07-11  0:53                                             ` Nigel Cunningham
2007-07-11  0:45                                           ` Matthew Garrett
2007-07-11 16:04                                           ` David Brownell
2007-07-11 16:04                                           ` [linux-pm] " David Brownell
2007-07-11 22:48                                             ` Nigel Cunningham
2007-07-11 22:48                                             ` Nigel Cunningham
2007-07-10 22:16                                         ` Nigel Cunningham
2007-07-10 16:51                                       ` David Brownell
2007-07-10  2:45                                     ` Nigel Cunningham
2007-07-09 16:26                                   ` David Brownell
2007-07-09 15:40                                 ` Marcelo Tosatti
2007-07-08 20:15                           ` David Brownell
2007-07-08 19:03                     ` rtc-cmos not supporting RTC_AIE? Marcelo Tosatti
2007-07-08  3:49                 ` [PATCH] rtc-cmos: use cmos_rtc_board_info to determine wake_on callback Marcelo Tosatti
2007-07-08  3:49                 ` Marcelo Tosatti
2007-07-08  5:06                   ` David Brownell
2007-07-08  5:06                   ` David Brownell
2007-07-08  3:55                 ` [PATCH] OLPC rtc-cmos support Marcelo Tosatti
2007-07-08  3:55                 ` Marcelo Tosatti
2007-07-08  5:13                   ` David Brownell
2007-07-08  5:13                   ` David Brownell
2007-07-08 18:40                     ` Marcelo Tosatti
2007-07-08 19:10                       ` David Brownell
2007-07-08 19:10                       ` David Brownell
2007-07-08 20:17                         ` Marcelo Tosatti
2007-07-08 20:47                           ` David Brownell
2007-07-08 20:47                           ` David Brownell
2007-07-08 20:17                         ` Marcelo Tosatti
2007-07-08 18:40                     ` Marcelo Tosatti
2007-04-02 16:55               ` Power Mangement Interfaces Jordan Crouse
2007-06-19 17:00               ` Marcelo Tosatti
2007-06-19 17:00               ` Marcelo Tosatti
2007-06-19 19:17                 ` Jens Axboe
2007-06-19 19:17                 ` Jens Axboe
2007-06-19 19:41                 ` Woodruff, Richard
2007-06-21  1:30                 ` David Brownell
2007-07-08 22:10                   ` [PATCH] add powerbutton and lid platform devices Marcelo Tosatti
2007-07-08 22:10                   ` Marcelo Tosatti
2007-07-09 15:05                     ` Jordan Crouse
2007-07-09 15:05                     ` Jordan Crouse
2007-07-09 16:30                       ` David Brownell
2007-07-09 16:36                         ` Jordan Crouse
2007-07-09 16:36                         ` Jordan Crouse
2007-07-16  8:51                         ` Richard Hughes
2007-07-16  8:51                         ` Richard Hughes
2007-07-09 16:30                       ` David Brownell
2007-07-16 17:11                       ` C. Scott Ananian
2007-07-16 17:11                       ` C. Scott Ananian
2007-06-21  1:30                 ` Power Mangement Interfaces David Brownell
2007-04-02 10:23           ` Zhang Rui
2007-04-02 18:24             ` David Brownell
2007-04-02 18:24             ` David Brownell
2007-04-02 19:40               ` Matthew Garrett
2007-04-02 21:31                 ` David Brownell
2007-04-02 21:31                 ` David Brownell
2007-04-02 19:40               ` Matthew Garrett
2007-04-05  8:20               ` Zhang Rui
2007-04-05  8:20               ` Zhang Rui
2007-04-02 10:07       ` Zhang Rui
2007-03-31 19:14     ` Jim Gettys
2007-04-02  9:36 ` Zhang Rui

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=200707101245.31449.nigel@nigel.suspend2.net \
    --to=nigel@nigel.suspend2.net \
    --cc=david-b@pacbell.net \
    --cc=hughsient@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=marcelo@kvack.org \
    --cc=nigel@suspend2.net \
    --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 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.