From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Wed, 10 Aug 2011 21:24:50 +0200 Subject: [U-Boot] [PATCH] tsec: Configure the buffer descriptor bases to always include all of the descriptors In-Reply-To: (Joe Hershberger's message of "Wed, 10 Aug 2011 14:15:09 -0500") References: <1312960344-1499-1-git-send-email-joe.hershberger@ni.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Joe, > On Wed, Aug 10, 2011 at 7:29 AM, Detlev Zundel wrote: >>> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c >>> index 78ffc95..1805ca0 100644 >>> --- a/drivers/net/tsec.c >>> +++ b/drivers/net/tsec.c >>> @@ -250,8 +250,8 @@ static void startup_tsec(struct eth_device *dev) >>> ? ? ? txIdx = 0; >>> >>> ? ? ? /* Point to the buffer descriptors */ >>> - ? ? out_be32(®s->tbase, (unsigned int)(&rtx.txbd[txIdx])); >>> - ? ? out_be32(®s->rbase, (unsigned int)(&rtx.rxbd[rxIdx])); >>> + ? ? out_be32(®s->tbase, (unsigned int)(&rtx.txbd[0])); >>> + ? ? out_be32(®s->rbase, (unsigned int)(&rtx.rxbd[0])); >>> >>> ? ? ? /* Initialize the Rx Buffer descriptors */ >>> ? ? ? for (i = 0; i < PKTBUFSRX; i++) { >> >> I see these two lines just before the code you change (one is even in >> the context of your patch): >> >> ? ? ? ?/* reset the indices to zero */ >> ? ? ? ?rxIdx = 0; >> ? ? ? ?txIdx = 0; >> >> So can you tell me, what your change actually does? ?I cannot remember >> that we have concurrency issues here, or do we? > > My apologies... I ported this patch from my work in u-boot 2009.11 and > did not notice that change above. I think explicitly using 0 when > assigning the base address pointers is clearer, though. > > It seems the resetting of the indexes to 0 was added by Andy Fleming > in 063c12633d5ad74d52152d9c358e715475e17629, though the log doesn't > discuss it.. Yes, I see - it even slipped my review :( For the patch as such I don't have a preference - looking at the code both ways really read the same for me. Cheers Detlev -- I've never understood the tendency to pick up tastes because they are popular. In fact, I think it is foolish to do that. I mean, don't you know what you like? People who are so weak that they will take their tastes from people around them in the desperate desire to be accepted, I think of them as cowards. -- Richard M. Stallman -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de