[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100518142719.50ff74fa@feng-i7>
Date: Tue, 18 May 2010 14:27:19 +0800
From: Feng Tang <feng.tang@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>
CC: Jacob Pan <jacob.jun.pan@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...e.hu>,
"Du, Alek" <alek.du@...el.com>,
Arjan van de Ven <arjan@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
John Stultz <johnstul@...ibm.com>
Subject: Re: [PATCH 7/8] x86/mrst: add vrtc driver which serves as a wall
clock device
Hi Thomas,
On Mon, 17 May 2010 17:15:55 +0800
Thomas Gleixner <tglx@...utronix.de> wrote:
> >
> > Actually when to init the vrtc register is a big problem for me,
> > vrtc need be inited before timekeeping_init(), and I thought better
> > to put it somewhere in setup_arch(), as it is architecture
> > specific, and ioremap is not working at that time. Also that's the
> > reason I created a new wallclock_init func for x86_platforms, I
> > could not find a better way to do the vrtc init.
>
> There is no particular reason why we need to read it in
> timekeeping_init(). Nothing in the kernel needs the correct wall time
> at that point. So we can safely move the setting of xtime to rtc wall
> clock time to a separate timekeeping_late_init() function.
>
> John ???
>
Yeah, good suggestion, if xtime init is moved to a later time in kernel
init flow, then vrtc's init function can be set a arch_initcall()
> > > > + lock_cmos_prefix(reg);
> > >
> > > This lock_cmos magic should just die. I have no idea why
> > > something wants or wanted to access the RTC from an NMI.
> >
> > I will try to reuse the rtc_lock defined in rtc.c whose get/set_time
> > service won't be called with vrtc's at the same time.
>
> Please don't create artifical dependencies. Use a separate vrtc_lock
> to serialize the access to vrtc.
I just checked the code, when wall clock's get/set_time service is called,
it is always protected by rtc_lock(code in arch/x86/kernel/rtc.c), then
no need to add the lock for each individual register read/write operation.
I will submit a v2 vrtc patch.
Thanks,
Feng
>
> Thanks,
>
> tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists