Thread (11 messages) 11 messages, 5 authors, 2020-10-20

Re: [PATCH] net: ftgmac100: Fix missing TX-poll issue

From: Jakub Kicinski <kuba@kernel.org>
Date: 2020-10-19 19:00:45
Also in: linux-aspeed, lkml, openbmc

On Mon, 19 Oct 2020 08:57:03 +0000 Joel Stanley wrote:
quoted
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);  
I understand what you're trying to do here, but I'm not sure that this
is the correct way to go about it.

It does cause the compiler to produce a store and then a load.
+1 @first is system memory from dma_alloc_coherent(), right?

You shouldn't have to do this. Is coherent DMA memory broken 
on your platform?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help