Re: [patch 2.6.20-rc3 1/3] rtc-cmos driver

From: Matthew Garrett
Date: Mon May 28 2007 - 14:35:35 EST


On Fri, Jan 05, 2007 at 10:01:57AM -0800, David Brownell wrote:
> This is an "RTC framework" driver for the "CMOS" RTCs which are standard
> on PCs and some other platforms. That's MC146818 compatible silicon.
> Advantages of this vs. drivers/char/rtc.c (use one _or_ the other, only
> one will be able to claim the RTC irq) include:

Sorry for getting to this so late - I've only just started playing with
this driver.

> +static int cmos_read_alarm(struct device *dev, struct rtc_wkalrm *t)

This is awkward. At the very least, year will be set to -1. This then
gets passed through to rtc_tm_to_time, which results in reading
wakealarm providing very odd feedback. I guess the "right" fix is for
rtc_tm_to_time to use the current values for anything that's -1?

> + rtc_control = CMOS_READ(RTC_CONTROL);
> + rtc_control &= ~(RTC_PIE | RTC_AIE | RTC_UIE);

Do you really want to clobber RTC_AIE on probe? If an alarm has been set
by the BIOS, it seems a little unfair to disable it on boot.

--
Matthew Garrett | mjg59@xxxxxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/