
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: Greg Banks <gnb@sgi.com>
Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/net/tg3.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN drivers/net/tg3.c~use-mmiowb-in-tg3c drivers/net/tg3.c
--- 25/drivers/net/tg3.c~use-mmiowb-in-tg3c	2004-10-21 21:20:33.713943024 -0700
+++ 25-akpm/drivers/net/tg3.c	2004-10-21 21:20:33.722941656 -0700
@@ -2729,6 +2729,7 @@ next_pkt_nopost:
 		tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
 			     sw_idx);
 	}
+	mmiowb();
 
 	return received;
 }
@@ -3176,6 +3177,7 @@ static int tg3_start_xmit(struct sk_buff
 		netif_stop_queue(dev);
 
 out_unlock:
+    	mmiowb();
 	spin_unlock_irqrestore(&tp->tx_lock, flags);
 
 	dev->trans_start = jiffies;
_
