From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Thu, 04 Dec 2008 22:48:47 -0800 Subject: [U-Boot] [PATCH] net/net.c: correct timeout function In-Reply-To: <20081203005808.GD2012@buzzloop.caiaq.de> References: <20081128162529.GA14044@buzzloop.caiaq.de> <20081203005808.GD2012@buzzloop.caiaq.de> Message-ID: <4938CECF.6090901@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Daniel, Daniel Mack wrote: > the net/net.c implementation of timeouts assumes that get_timer() returns > values in milliseconds. As this is true for most platforms, it does not > apply to PXA3x where the OSCR register increments with more than 3MHz. > > The following patch fixes the problem by calculation with the > CONFIG_SYS_HZ variable. > > I apologize for taking so long to respond to this. > Signed-off-by: Daniel Mack > > --- > net.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/net/net.c b/net/net.c > index 77e83b5..b9326de 100644 > --- a/net/net.c > +++ b/net/net.c > @@ -206,6 +206,11 @@ uchar NetArpWaitPacketBuf[PKTSIZE_ALIGN + PKTALIGN]; > ulong NetArpWaitTimerStart; > int NetArpWaitTry; > > +static long net_get_timer(long base) > +{ > + return get_timer(base) / (CONFIG_SYS_HZ / 1000); > +} > + > Please change this name to something more meaningful, maybe get_timer_ms(). Apart from that, looks good. If you re-submit soon I'll pull it in. regards, Ben