mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
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>
This commit is contained in:
parent
82ebc88909
commit
794867ee67
1 changed files with 2 additions and 2 deletions
|
@ -4249,8 +4249,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
|
||||||
|
|
||||||
txd_first->opts1 |= cpu_to_le32(DescOwn | FirstFrag);
|
txd_first->opts1 |= cpu_to_le32(DescOwn | FirstFrag);
|
||||||
|
|
||||||
/* Force all memory writes to complete before notifying device */
|
/* rtl_tx needs to see descriptor changes before updated tp->cur_tx */
|
||||||
wmb();
|
smp_wmb();
|
||||||
|
|
||||||
tp->cur_tx += frags + 1;
|
tp->cur_tx += frags + 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue