Commit ff53177b authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[TG3]: Use mmiowb in tg3.c

From: Jesse Barnes <jbarnes@engr.sgi.com>

This patch originally from Greg Banks.  Some parts of the tg3 driver depend
on PIO writes arriving in order.  This patch ensures that in two key places
using the new mmiowb macro.  This not only prevents bugs (the queues can be
corrupted), but is much faster than ensuring ordering using PIO reads
(which involve a few round trips to the target bus on some platforms).

Arthur has another patch that uses mmiowb in tg3 that he posted earlier as
well.
Signed-off-by: default avatarGreg Banks <gnb@sgi.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9a254bf5
......@@ -2730,6 +2730,7 @@ static int tg3_rx(struct tg3 *tp, int budget)
tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
sw_idx);
}
mmiowb();
return received;
}
......@@ -3177,6 +3178,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
out_unlock:
mmiowb();
spin_unlock_irqrestore(&tp->tx_lock, flags);
dev->trans_start = jiffies;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment