lkml.org 
[lkml]   [2004]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] use mmiowb in tg3.c
Date
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

Thanks,
Jesse
===== drivers/net/tg3.c 1.210 vs edited =====
--- 1.210/drivers/net/tg3.c 2004-10-06 09:42:56 -07:00
+++ edited/drivers/net/tg3.c 2004-10-21 16:06:37 -07:00
@@ -2729,6 +2729,7 @@
tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
sw_idx);
}
+ mmiowb();

return received;
}
@@ -3176,6 +3177,7 @@
netif_stop_queue(dev);

out_unlock:
+ mmiowb();
spin_unlock_irqrestore(&tp->tx_lock, flags);

dev->trans_start = jiffies;
\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.137 / U:1.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site