mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org, Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: Re: [PATCH 1/2] net: macb: remove gem_recv and reorder probe
Date: Wed, 13 Mar 2013 14:08:40 +0100	[thread overview]
Message-ID: <20130313130840.GB3475@pengutronix.de> (raw)
In-Reply-To: <20130313121703.GF1568@game.jcrosoft.org>

On Wed, Mar 13, 2013 at 01:17:03PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 11:15 Wed 13 Mar     , Sascha Hauer wrote:
> > On Wed, Mar 13, 2013 at 10:03:36AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > > On 09:48 Wed 13 Mar     , Steffen Trumtrar wrote:
> > > > The function gem_recv implements a buffer "ring" that stops at filling level 10.
> > > > That means, when the driver is used as gem, it stops receiving after exactly
> > > > 10 packets. Instead of implementing macb_recv twice, use it also for the gem
> > > > part. If there needs to be an extra recv function for the gigabit case, it can
> > > > be added than.
> > > > Also, first set the type of device (macb or gem) and then use functions that
> > > > use this info.
> > > > 
> > > > Tested on a Zynq7000.
> > > NACK
> > > 
> > > on gem we can receive the packet in one buffer the gem_recv implement this
> > > the macb can only receive splited buffer and then you have to reconstruct the
> > > packet
> > 
> > The gem received function was never used...
> > 
> > > >  static int macb_recv(struct eth_device *edev)
> > > >  {
> > > >  	struct macb_device *macb = edev->priv;
> > > > @@ -619,11 +588,6 @@ static int macb_probe(struct device_d *dev)
> > > >  
> > > >  	macb->phy_flags = pdata->phy_flags;
> > > >  
> > > > -	macb_init_rx_buffer_size(macb, PKTSIZE);
> > > > -	macb->rx_buffer = dma_alloc_coherent(macb->rx_buffer_size * macb->rx_ring_size);
> > > > -	macb->rx_ring = dma_alloc_coherent(RX_RING_BYTES(macb));
> > > > -	macb->tx_ring = dma_alloc_coherent(TX_RING_BYTES);
> > > > -
> > > >  	macb->regs = dev_request_mem_region(dev, 0);
> > > >  
> > > >  	/*
> > > > @@ -638,12 +602,15 @@ static int macb_probe(struct device_d *dev)
> > > >  
> > > >  	clk_enable(macb->pclk);
> > > >  
> > > > -	if (macb_is_gem(macb))
> > 
> > ... because macb_is_gem() is used here ...
> > 
> > > > -		edev->recv = gem_recv;
> > > > -	else
> > > > -		edev->recv = macb_recv;
> > > >  	macb->is_gem = read_is_gem(macb);
> > 
> > ... but the variable is initialized here. Up to this point macb_is_gem()
> > will return 0.
> so this is a bug when the driver was merge to the mailine but here I does use
> the gem_recv.
> 

What about the gem_recv function itself? It only increases rx_tail, but never
resets it. Therefore the buffer is full after 10 packets. Do you already have a
patch for that?

Regards,
Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-03-13 13:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-13  8:48 Steffen Trumtrar
2013-03-13  8:48 ` [PATCH 2/2] net: macb: turn off endian_swp_pkt_en Steffen Trumtrar
2013-03-13  9:04   ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-13  9:17     ` Steffen Trumtrar
2013-03-13  9:03 ` [PATCH 1/2] net: macb: remove gem_recv and reorder probe Jean-Christophe PLAGNIOL-VILLARD
2013-03-13  9:19   ` Steffen Trumtrar
2013-03-13  9:32     ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-13  9:33       ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-13 10:15   ` Sascha Hauer
2013-03-13 12:17     ` Jean-Christophe PLAGNIOL-VILLARD
2013-03-13 13:08       ` Steffen Trumtrar [this message]
2013-03-13 15:36         ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130313130840.GB3475@pengutronix.de \
    --to=s.trumtrar@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox