mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Khoronzhuk <ikhoronz@cisco.com>
To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hch@lst.de,
	Ivan Khoronzhuk <ikhoronz@cisco.com>
Subject: [PATCH net] net: octeon: mgmt: fix xmit hang as busy
Date: Fri,  2 Apr 2021 10:29:22 +0000	[thread overview]
Message-ID: <20210402102922.8495-1-ikhoronz@cisco.com> (raw)

The issue happens only at appropriate circumstances, in my case I
faced it only while running crash kernel, when basic kernel worked
fine. The code inspection has shown tx_current_fill counter overflow,
after one packet or couple packets were sent. That's because tx
cleanup tasklet dequeued bunch of not correct packets afterwards when
it should only one. As result xmit queue counter becomes more than
tx ring size and xmit always returns NETDEV_TX_BUSY. The reason is in
some trash got by dma after ringing the bell. The wmb() in correct
place solved the issue, so reason likely in removal of
mips_swiotlb_ops which had an mb() after most of the operations and
the removal of the ops had broken the tx functionality of the driver
implicitly.

The patch has been tested on Octeon II.

Fixes: a999933db9ed ("MIPS: remove mips_swiotlb_ops")
Change-Id: I947c359d9451c75a693bc4a3f2958489503fc0ab
Signed-off-by: Ivan Khoronzhuk <ikhoronz@cisco.com>
---
Based on net/master

 drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
index ecffebd513be..be1c353b961c 100644
--- a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
@@ -1315,6 +1315,10 @@ octeon_mgmt_xmit(struct sk_buff *skb, struct net_device *netdev)
 
 	spin_unlock_irqrestore(&p->tx_list.lock, flags);
 
+	/* Make sure there is no reorder of filling the ring and ringing
+	 * the bell
+	 */
+	wmb();
 	dma_sync_single_for_device(p->dev, p->tx_ring_handle,
 				   ring_size_to_bytes(OCTEON_MGMT_TX_RING_SIZE),
 				   DMA_BIDIRECTIONAL);
-- 
2.18.2


                 reply	other threads:[~2021-04-02 10:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210402102922.8495-1-ikhoronz@cisco.com \
    --to=ikhoronz@cisco.com \
    --cc=davem@davemloft.net \
    --cc=hch@lst.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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

all inboxes | Powered by JetHome®