Re: [rtc-linux] Re: [PATCH/RFC 0/5] Generic RTC class driver

Geert Uytterhoeven
2009-03-02T09:54:45Z

On Fri, 27 Feb 2009, Richard Zidlicky wrote:
> On Wed, Feb 25, 2009 at 11:18:36AM +0100, Alessandro Zummo wrote:
> > On Wed, 25 Feb 2009 11:00:13 +0100 (CET)
> > Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> wrote:
> >
> > > I didn't know NTP was broken with RTC class drivers?
> > >
> > > So we should actually keep on using genrtc instead of rtc-ppc/rtc-generic for
> > > now? ;-)
> >
> > broken here means that the kernel won't save the time to the hardware
> > rtc every 11 minutes as it used to do. normal NTP operations are unaffected.
>
> seems like so far ppc is the only architecture attempting to implement it
> correctly, all others either have it unimplemented or use the broken
> by design set_rtc_mmss method.
> Also note that in most cases hwclock has much better possibilities
> to do a good job.
>
> Regarding genrtc vs rtc-ppc/rtc-generic it is worth noting that genrtc
> provides RTC_UIE emulation which is of some use for exotic programs like
> "chrony".
> Afaics this is also the only situation without a good userspace workaround
> and chrony never worked well for me so I have nothing against junking the
> code.

What about CONFIG_RTC_INTF_DEV_UIE_EMUL for RTC class devices?

> Regarding a possible reorganisation from the generic to all separate drivers
> I agree that the habit of putting rtc-chip specific code in asm-generic is
> confusing at best.
> In many cases such code might be better placed in drivers/rtc or
> include/linux/rtc/chipname.
>
> Imho this does not preclude the possibility to use a generic framework. While
> there certainly are valid reasons to have separate drivers in some cases
> I do not see much value in rewriting everything as separate drivers where
> the generic framework works well.

Indeed. You can have a working RTC class driver for lots of hardware by just
writing ca. 100 lines of code on top of the generic framework.

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010