All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo@kvack.org>
To: David Brownell <david-b@pacbell.net>
Cc: rtc-linux@googlegroups.com, linux-acpi@vger.kernel.org,
	linux-pm@lists.linux-foundation.org, devel@laptop.org
Subject: Re: rtc-cmos not supporting RTC_AIE?
Date: Sun, 8 Jul 2007 15:03:50 -0400	[thread overview]
Message-ID: <20070708190350.GB20078@dmt> (raw)
In-Reply-To: <200707072226.50069.david-b@pacbell.net>

On Sat, Jul 07, 2007 at 10:26:49PM -0700, David Brownell wrote:
> On Saturday 07 July 2007, Marcelo Tosatti wrote:
> 
> > 
> > David,
> > 
> > Is there any reason why programs using RTC_AIE/RTC_ALM_SET ioctls are    
> > unable to arm alarm irq's?                                              
> 
> The ALM_SET request never did!  And I'm pretty sure AIE_ON does
> indeed set it ... the test cases use ALM_SET then AIE_ON, which
> is the "traditional" idiom (i.e. legacy drivers/char/rtc.c idiom).

My point is that RTC_ALM_SET after RTC_AIE_ON works with drivers/char/rtc.c
but not rtc-cmos:

        ret = ioctl(fd, RTC_AIE_ON);
        if (ret) {
                perror("ioctl RTC_AIE_ON");
                exit(0);
        }

        ret = ioctl(fd, RTC_ALM_SET, &rtctime);
        if (ret) {
                perror("ioctl RTC_ALM_SET");
                exit(0);
        }

I think its fine to consider such applications broken anyway?

> > I'm aware of the new RTC_WKALM_SET... but shouldnt backward
> > compatibility be kept?
> 
> According to <linux/rtc.h> the ALM_SET ioctl takes an rtc_time,
> while WKALM_SET takes an rtc_wkalm ... which differs from the
> former by including the flag controlling wheter the alarm will
> be enabled (or not) when setting the alarm.  (Model inherited
> from EFI.)

Right.

>  
> > The code seems to imply that its not supported anymore, however ioctl
> > returns success but no alarm is fired (for instance alarm.enabled is set
> > to 0):
> > 
> >         case RTC_ALM_SET:
> >                 if (copy_from_user(&alarm.time, uarg, sizeof(tm)))
> >                         return -EFAULT;
> > 
> >                 alarm.enabled = 0;
> >                 alarm.pending = 0;
> >                 alarm.time.tm_wday = -1;
> >                 alarm.time.tm_yday = -1;
> >                 alarm.time.tm_isdst = -1;
> 
> That code is generic RTC framework code (rtc-dev.c), and not
> code specific to rtc-cmos ... the comment immediately following
> that (2.6.22-rc7 and previous) should clarify many of the issues.
> 
> I think the current manpage does the same.  (If it mentions the
> /dev/rtc0, /dev/rtc1, etc files, it should be current enough.)
> 
> What it does is just stuff the rtc_time into the expanded
> rtc_wkalm.  The idea is that the RTC drivers only support one
> alarm-setting method, but the /dev/rtcN ioctl interface uses
> it in two modes:
> 
>  - "legacy", up to 24 hours in the future, and requiring
>    the alarm to be enabled later with AIE_ON;
> 
>  - "EFI-style", into the arbitrary future, and bundling the
>    flag saying whether to enable the alarm.
> 
> Since ALM_SET is the legacy mode, it requires separate AIE_ON
> (from the RTC driver directly).  But RTC_WKALM_SET doesn't.
> 
> - Dave
> 

  reply	other threads:[~2007-07-08 19:03 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-02  0:28             ` David Brownell
2007-04-02 16:55               ` Jordan Crouse
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  5:26                   ` David Brownell
2007-07-08 19:03                     ` Marcelo Tosatti [this message]
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                                     ` [linux-pm] " Nigel Cunningham
2007-07-10 16:51                                       ` David Brownell
2007-07-10 22:16                                         ` Nigel Cunningham
2007-07-10 22:16                                         ` [linux-pm] " Nigel Cunningham
2007-07-11  0:45                                           ` Matthew Garrett
2007-07-11  0:53                                             ` Nigel Cunningham
2007-07-11  0:53                                             ` [linux-pm] " Nigel Cunningham
2007-07-11  1:23                                               ` Matthew Garrett
2007-07-11  1:39                                                 ` Nigel Cunningham
2007-07-11  1:39                                                 ` [linux-pm] " 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                                                           ` Rafael J. Wysocki
2007-07-11 10:14                                                         ` Nigel Cunningham
2007-07-11  3:14                                                     ` Nigel Cunningham
2007-07-11  1:23                                               ` Matthew Garrett
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 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:17                       ` rtc-cmos not supporting RTC_AIE? David Brownell
2007-07-08 19:03                     ` Marcelo Tosatti
2007-07-08  5:26                   ` David Brownell
2007-07-08  3:46                 ` 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  5:13                   ` David Brownell
2007-07-08  5:13                   ` David Brownell
2007-07-08 18:40                     ` Marcelo Tosatti
2007-07-08 18:40                     ` Marcelo Tosatti
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 19:10                       ` David Brownell
2007-07-08  3:55                 ` Marcelo Tosatti
2007-06-19 17:00               ` Power Mangement Interfaces 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-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-19 17:00               ` Power Mangement Interfaces Marcelo Tosatti
2007-04-02  0:28             ` David Brownell
2007-04-01 16:56           ` Jordan Crouse
2007-04-02 10:23           ` Zhang Rui
2007-04-02 18:24             ` David Brownell
2007-04-02 19:40               ` Matthew Garrett
2007-04-02 19:40               ` Matthew Garrett
2007-04-02 21:31                 ` David Brownell
2007-04-02 21:31                 ` David Brownell
2007-04-05  8:20               ` Zhang Rui
2007-04-05  8:20               ` Zhang Rui
2007-04-02 18:24             ` David Brownell
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=20070708190350.GB20078@dmt \
    --to=marcelo@kvack.org \
    --cc=david-b@pacbell.net \
    --cc=devel@laptop.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --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.