From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2 v2] macb: add timeout on send
Date: Mon, 5 Mar 2012 19:00:34 +0100 [thread overview]
Message-ID: <1330970435-2681-1-git-send-email-plagnioj@jcrosoft.com> (raw)
This will ensure that we send an other packet only when the first one is send.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
drivers/net/macb.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index ab0d1af..ea8ae82 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -120,6 +120,11 @@ static int macb_send(struct eth_device *edev, void *packet,
barrier();
writel(MACB_BIT(TE) | MACB_BIT(RE) | MACB_BIT(TSTART), macb->regs + MACB_NCR);
+ wait_on_timeout(100 * MSECOND,
+ !(macb->tx_ring[0].ctrl & TXBUF_USED));
+
+ ctrl = macb->tx_ring[0].ctrl;
+
if (ctrl & TXBUF_UNDERRUN)
printf("TX underrun\n");
if (ctrl & TXBUF_EXHAUSTED)
--
1.7.7
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2012-03-05 18:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-05 18:00 Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-03-05 18:00 ` [PATCH 2/2] macb: fix mmu 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=1330970435-2681-1-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--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