diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2020-04-20 22:52:59 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-20 16:03:48 -0700 |
commit | 794867ee6730fe3f0d419d3911f35a725cafe3a8 (patch) | |
tree | 1f02044a8b4cb3f3becf4fe294bc199fcc1188fc | |
parent | 82ebc889091a488b4dd95e682b3c3b889a50713c (diff) |
r8169: change wmb to smb_wmb in rtl8169_start_xmit
A barrier is needed here to ensure that rtl_tx sees the descriptor
changes (DescOwn set) before the updated tp->cur_tx value. Else it may
wrongly assume that the transfer has been finished already. For this
purpose smp_wmb() is sufficient.
No separate barrier is needed for ordering the descriptor changes
with the MMIO doorbell write. The needed barrier is included in
the non-relaxed writel() used by rtl8169_doorbell().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/realtek/r8169_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index b8cc064ee9f5..b7a2853e7396 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4249,8 +4249,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, txd_first->opts1 |= cpu_to_le32(DescOwn | FirstFrag); - /* Force all memory writes to complete before notifying device */ - wmb(); + /* rtl_tx needs to see descriptor changes before updated tp->cur_tx */ + smp_wmb(); tp->cur_tx += frags + 1; |