netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@engr.sgi.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Cc: netdev@oss.sgi.com, jgarzik@pobox.com, davem@davemloft.net,
	gnb@sgi.com, akepner@sgi.com
Subject: [PATCH] use mmiowb in tg3.c
Date: Thu, 21 Oct 2004 16:28:06 -0700	[thread overview]
Message-ID: <200410211628.06906.jbarnes@engr.sgi.com> (raw)
In-Reply-To: <200410211613.19601.jbarnes@engr.sgi.com>

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

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

[-- Attachment #2: tg3-mmiowb-2.patch --]
[-- Type: text/plain, Size: 459 bytes --]

===== 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;

       reply	other threads:[~2004-10-21 23:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200410211613.19601.jbarnes@engr.sgi.com>
2004-10-21 23:28 ` Jesse Barnes [this message]
2004-10-21 23:40   ` [PATCH] use mmiowb in tg3.c David S. Miller
2004-10-22  1:16     ` Benjamin Herrenschmidt
2004-10-22  1:33       ` akepner
2004-10-22  2:07         ` Benjamin Herrenschmidt
2004-10-22  3:01     ` Jesse Barnes
2004-10-22  4:00       ` Paul Mackerras
2004-10-22 20:51   ` [PATCH] use mmiowb in tg3_poll akepner
2005-05-28 23:12     ` Lennert Buytenhek
2005-05-30 16:30       ` Arthur Kepner
2005-05-31 12:53         ` jamal
2005-05-31 16:45           ` Jesse Barnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200410211628.06906.jbarnes@engr.sgi.com \
    --to=jbarnes@engr.sgi.com \
    --cc=akepner@sgi.com \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=gnb@sgi.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).