From: Andrew Morton <akpm@osdl.org>
To: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Tony Lindgren <tony@atomide.com>
Subject: Re: [patch 2.6.19-rc6 6/6] rtc-omap driver
Date: Tue, 21 Nov 2006 17:19:06 -0800 [thread overview]
Message-ID: <20061121171906.5eec32d6.akpm@osdl.org> (raw)
In-Reply-To: <200611201028.48701.david-b@pacbell.net>
On Mon, 20 Nov 2006 10:28:48 -0800
David Brownell <david-b@pacbell.net> wrote:
> This creates a new RTC-framework driver for the RTC/calendar module found
> in various OMAP1 chips. (OMAP2 and OMAP3 use external RTCs, like those in
> TI's multifunction PM companion chips.) It's been in the Linux-OMAP tree
> for several months now, and other trees before that, so it's quite stable.
> The most notable issue is that the OMAP IRQ code doesn't yet support the
> RTC IRQ as a wakeup event. Once that's fixed, a patch will be needed.
>
> ...
>
> +static int omap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
> +{
> + u8 reg;
> +
> + /* Much userspace code uses RTC_ALM_SET, thus "don't care" for
> + * day/month/year specifies alarms up to 24 hours in the future.
> + * So we need to handle that ... but let's ignore the "don't care"
> + * values for hours/minutes/seconds.
> + */
> + if (alm->time.tm_mday <= 0
> + && alm->time.tm_mon < 0
> + && alm->time.tm_year < 0) {
> + struct rtc_time tm;
> + unsigned long now, then;
> +
> + omap_rtc_read_time(dev, &tm);
> + rtc_tm_to_time(&tm, &now);
> +
> + alm->time.tm_mday = tm.tm_mday;
> + alm->time.tm_mon = tm.tm_mon;
> + alm->time.tm_year = tm.tm_year;
> + rtc_tm_to_time(&alm->time, &then);
> +
> + /* sometimes the alarm wraps into tomorrow */
> + if (then < now) {
This isn't wraparound-safe. If you have then=0xffffffff and now=0x00000001.
Perhaps that can't happen.
> +MODULE_AUTHOR("George G. Davis (and others)");
Maybe some additional signoffs would be appropirate?
next prev parent reply other threads:[~2006-11-22 1:19 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-20 18:14 [patch 2.6.19-rc6 0/6] more rtc framework/driver updates David Brownell
2006-11-20 18:17 ` [patch 2.6.19-rc6 1/6] rtc class /proc/driver/rtc update David Brownell
2006-11-20 23:13 ` Alessandro Zummo
2006-11-21 2:47 ` [Bulk] " David Brownell
2006-11-22 20:37 ` Alessandro Zummo
2006-11-23 0:39 ` David Brownell
2006-11-20 18:19 ` [patch 2.6.19-rc6 2/6] rtc-sa1100 tweaks David Brownell
2006-11-20 22:48 ` Russell King
2006-11-21 1:46 ` David Brownell
2006-11-20 18:22 ` [patch 2.6.19-rc6 3/6] X86_PC optionally creates rtc_cmos platform device David Brownell
2006-11-20 18:27 ` [patch 2.6.19-rc6 5/6] rtc-cmos driver David Brownell
2006-11-20 18:27 ` [patch 2.6.19-rc6 4/6] ACPI exports RTC extensions through platform_data David Brownell
2006-11-20 18:28 ` [patch 2.6.19-rc6 6/6] rtc-omap driver David Brownell
2006-11-20 23:09 ` Alessandro Zummo
2006-11-22 1:19 ` Andrew Morton [this message]
2006-11-22 2:15 ` David Brownell
2006-11-22 2:28 ` Andrew Morton
2006-11-23 0:09 ` David Brownell
2006-11-22 20:34 ` Alessandro Zummo
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=20061121171906.5eec32d6.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=alessandro.zummo@towertech.it \
--cc=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=tony@atomide.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome