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

Geert Uytterhoeven
2009-03-03T10:41:53Z

On Mon, 2 Mar 2009, Alessandro Zummo wrote:
> On Mon, 2 Mar 2009 11:28:01 +0100 (CET)
> Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> wrote:
> > So I can solve my problem (autoloading the RTC driver on PS3 by udev) by
> > converting the old genrtc driver into a platform device driver and creating
> > platform devices where appropriate.
>
> yes. btw, if you are building a kernel specific for the PS3, I would
> compile the rtc driver statically, otherwise it won't be available
> early on boot.
>
> > However, this doesn't solve the distro's problem: as the old RTC framework
> > depends on RTC_LIB=n, you cannot have both old and new RTC drivers in your
> > (single) distro kernel. That's why dmwm2 created drivers/rtc/rtc-ppc.c: Fedora
> > had to support machines with both old and new RTC drivers. As all of the old
> > drivers are actually behind the ppc_md.[sg]et_rtc_time() abstraction, this was
> > very easy.
>
> ok, generic kernel. you will have to load the modules on initrd. no, sadly you
> can't have both of them. you might stick with the old interface or
> convert them all.
>
> > Hence it's all or nothing, and we have to convert all of them.
> >
> > drivers/rtc/rtc-generic.c would allow to have a working system without old
> > RTC drivers, until all low-level code has been converted to individual RTC
> > drivers.
>
> I know but I have enough experience to foresee that once a generic over generic
> framework is in place it's very hard to get rid of it because people
> will have no incentives.

I know.

> If you really need rtc-generic you can keep using it even if it's
> not in the kernel, distributions often have their specific
> set of kernel patches.

rtc-generic is already in the kernel, it's just called rtc-parisc ;-)

> But I'd strongly suggest to plan and execute a conversion process.

So would you accept a patch series that:
1. Adds the missing module aliases to rtc-parisc (which is a bugfix),
2. Moves the platform device creation out of rtc-ppc and into arch-specific
code (which is also a bugfix),
3. Consolidates rtc-parisc and rtc-ppc into rtc-generic (which is a cleanup),
4. Makes rtc-generic dependent on PARISC, PPC, and M68K (the existing
[sg]et_rtc_time() users):
a. without introducing ARCH_HAS_GENERIC_RTC,
b. with a big fat warning in the Kconfig comment not relaxing the
dependencies, as it's supposed to go away.
4. Converts the PS3 RTC support into a separate driver, called rtc-ps3
(as a bonus ;-)

? If yes, I'll cook it up.

Other RTC platform support can be converted into separate drivers later.

Thanks!

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