mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org, Nicolas Ferre <nicolas.ferre@atmel.com>
Subject: Re: [PATCH 6/7] macb: fix tx ring size
Date: Mon, 11 Feb 2013 17:33:36 +0100	[thread overview]
Message-ID: <20130211163336.GB25672@pengutronix.de> (raw)
In-Reply-To: <1360315130-23872-6-git-send-email-plagnioj@jcrosoft.com>

On Fri, Feb 08, 2013 at 10:18:49AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> the mininal tx ring size is 2 as if one we wrap on the same descriptor
> and can cause IP lock on GEM (gigabit version) this is always the case
> 
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  drivers/net/macb.c |   50 ++++++++++++++++++++++++++++++++++----------------
>  1 file changed, 34 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index d6b60aa..3a65af7 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -53,15 +53,17 @@
>  
>  #define MACB_RX_BUFFER_SIZE	128
>  #define RX_BUFFER_MULTIPLE	64  /* bytes */
> -#define RX_RING_SIZE		32 /* must be power of 2 */

This removes RX_RING_SIZE...

> @@ -244,10 +259,13 @@ static void macb_init(struct macb_device *macb)
>  	}
>  	macb->rx_ring[RX_RING_SIZE - 1].addr |= MACB_BIT(RX_WRAP);

But not its users.

Dropped.

Sascha

>  
> -	macb->tx_ring[0].addr = 0;
> -	macb->tx_ring[0].ctrl = MACB_BIT(TX_USED) | MACB_BIT(TX_WRAP);
> +	for (i = 0; i < TX_RING_SIZE; i++) {
> +		macb->tx_ring[i].addr = 0;
> +		macb->tx_ring[i].ctrl = MACB_BIT(TX_USED);
> +	}
> +	macb->tx_ring[TX_RING_SIZE - 1].addr |= MACB_BIT(TX_WRAP);
>  
> -	macb->rx_tail = macb->tx_tail = 0;
> +	macb->rx_tail = macb->tx_head = macb->tx_tail = 0;
>  
>  	macb_writel(macb, RBQP, (ulong)macb->rx_ring);
>  	macb_writel(macb, TBQP, (ulong)macb->tx_ring);
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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

  parent reply	other threads:[~2013-02-11 16:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08  9:07 [For master PATCH 0/7] macb: more fixes + gem (gigabit support) Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18 ` [PATCH 1/7] macb: call macb_init at probe explecitly Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 2/7] macb: sync remaining define with linux Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 3/7] macb: use the macro as in linux for tx/rx buffer ring size Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 4/7] macb: enable Tramsmit and Receive at open Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 5/7] macb: reset the IP at init Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 6/7] macb: fix tx ring size Jean-Christophe PLAGNIOL-VILLARD
2013-02-08 12:20     ` Alexander Aring
2013-02-08 13:36       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-11 16:33     ` Sascha Hauer [this message]
2013-02-11 16:52       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-08  9:18   ` [PATCH 7/7] macb: add cadence Gigabit GEM support Jean-Christophe PLAGNIOL-VILLARD
2013-02-08 10:24 ` [For master PATCH 0/7] macb: more fixes + gem (gigabit support) Nicolas Ferre
2013-02-11  8:35 ` Sascha Hauer
2013-02-11 16:57 ` [PATCH 6/7 v2] macb: fix tx ring size Jean-Christophe PLAGNIOL-VILLARD
2013-02-11 16:57   ` [PATCH 7/7 v2] macb: add cadence Gigabit GEM support 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=20130211163336.GB25672@pengutronix.de \
    --to=s.hauer@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