Bug 449115 - rtcwake does not support wake from S5/off
Summary: rtcwake does not support wake from S5/off
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux-ng
Version: 9
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-30 14:47 UTC by Piergiorgio Sartor
Modified: 2010-02-19 15:51 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-12-02 13:25:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patchset and original files for S5 (off) wakeup (8.28 KB, application/x-bzip2)
2009-07-09 18:03 UTC, Piergiorgio Sartor
no flags Details

Description Piergiorgio Sartor 2008-05-30 14:47:56 UTC
Description of problem:
This is more an RFE than a bug report.
I've some machines which can wake up from off (or S5, I guess), as also
mentioned it is possible (but not standard, it seems) in "man 4 rtc".
On F8, the rtc wakeup was set using the /proc/acpi/alarm interface and then the
machine was switched off with "poweroff".
With F9, /proc/acpi/alarm was replaced by the /dev/rtcX interface and, AFAIK, by
"rtcwake" for wakeup concerning issues.
While this is a more consistent solution, something seems to be missing.

"rtcwake" does not seem to support a "power off after wakeup timer set" option,
i.e. "rtcwake -t xyz -m off".
This would be not a real problem if the "on" option (or other) would simply
return after setting the wakeup timer, like the old /proc/acpi/alarm did.

I had a quick look at the code and it seems, when "-m on" is passed, "rtcwake"
simply waits for the /dev/rtcX to generate/acknowledge the irq.

Would it be possible either to add an "off" option (and then call "poweroff" or
"shutdown" or whatever could be meaningful) or to return from the "on" case,
leaving the timer set? Or to add a simple "set" option, just to set the wakeup?

It seems, to the extent I could test, that "rtcwake -t xyz -m on & poweroff"
does not work either, I guess "rtcwake" resets the timer on exit (I think the
last ioctl() does this).

Thanks a lot in advance.

Version-Release number of selected component (if applicable):
2.13.1-6

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Karel Zak 2008-12-02 13:25:01 UTC
The request has been added to the upstream TODO list.

Comment 2 Piergiorgio Sartor 2009-07-08 12:39:03 UTC
Sorry to bother you again, but some time is gone and it is not clear the status of this TODO.

Is it going to be implemented?

BTW, where is the TODO list, I could not find it.

Thanks,

piergiorgio

Comment 3 Karel Zak 2009-07-08 13:42:37 UTC
(In reply to comment #2)
> Sorry to bother you again

 no problem

> but some time is gone and it is not clear the status
> of this TODO.
>
> Is it going to be implemented?

 not yet :-(
 
> BTW, where is the TODO list, I could not find it.

 http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=blob_plain;f=TODO;hb=HEAD

Comment 4 Piergiorgio Sartor 2009-07-09 18:03:13 UTC
Created attachment 351110 [details]
patchset and original files for S5 (off) wakeup

Hi again,

I put together a small patch, against 2.16-rc2, which is supposed to add the option to shutdown after the wakeup event is set.

I attached a tar.bz2 (I hope it is correct) containing the patches for rtcwake.c and rtcwake.8, the original files and the modified ones (just in case...).

Note that I did not even compile it, so, please have a look, maybe it is enough, maybe not.

One issue I still have, in case executing "/sbin/shutdown" fails, I run a couple of things which might not be needed, so there a check is welcome.

Thanks,

piergiorgio

Comment 5 Piergiorgio Sartor 2009-07-28 14:39:09 UTC
Hi,

did you, by chance, have time to look into the patch I provided?

Any comment/feedback? ETA?

Thanks,

pg

Comment 6 Karel Zak 2009-07-30 21:58:49 UTC
Hi Piergiorgio, thanks for the patch.

I'll prepare a proper patch and send it to the upstream mailing list for review + CC: to you.

Comment 7 Karel Zak 2010-02-19 15:51:42 UTC
Note that the patch was applied to upstream tree (commit 77f5744c982cd57b1bf1181f8f37023512236902) a few months ago.


Note You need to log in before you can comment on or make changes to this bug.