mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: David Dgien via B4 Relay <devnull+dgienda125.gmail.com@kernel.org>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Cc: Billy Gomez <william.james.gomez@gmail.com>,
	 David Dgien <dgienda125@gmail.com>
Subject: [PATCH] macb: Fix tx completion check
Date: Mon, 27 Jan 2025 23:16:18 -0500	[thread overview]
Message-ID: <20250127-fix-macb-send-v1-1-d9b6067dda86@gmail.com> (raw)

From: David Dgien <dgienda125@gmail.com>

Check the send completion bit for the current packet in the descriptor
ring, instead of just the first entry in the ring.

This fixes issues when sending multiple small packets in quick
succession, such as with netconsole.

Reported-by: Billy Gomez <william.james.gomez@gmail.com>
Signed-off-by: David Dgien <dgienda125@gmail.com>
Fixes: aa2095304a ("macb: fix tx ring size")
---
 drivers/net/macb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 28c2fc860e37853a91488a675af3716d9f3843df..205e3169f17b2b762ba51640248a2ea96db5c582 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -132,7 +132,7 @@ static int macb_send(struct eth_device *edev, void *packet,
 	start = get_time_ns();
 	ret = -ETIMEDOUT;
 	do {
-		ctrl = readl(&macb->tx_ring[0].ctrl);
+		ctrl = readl(&macb->tx_ring[tx_head].ctrl);
 		if (ctrl & MACB_BIT(TX_USED)) {
 			ret = 0;
 			break;

---
base-commit: 1a3be5bdf6329e4e691f1d39461f5157767c7e72
change-id: 20250126-fix-macb-send-3600780f5de8

Best regards,
-- 
David Dgien <dgienda125@gmail.com>





             reply	other threads:[~2025-01-28  3:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28  4:16 David Dgien via B4 Relay [this message]
2025-01-28 10:02 ` 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=20250127-fix-macb-send-v1-1-d9b6067dda86@gmail.com \
    --to=devnull+dgienda125.gmail.com@kernel.org \
    --cc=barebox@lists.infradead.org \
    --cc=dgienda125@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=william.james.gomez@gmail.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