]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
r8169: use correct barrier between cacheable and non-cacheable memory
authorDavid Dillow <dave@thedillows.org>
Wed, 3 Mar 2010 16:33:10 +0000 (16:33 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 12 May 2010 22:02:51 +0000 (15:02 -0700)
commit 4c020a961a812ffae9846b917304cea504c3a733 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/r8169.c

index 3db85daa367112b054333892560dd4ee388bab97..f65bb69a086bd2e82d823d5d3c2ae7bb3aca4e2c 100644 (file)
@@ -4316,7 +4316,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 */
 
@@ -4675,7 +4675,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);
        }