mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: barebox@lists.infradead.org
Cc: Ian Abbott <abbotti@mev.co.uk>
Subject: [PATCH 4/4] net/designware: add explicit reset of {tx|rx}_currdescnum
Date: Mon,  7 Nov 2016 18:16:24 +0000	[thread overview]
Message-ID: <20161107181624.4262-5-abbotti@mev.co.uk> (raw)
In-Reply-To: <20161107181624.4262-1-abbotti@mev.co.uk>

Driver "init" function might be called multiple times.
On every "init" Tx/Rx buffer descriptors are initialized: "descs_init"
-> "{tx|rx}_descs_init".

In its turn those init functions set MAC's "{tx|rx}desclistaddr" to
point on the first buffer descriptor in the list.

So CPU to start operation from the first buffer descriptor as well after
every "init" we have to reset "{tx|rx}_currdescnum".

[Original U-Boot patch by Alexey Brodkin <abrodkin@synopsys.com>]

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/net/designware.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 6702d4c..bd20a87 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -176,6 +176,7 @@ static void tx_descs_init(struct eth_device *dev)
 	desc_p->dmamac_next = &desc_table_p[0];
 
 	writel((ulong)&desc_table_p[0], &dma_p->txdesclistaddr);
+	priv->tx_currdescnum = 0;
 }
 
 static void rx_descs_init(struct eth_device *dev)
@@ -207,6 +208,7 @@ static void rx_descs_init(struct eth_device *dev)
 	desc_p->dmamac_next = &desc_table_p[0];
 
 	writel((ulong)&desc_table_p[0], &dma_p->rxdesclistaddr);
+	priv->rx_currdescnum = 0;
 }
 
 static void descs_init(struct eth_device *dev)
-- 
2.10.1


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

  parent reply	other threads:[~2016-11-07 18:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 18:16 [PATCH 0/4] net/designware: A few patches from U-Boot Ian Abbott
2016-11-07 18:16 ` [PATCH 1/4] net/designware: Consecutive writes to the same register to be avoided Ian Abbott
2016-11-07 18:16 ` [PATCH 2/4] net/designware: Do not select MIIPORT for RGMII interface Ian Abbott
2016-11-07 18:16 ` [PATCH 3/4] net: designware: Respect "bus mode" register contents on SW reset Ian Abbott
2016-11-07 18:16 ` Ian Abbott [this message]
2016-11-10  8:49 ` [PATCH 0/4] net/designware: A few patches from U-Boot Sascha Hauer
2016-11-10 10:26   ` Ian Abbott
2016-11-10 14:04 ` Sascha Hauer

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=20161107181624.4262-5-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=barebox@lists.infradead.org \
    /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