summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-02-22 21:07:51 +0100
committerAdrian Bunk <bunk@stusta.de>2007-02-22 21:07:51 +0100
commit4d12b6639bae991f592395da6895d02f11dd8ed9 (patch)
treeadea4c8d18c32b683a3eded8f6456f389aeb150e
parent189b9a3bc90ecb79eb82ed4450db177aed7d292d (diff)
downloadkernel-common-4d12b6639bae991f592395da6895d02f11dd8ed9.tar.gz
kernel-common-4d12b6639bae991f592395da6895d02f11dd8ed9.tar.bz2
kernel-common-4d12b6639bae991f592395da6895d02f11dd8ed9.zip
sky2: dual-port pci-x checksum fix
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> Signed-off-by: Adrian Bunk <bunk@stusta.de>
-rw-r--r--drivers/net/sky2.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 171443f9fc74..bc1d052f8f20 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1031,7 +1031,25 @@ static int sky2_up(struct net_device *dev)
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);