mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-11 07:39:47 +00:00
8139too: move wmb before TX DMA start
The write barrier should be used before starting a DMA transfer. This fixes a problem, where almost all packets received on another machine had garbled content. Tested with an RTL8100C on a MIPS machine. Signed-off-by: Andreas Oberritter <obi@linuxtv.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ed4cb1337b
commit
176eaa589b
@ -1723,13 +1723,18 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
spin_lock_irqsave(&tp->lock, flags);
|
spin_lock_irqsave(&tp->lock, flags);
|
||||||
|
/*
|
||||||
|
* Writing to TxStatus triggers a DMA transfer of the data
|
||||||
|
* copied to tp->tx_buf[entry] above. Use a memory barrier
|
||||||
|
* to make sure that the device sees the updated data.
|
||||||
|
*/
|
||||||
|
wmb();
|
||||||
RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
|
RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
|
||||||
tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
|
tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
|
||||||
|
|
||||||
dev->trans_start = jiffies;
|
dev->trans_start = jiffies;
|
||||||
|
|
||||||
tp->cur_tx++;
|
tp->cur_tx++;
|
||||||
wmb();
|
|
||||||
|
|
||||||
if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
|
if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
|
||||||
netif_stop_queue (dev);
|
netif_stop_queue (dev);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user