lkml.org 
[lkml]   [2009]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [tip:timers/core] timekeeping: Increase granularity of read_persistent_clock()
On Sat, 22 Aug 2009 17:33:46 +0200
Ingo Molnar <mingo@elte.hu> wrote:

>
> * Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:
>
> > > FYI, -tip arch-testing found that this commit broke the PowerPC
> > > build:
> > >
> > > /home/mingo/tip/arch/powerpc/kernel/time.c: In function 'read_persistent_clock':
> > > /home/mingo/tip/arch/powerpc/kernel/time.c:788: error: 'return' with a value, in function returning void
> > > /home/mingo/tip/arch/powerpc/kernel/time.c:791: error: 'return' with a value, in function returning void
> > > make[2]: *** [arch/powerpc/kernel/time.o] Error 1
> > > make[2]: *** Waiting for unfinished jobs....
> > > make[1]: *** [arch/powerpc/kernel] Error 2
> >
> > I overlooked a case in the powerpc version of read_persistent_lock.
> > New patch:
>
> the patches are already committed and this patch doesnt apply - mind
> sending a delta fix against tip:master:
>
> http://people.redhat.com/mingo/tip.git/README

Here we go:

--
Subject: [PATCH] powerpc: build fix for read_persistent_clock

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

Fix the following build problem on powerpc:

arch/powerpc/kernel/time.c: In function 'read_persistent_clock':
arch/powerpc/kernel/time.c:788: error: 'return' with a value, in function returning void
arch/powerpc/kernel/time.c:791: error: 'return' with a value, in function returning void
make[2]: *** [arch/powerpc/kernel/time.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [arch/powerpc/kernel] Error 2

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---
arch/powerpc/kernel/time.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

Index: linux-2.6/arch/powerpc/kernel/time.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/time.c
+++ linux-2.6/arch/powerpc/kernel/time.c
@@ -774,6 +774,7 @@ void read_persistent_clock(struct timesp
struct rtc_time tm;
static int first = 1;

+ ts->tv_nsec = 0;
/* XXX this is a litle fragile but will work okay in the short term */
if (first) {
first = 0;
@@ -781,15 +782,18 @@ void read_persistent_clock(struct timesp
timezone_offset = ppc_md.time_init();

/* get_boot_time() isn't guaranteed to be safe to call late */
- if (ppc_md.get_boot_time)
- return ppc_md.get_boot_time() -timezone_offset;
+ if (ppc_md.get_boot_time) {
+ ts->tv_sec = ppc_md.get_boot_time() -timezone_offset;
+ return;
+ }
+ }
+ if (!ppc_md.get_rtc_time) {
+ ts->tv_sec = 0;
+ return;
}
- if (!ppc_md.get_rtc_time)
- return 0;
ppc_md.get_rtc_time(&tm);
ts->tv_sec = mktime(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
- ts->tv_nsec = 0;
}

/* clocksource code */
--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.



\
 
 \ /
  Last update: 2009-08-22 22:25    [W:0.170 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site