Skip to content

Commit

Permalink
r8169: use correct barrier between cacheable and non-cacheable memory
Browse files Browse the repository at this point in the history
r8169 needs certain writes to be visible to other CPUs or the NIC before
touching the hardware, but was using smp_wmb() which is only required to
order cacheable memory access. Switch to wmb() which is required to
order both cacheable and non-cacheable memory.

Noticed by Catalin Marinas and Paul Mackerras.

Signed-off-by: David Dillow <dave@thedillows.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David Dillow authored and David S. Miller committed Mar 4, 2010
1 parent d0021b2 commit 4c020a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -4270,7 +4270,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,

tp->cur_tx += frags + 1;

smp_wmb();
wmb();

RTL_W8(TxPoll, NPQ); /* set polling bit */

Expand Down Expand Up @@ -4621,7 +4621,7 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
* until it does.
*/
tp->intr_mask = 0xffff;
smp_wmb();
wmb();
RTL_W16(IntrMask, tp->intr_event);
}

Expand Down

0 comments on commit 4c020a9

Please sign in to comment.