From patchwork Wed Dec 23 04:14:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 69456 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBN4EGUe021923 for ; Wed, 23 Dec 2009 04:14:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752999AbZLWEOP (ORCPT ); Tue, 22 Dec 2009 23:14:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753088AbZLWEOP (ORCPT ); Tue, 22 Dec 2009 23:14:15 -0500 Received: from e37.co.us.ibm.com ([32.97.110.158]:54057 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752948AbZLWEOO (ORCPT ); Tue, 22 Dec 2009 23:14:14 -0500 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e37.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id nBN4Cs8R030018; Tue, 22 Dec 2009 21:12:54 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nBN4E9VS160858; Tue, 22 Dec 2009 21:14:09 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBN4E8Rc001870; Tue, 22 Dec 2009 21:14:09 -0700 Received: from [9.65.31.230] (sig-9-65-31-230.mts.ibm.com [9.65.31.230]) by d03av02.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nBN4E55S001818; Tue, 22 Dec 2009 21:14:06 -0700 Subject: [RFC][PATCH 12/14] Convert parisc to read/update_persistent_clock From: john stultz To: lkml Cc: Kyle McMartin , Helge Deller , "James E.J. Bottomley" , linux-parisc@vger.kernel.org In-Reply-To: <1261541567.3508.73.camel@localhost.localdomain> References: <1261540762.3508.61.camel@localhost.localdomain> <1261540826.3508.62.camel@localhost.localdomain> <1261540902.3508.63.camel@localhost.localdomain> <1261540988.3508.64.camel@localhost.localdomain> <1261541054.3508.65.camel@localhost.localdomain> <1261541130.3508.66.camel@localhost.localdomain> <1261541188.3508.67.camel@localhost.localdomain> <1261541286.3508.69.camel@localhost.localdomain> <1261541342.3508.70.camel@localhost.localdomain> <1261541415.3508.71.camel@localhost.localdomain> <1261541491.3508.72.camel@localhost.localdomain> <1261541567.3508.73.camel@localhost.localdomain> Date: Tue, 22 Dec 2009 20:14:03 -0800 Message-ID: <1261541643.3508.74.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Index: gettimeoffset/arch/parisc/kernel/time.c =================================================================== --- gettimeoffset.orig/arch/parisc/kernel/time.c 2009-12-22 18:50:55.000000000 -0800 +++ gettimeoffset/arch/parisc/kernel/time.c 2009-12-22 18:51:06.000000000 -0800 @@ -250,9 +250,21 @@ static int __init rtc_init(void) } module_init(rtc_init); -void __init time_init(void) +void read_persistent_clock(struct timespec *ts) { static struct pdc_tod tod_data; + if (pdc_tod_read(&tod_data) == 0) { + ts->tv_sec = tod_data.tod_sec; + ts->tv_nsec = tod_data.tod_usec * 1000; + } else { + printk(KERN_ERR "Error reading tod clock\n"); + ts->tv_sec = 0; + ts->tv_nsec = 0; + } +} + +void __init time_init(void) +{ unsigned long current_cr16_khz; clocktick = (100 * PAGE0->mem_10msec) / HZ; @@ -264,19 +276,4 @@ void __init time_init(void) clocksource_cr16.mult = clocksource_khz2mult(current_cr16_khz, clocksource_cr16.shift); clocksource_register(&clocksource_cr16); - - if (pdc_tod_read(&tod_data) == 0) { - unsigned long flags; - - write_seqlock_irqsave(&xtime_lock, flags); - xtime.tv_sec = tod_data.tod_sec; - xtime.tv_nsec = tod_data.tod_usec * 1000; - set_normalized_timespec(&wall_to_monotonic, - -xtime.tv_sec, -xtime.tv_nsec); - write_sequnlock_irqrestore(&xtime_lock, flags); - } else { - printk(KERN_ERR "Error reading tod clock\n"); - xtime.tv_sec = 0; - xtime.tv_nsec = 0; - } }