2006-01-09 15:44:18

by Pavel Machek

[permalink] [raw]
Subject: Re: /proc/acpi/alarm -- does it work or not?

Hi!

> >I wanted to write some documentation about /proc/acpi/alarm, but
> >failed to make it work. I was putting machine to suspend-to-ram and
> >enabled everything in /proc/acpi/wakeup, still it would not do
> >anything. I even went to bios (thinkpad x32), set "RTC alarm" to
> >enabled and set time there. Nothing interesting
> >happened. /proc/acpi/alarm could not see most of my changes done in
> >BIOS, it only cleared century or something like that.
> >
> >I checked that RTC readout in BIOS shows same thing as system timer.
> >
> >Here are my attempts: [Commands were typed one-after-another where it
> >makes sense, and I left machine suspended for long enough -- timer
> >should have expired]
> It appears we need enable rtc driver to make alarm work.

I enabled CONFIG_RTC:

pavel@amd:/data/l/linux$ grep CONFIG_RTC .config
CONFIG_RTC=y
# CONFIG_RTC_X1205_I2C is not set
pavel@amd:/data/l/linux$

...but /proc/acpi/alarm still behaves very strangely:

2006-01-00 12:42:00
root@amd:/proc/acpi# echo '2006-01-01 12:34:56' > alarm
root@amd:/proc/acpi# cat alarm
2006-01-01 12:34:56
root@amd:/proc/acpi# echo '2006-09-01 12:34:56' > alarm
root@amd:/proc/acpi# cat alarm
2006-01-01 12:34:56
root@amd:/proc/acpi# echo '2006-01-09 12:34:56' > alarm
root@amd:/proc/acpi# cat alarm
2006-01-09 12:34:56
root@amd:/proc/acpi# echo '2006-02-09 12:34:56' > alarm
root@amd:/proc/acpi# cat alarm
2006-01-09 12:34:56
root@amd:/proc/acpi#

...why does it hate february and september?

Pavel

--
Thanks, Sharp!


2006-01-10 03:21:36

by Shaohua Li

[permalink] [raw]
Subject: Re: /proc/acpi/alarm -- does it work or not?

On Mon, 2006-01-09 at 16:44 +0100, Pavel Machek wrote:
> Hi!
>
> > >I wanted to write some documentation about /proc/acpi/alarm, but
> > >failed to make it work. I was putting machine to suspend-to-ram and
> > >enabled everything in /proc/acpi/wakeup, still it would not do
> > >anything. I even went to bios (thinkpad x32), set "RTC alarm" to
> > >enabled and set time there. Nothing interesting
> > >happened. /proc/acpi/alarm could not see most of my changes done in
> > >BIOS, it only cleared century or something like that.
> > >
> > >I checked that RTC readout in BIOS shows same thing as system timer.
> > >
> > >Here are my attempts: [Commands were typed one-after-another where it
> > >makes sense, and I left machine suspended for long enough -- timer
> > >should have expired]
> > It appears we need enable rtc driver to make alarm work.
>
> I enabled CONFIG_RTC:
>
> pavel@amd:/data/l/linux$ grep CONFIG_RTC .config
> CONFIG_RTC=y
> # CONFIG_RTC_X1205_I2C is not set
It appears CONFIG_RTC isn't related with the issue. In my test system,
if I didn't CONFIG_RTC, `date` shows wrong time, that's why I need RTC.

> pavel@amd:/data/l/linux$
>
> ...but /proc/acpi/alarm still behaves very strangely:
>
> 2006-01-00 12:42:00
> root@amd:/proc/acpi# echo '2006-01-01 12:34:56' > alarm
> root@amd:/proc/acpi# cat alarm
> 2006-01-01 12:34:56
> root@amd:/proc/acpi# echo '2006-09-01 12:34:56' > alarm
> root@amd:/proc/acpi# cat alarm
> 2006-01-01 12:34:56
> root@amd:/proc/acpi# echo '2006-01-09 12:34:56' > alarm
> root@amd:/proc/acpi# cat alarm
> 2006-01-09 12:34:56
> root@amd:/proc/acpi# echo '2006-02-09 12:34:56' > alarm
> root@amd:/proc/acpi# cat alarm
> 2006-01-09 12:34:56
> root@amd:/proc/acpi#
>
> ...why does it hate february and september?
No. Setting day, month, century for alarm is optional. This means your
system doesn't support setting month and century. But maybe we should
print some infos here ...

Thanks,
Shaohua

2006-01-18 14:16:39

by Pavel Machek

[permalink] [raw]
Subject: Re: /proc/acpi/alarm -- does it work or not?

Hi!

> > pavel@amd:/data/l/linux$
> >
> > ...but /proc/acpi/alarm still behaves very strangely:
> >
> > 2006-01-00 12:42:00
> > root@amd:/proc/acpi# echo '2006-01-01 12:34:56' > alarm
> > root@amd:/proc/acpi# cat alarm
> > 2006-01-01 12:34:56
> > root@amd:/proc/acpi# echo '2006-09-01 12:34:56' > alarm
> > root@amd:/proc/acpi# cat alarm
> > 2006-01-01 12:34:56
> > root@amd:/proc/acpi# echo '2006-01-09 12:34:56' > alarm
> > root@amd:/proc/acpi# cat alarm
> > 2006-01-09 12:34:56
> > root@amd:/proc/acpi# echo '2006-02-09 12:34:56' > alarm
> > root@amd:/proc/acpi# cat alarm
> > 2006-01-09 12:34:56
> > root@amd:/proc/acpi#
> >
> > ...why does it hate february and september?
> No. Setting day, month, century for alarm is optional. This means your
> system doesn't support setting month and century. But maybe we should
> print some infos here ...

Yes, more info would be nice. What is "correct" way to test
if systen supports day/month/year/century in alarm?
Pavel
--
Thanks, Sharp!