From: Feng Tang <feng.tang@intel.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "x86@kernel.org" <x86@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC][PATCH]x86/RTC: introduce a new generic rtc_ops for x86
Date: Wed, 12 Aug 2009 13:41:09 +0800 [thread overview]
Message-ID: <20090812134109.0913f9a9@feng-desktop> (raw)
In-Reply-To: <20090811084529.GB25647@elte.hu>
On Tue, 11 Aug 2009 16:45:29 +0800
Ingo Molnar <mingo@elte.hu> wrote:
> > -#include <asm/mc146818rtc.h>
> > -#ifdef CONFIG_X86_32
> > -#include <linux/efi.h>
> > +struct arch_rtc_dev_ops {
> > + unsigned long (*get_wall_time)(void);
> > + int (*set_wall_time)(unsigned long);
> > +};
> > +extern struct arch_rtc_dev_ops *x86_rtc_ops;
>
> looks like the right direction at first glance. What's the
> management interface around the driver (there's none at the moment)?
> Set up at early boot time and never changed afterwards?
Currently there is no management interface around it, the structure works
the way like x86_quirks, as EFI/mc146818 are kindly fixed and can't be
dynamically detected.
>
> Have you looked at other architectures (MIPS, ARM, etc.) to see how
> they abstracted away their RTC functionality?
I did a quick look at other architectures, and didn't see a nice abstracted
way for RTC.
In kernel early boot phase, read_persistent_clock() is called to get the HW
time, x86 implements the API by calling get_wall_time(), but just a few other
architectures implement their own read_persistent_clock() if they have rtc
devices/services that could be accessed in early boot phase, like some of
MIPS/PowerPC/s390...(ARM doesn't). So it would be difficult to ask all
architectures to use the arch_rtc_dev_ops structure.
But as kernel needs the HW time anyway, some arch/platforms implements
their rtc driver in drivers/rtc/ not in arch/.../kernel/, which will get HW
time and set it to the system time in late boot phase using late_initcall
Thanks,
Feng
>
> Ingo
prev parent reply other threads:[~2009-08-12 5:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-11 7:48 Feng Tang
2009-08-11 8:45 ` Ingo Molnar
2009-08-12 5:41 ` Feng Tang [this message]
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=20090812134109.0913f9a9@feng-desktop \
--to=feng.tang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®