Sascha,
> -----Original Message-----
> From: Sascha Hauer [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 03, 2008 10:14 AM
> To: Menon, Nishanth
> Cc: u-boot-users@lists.sourceforge.net; Laurent Desnogues; [EMAIL PROTECTED];
> [EMAIL PROTECTED]; Gopinath, Thara; Kamat, Nishant; Syed Mohammed, Khasim
> Subject: Re: [Patch 02/17] U-Boot-V2:Common:Clock Handle caseofclockrollover 
> for get_time_ns
> 
> > Output will be:
> > delta1=0xFFFFFFF8 maskdelta1=0x0000FFF0 delta2=0x00000000
> >
> > What we will get now is maskdelta1, while delta2 is the right value.
> 
> It's not that I thought of the code by myself, I just looked into the
> kernel and it's exactly like this in the kernel code. So you either just
> found a kernel bug or we both understand something wrong.

Here is a revisit of this patch. The change will ensure cycle_now and last will 
be masked.

Signed-off-by: Nishanth Menon<[EMAIL PROTECTED]>

---
 common/clock.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: u-boot.v2/common/clock.c
===================================================================
--- u-boot.v2.orig/common/clock.c       2007-10-10 21:50:14.000000000 -0500
+++ u-boot.v2/common/clock.c    2008-06-03 11:16:05.000000000 -0500
@@ -41,7 +41,7 @@
         uint64_t ns_offset;
 
         /* read clocksource: */
-        cycle_now = cs->read();
+       cycle_now = cs->read() & cs->mask;
 
         /* calculate the delta since the last call: */
         cycle_delta = (cycle_now - cs->cycle_last) & cs->mask;

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to