Skip to content

Commit 794867e

Browse files
hkallweitdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 82ebc88 commit 794867e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4249,8 +4249,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
42494249

42504250
txd_first->opts1 |= cpu_to_le32(DescOwn | FirstFrag);
42514251

4252-
/* Force all memory writes to complete before notifying device */
4253-
wmb();
4252+
/* rtl_tx needs to see descriptor changes before updated tp->cur_tx */
4253+
smp_wmb();
42544254

42554255
tp->cur_tx += frags + 1;
42564256

0 commit comments

Comments
 (0)