netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Adrian Bunk <bunk@stusta.de>
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/2] sky2: dual-port pci-x checksum fix
Date: Wed, 21 Feb 2007 16:04:43 -0800	[thread overview]
Message-ID: <20070222000621.769898000@linux-foundation.org> (raw)
In-Reply-To: 20070222000441.469009000@linux-foundation.org

[-- Attachment #1: sky2-pcix-dual.patch --]
[-- Type: text/plain, Size: 1202 bytes --]

Add a workaround for dual port PCI-X card that returns status out of
order sometimes because of split transactions.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>


--- linux-2.6.16.40.orig/drivers/net/sky2.c	2007-02-14 16:45:23.000000000 -0800
+++ linux-2.6.16.40/drivers/net/sky2.c	2007-02-14 16:47:06.000000000 -0800
@@ -1031,7 +1031,25 @@
 	struct sky2_hw *hw = sky2->hw;
 	unsigned port = sky2->port;
 	u32 ramsize, rxspace;
-	int err = -ENOMEM;
+	int cap, err = -ENOMEM;
+	struct net_device *otherdev = hw->dev[sky2->port^1];
+
+	/*
+ 	 * On dual port PCI-X card, there is an problem where status
+	 * can be received out of order due to split transactions
+	 */
+	if (otherdev && netif_running(otherdev) &&
+ 	    (cap = pci_find_capability(hw->pdev, PCI_CAP_ID_PCIX))) {
+ 		struct sky2_port *osky2 = netdev_priv(otherdev);
+ 		u16 cmd;
+
+ 		cmd = sky2_pci_read16(hw, cap + PCI_X_CMD);
+ 		cmd &= ~PCI_X_CMD_MAX_SPLIT;
+ 		sky2_pci_write16(hw, cap + PCI_X_CMD, cmd);
+
+ 		sky2->rx_csum = 0;
+ 		osky2->rx_csum = 0;
+ 	}
 
 	if (netif_msg_ifup(sky2))
 		printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);

--
Stephen Hemminger <shemminger@linux-foundation.org>


  parent reply	other threads:[~2007-02-22  0:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-22  0:04 [PATCH 0/2] sky2: patches for 2.6.16 -stable Stephen Hemminger
2007-02-22  0:04 ` [PATCH 1/2] sky2: fix for NAPI with dual port boards Stephen Hemminger
2007-02-22  0:04 ` Stephen Hemminger [this message]
2007-02-22 20:08 ` [PATCH 0/2] sky2: patches for 2.6.16 -stable Adrian Bunk

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=20070222000621.769898000@linux-foundation.org \
    --to=shemminger@linux-foundation.org \
    --cc=bunk@stusta.de \
    --cc=netdev@vger.kernel.org \
    /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).