]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/skge.c
8139too: fix a TX timeout watchdog thread against NAPI softirq race
[linux-2.6-omap-h63xx.git] / drivers / net / skge.c
index 96b661b1f6c0e450034be6a02d2f188da9044433..bf55a4cfb3d25e6a8c401f7518b98bb5e9b74f56 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include <linux/config.h>
+#include <linux/in.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -43,7 +44,7 @@
 #include "skge.h"
 
 #define DRV_NAME               "skge"
-#define DRV_VERSION            "1.2"
+#define DRV_VERSION            "1.3"
 #define PFX                    DRV_NAME " "
 
 #define DEFAULT_TX_RING_SIZE   128
@@ -397,6 +398,7 @@ static int skge_set_ring_param(struct net_device *dev,
                               struct ethtool_ringparam *p)
 {
        struct skge_port *skge = netdev_priv(dev);
+       int err;
 
        if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE ||
            p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE)
@@ -407,7 +409,9 @@ static int skge_set_ring_param(struct net_device *dev,
 
        if (netif_running(dev)) {
                skge_down(dev);
-               skge_up(dev);
+               err = skge_up(dev);
+               if (err)
+                       dev_close(dev);
        }
 
        return 0;
@@ -3239,12 +3243,22 @@ static int __devinit skge_probe(struct pci_dev *pdev,
 
        pci_set_master(pdev);
 
-       if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)))
+       if (sizeof(dma_addr_t) > sizeof(u32) &&
+           !(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
                using_dac = 1;
-       else if (!(err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
-               printk(KERN_ERR PFX "%s no usable DMA configuration\n",
-                      pci_name(pdev));
-               goto err_out_free_regions;
+               err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
+               if (err < 0) {
+                       printk(KERN_ERR PFX "%s unable to obtain 64 bit DMA "
+                              "for consistent allocations\n", pci_name(pdev));
+                       goto err_out_free_regions;
+               }
+       } else {
+               err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
+               if (err) {
+                       printk(KERN_ERR PFX "%s no usable DMA configuration\n",
+                              pci_name(pdev));
+                       goto err_out_free_regions;
+               }
        }
 
 #ifdef __BIG_ENDIAN
@@ -3413,8 +3427,8 @@ static int skge_resume(struct pci_dev *pdev)
                struct net_device *dev = hw->dev[i];
                if (dev) {
                        netif_device_attach(dev);
-                       if (netif_running(dev))
-                               skge_up(dev);
+                       if (netif_running(dev) && skge_up(dev))
+                               dev_close(dev);
                }
        }
        return 0;