public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: John Stultz <johnstul@us.ibm.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Kyle McMartin <kyle@mcmartin.ca>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 04/14] parisc: Convert parisc to use read/update_persistent_clock
Date: Sat, 06 Mar 2010 23:40:30 +0100	[thread overview]
Message-ID: <4B92D9DE.7030705@gmx.de> (raw)
In-Reply-To: <1267675049-12337-5-git-send-email-johnstul@us.ibm.com>

On 03/04/2010 04:57 AM, John Stultz wrote:
> This patch converts the parisc architecture to use the generic read_persistent_clock and update_persistent_clock interfaces, reducing the amount of arch specific code we have to maintain, and allowing for further cleanups in the future.
>
> I have not built or tested this patch, so help from arch maintainers would be appreciated.

Works nicely.

Thanks, John.

Acked-by: Helge Deller <deller@gmx.de>

>
> Cc: Kyle McMartin<kyle@mcmartin.ca>
> Cc: Helge Deller<deller@gmx.de>
> Cc: Thomas Gleixner<tglx@linutronix.de>
> Cc: Andrew Morton<akpm@linux-foundation.org>
>
> Signed-off-by: John Stultz<johnstul@us.ibm.com>
> ---
>   arch/parisc/kernel/time.c |   29 +++++++++++++----------------
>   1 files changed, 13 insertions(+), 16 deletions(-)
>
> diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
> index a79c6f9..05511cc 100644
> --- a/arch/parisc/kernel/time.c
> +++ b/arch/parisc/kernel/time.c
> @@ -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;
> -	}
>   }


  parent reply	other threads:[~2010-03-06 22:40 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-04  3:57 [PATCH 00/14] Convert remaining arches to use read/update_persistent_clock John Stultz
2010-03-04  3:57 ` [PATCH 01/14] alpha: Convert alpha " John Stultz
2010-03-04  3:57   ` [PATCH 02/14] mn10300: Convert mn10300 " John Stultz
2010-03-04  3:57     ` [PATCH 03/14] frv: Convert frv " John Stultz
2010-03-04  3:57       ` [PATCH 04/14] parisc: Convert parisc " John Stultz
2010-03-04  3:57         ` [PATCH 05/14] h8300: Convert h8300 " John Stultz
2010-03-04  3:57           ` [PATCH 06/14] avr32: Convert avr32 " John Stultz
2010-03-04  3:57             ` [PATCH 07/14] ia64: Convert ia64 " John Stultz
2010-03-04  3:57               ` [PATCH 08/14] sh: Convert sh " John Stultz
2010-03-04  3:57                 ` [PATCH 09/14] blackfin: Convert blackfin " John Stultz
2010-03-04  3:57                   ` [PATCH 10/14] m32r: Convert m32r to use read/update_peristent_clock John Stultz
2010-03-04  3:57                     ` [PATCH 11/14] m68k: Convert m68k to use read/update_persistent_clock John Stultz
2010-03-04  3:57                       ` [PATCH 12/14] sparc: Convert sparc " John Stultz
2010-03-04  3:57                         ` [PATCH 13/14] cris: Convert cris " John Stultz
2010-03-04  3:57                           ` [PATCH 14/14] arm: Convert arm to use read_persistent_clock John Stultz
2010-03-04  9:36                             ` Russell King - ARM Linux
2010-03-04 19:55                               ` john stultz
2010-03-13  0:21                           ` [tip:timers/cleanup] cris: Convert cris to use read/update_persistent_clock tip-bot for John Stultz
2010-03-04  6:41                         ` [PATCH 12/14] sparc: Convert sparc " David Miller
2010-03-13  0:21                       ` [tip:timers/cleanup] m68k: Convert m68k " tip-bot for John Stultz
2010-03-13  0:21                     ` [tip:timers/cleanup] m32r: Convert m32r to use read/update_peristent_clock tip-bot for John Stultz
2010-03-09 23:53                   ` [PATCH 09/14] blackfin: Convert blackfin to use read/update_persistent_clock Mike Frysinger
2010-03-09 23:59                     ` john stultz
2010-03-10  0:01                       ` Mike Frysinger
2010-03-13  0:20                   ` [tip:timers/cleanup] " tip-bot for John Stultz
2010-03-04 17:00                 ` [PATCH 08/14] sh: Convert sh " Paul Mundt
2010-03-13  0:20               ` [tip:timers/cleanup] ia64: Convert ia64 " tip-bot for John Stultz
2010-03-13  0:20             ` [tip:timers/cleanup] avr32: Convert avr32 " tip-bot for John Stultz
2010-03-13  0:20           ` [tip:timers/cleanup] h8300: Convert h8300 " tip-bot for John Stultz
2010-03-06 22:40         ` Helge Deller [this message]
2010-03-06 22:49           ` [PATCH 04/14] parisc: Convert parisc " Kyle McMartin
2010-03-13  0:19       ` [tip:timers/cleanup] frv: Convert frv " tip-bot for John Stultz
2010-03-13  0:19     ` [tip:timers/cleanup] mn10300: Convert mn10300 " tip-bot for John Stultz
2010-03-13  0:19   ` [tip:timers/cleanup] alpha: Convert alpha " tip-bot for John Stultz

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=4B92D9DE.7030705@gmx.de \
    --to=deller@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=johnstul@us.ibm.com \
    --cc=kyle@mcmartin.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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