netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ftgmac100: Fix missing TX-poll issue
@ 2020-10-19  7:39 Dylan Hung
  2020-10-19  8:57 ` Joel Stanley
  0 siblings, 1 reply; 19+ messages in thread
From: Dylan Hung @ 2020-10-19  7:39 UTC (permalink / raw)
  To: davem, kuba, netdev, linux-kernel, ratbert, linux-aspeed, openbmc; +Cc: BMC-SW

The cpu accesses the register and the memory via different bus/path on
aspeed soc.  So we can not guarantee that the tx-poll command
(register access) is always behind the tx descriptor (memory).  In other
words, the HW may start working even the data is not yet ready.  By
adding a dummy read after the last data write, we can ensure the data
are pushed to the memory, then guarantee the processing sequence

Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
---
 drivers/net/ethernet/faraday/ftgmac100.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 00024dd41147..9a99a87f29f3 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -804,7 +804,8 @@ static netdev_tx_t ftgmac100_hard_start_xmit(struct sk_buff *skb,
 	 * before setting the OWN bit on the first descriptor.
 	 */
 	dma_wmb();
-	first->txdes0 = cpu_to_le32(f_ctl_stat);
+	WRITE_ONCE(first->txdes0, cpu_to_le32(f_ctl_stat));
+	READ_ONCE(first->txdes0);
 
 	/* Update next TX pointer */
 	priv->tx_pointer = pointer;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-10-27  2:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19  7:39 [PATCH] net: ftgmac100: Fix missing TX-poll issue Dylan Hung
2020-10-19  8:57 ` Joel Stanley
2020-10-19  9:19   ` Dylan Hung
2020-10-19 19:00   ` Jakub Kicinski
2020-10-19 23:23     ` Benjamin Herrenschmidt
2020-10-20  2:57       ` Jakub Kicinski
2020-10-20  6:15         ` Benjamin Herrenschmidt
2020-10-20 17:24           ` Jakub Kicinski
2020-10-20  6:14     ` Dylan Hung
2020-10-20 13:15       ` David Laight
2020-10-20 22:05         ` Benjamin Herrenschmidt
     [not found]       ` <CAK8P3a2pEfbLDWTppVHmGxXduOWPCwBw-8bMY9h3EbEecsVfTA@mail.gmail.com>
2020-10-20 22:10         ` Benjamin Herrenschmidt
2020-10-20 22:25           ` Andrew Jeffery
2020-10-23 13:08             ` Dylan Hung
2020-10-26 22:21               ` Benjamin Herrenschmidt
2020-10-27  2:18                 ` Joel Stanley
     [not found]           ` <CAK8P3a2j7fV5EFmC8UvSyvXixU8=Nmp6hrJco-fdP2Z+w8bLnA@mail.gmail.com>
2020-10-21 12:11             ` Arnd Bergmann
2020-10-22  7:40               ` Benjamin Herrenschmidt
2020-10-23  8:39                 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).