From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dirk Behme Date: Sat, 20 Oct 2007 08:24:14 +0200 Subject: [U-Boot-Users] PATCH: fix timer overflow in DaVinci In-Reply-To: <20071016204633.8DA23242E9@gemini.denx.de> References: <20071016204633.8DA23242E9@gemini.denx.de> Message-ID: <47199F0E.1030502@googlemail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > In message <265CBF1670611D47B47E67959D02EBE3C381D8@mngilex001.Jerusalem.mangodsp.com> you wrote: > >>The get_timer() function in DaVinci's timer.c doesn't handle overflow -- >>it simply subtracts the "base" from the current time, but if the timer >>overflowed and the current time is smaller than base, a negative number >>results. The attached patch fixes that. > > I think this is the wrong approach. get_timer() should not have to > deal with wrap arounds, because get_timer_masked() is suppsoed to > handle this internally. So please fix it there. Do you like to test this? It should decrease the counter values from the timer running at high frequency by division. With this, we should have some more time before timestamp wraps around. Signed-off-by: Dirk Behme -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: increase_timestamp_wraparound_time.txt Url: http://lists.denx.de/pipermail/u-boot/attachments/20071020/d65a00d9/attachment.txt