]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/atl1/atl1_main.c
atl1: explain 32-bit DMA restriction
[linux-2.6-omap-h63xx.git] / drivers / net / atl1 / atl1_main.c
index 56f6389a300eb3c18a50b7b636cb9965118b49cb..4c728f1169c450a4f423dae036dcbbd168772793 100644 (file)
@@ -76,7 +76,6 @@
 #include <linux/compiler.h>
 #include <linux/delay.h>
 #include <linux/mii.h>
-#include <linux/interrupt.h>
 #include <net/checksum.h>
 
 #include <asm/atomic.h>
@@ -1704,10 +1703,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                }
        }
 
-       local_irq_save(flags);
-       if (!spin_trylock(&adapter->lock)) {
+       if (!spin_trylock_irqsave(&adapter->lock, flags)) {
                /* Can't get lock - tell upper layer to requeue */
-               local_irq_restore(flags);
                dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
                return NETDEV_TX_LOCKED;
        }
@@ -2205,21 +2202,26 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
        struct net_device *netdev;
        struct atl1_adapter *adapter;
        static int cards_found = 0;
-       bool pci_using_64 = true;
        int err;
 
        err = pci_enable_device(pdev);
        if (err)
                return err;
 
-       err = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
+       /*
+        * The atl1 chip can DMA to 64-bit addresses, but it uses a single
+        * shared register for the high 32 bits, so only a single, aligned,
+        * 4 GB physical address range can be used at a time.
+        *
+        * Supporting 64-bit DMA on this hardware is more trouble than it's
+        * worth.  It is far easier to limit to 32-bit DMA than update
+        * various kernel subsystems to support the mechanics required by a
+        * fixed-high-32-bit system.
+        */
+       err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
        if (err) {
-               err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
-               if (err) {
-                       dev_err(&pdev->dev, "no usable DMA configuration\n");
-                       goto err_dma;
-               }
-               pci_using_64 = false;
+               dev_err(&pdev->dev, "no usable DMA configuration\n");
+               goto err_dma;
        }
        /* Mark all PCI regions associated with PCI device
         * pdev as being reserved by owner atl1_driver_name
@@ -2238,7 +2240,6 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
                err = -ENOMEM;
                goto err_alloc_etherdev;
        }
-       SET_MODULE_OWNER(netdev);
        SET_NETDEV_DEV(netdev, &pdev->dev);
 
        pci_set_drvdata(pdev, netdev);
@@ -2284,7 +2285,6 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
 
        netdev->ethtool_ops = &atl1_ethtool_ops;
        adapter->bd_number = cards_found;
-       adapter->pci_using_64 = pci_using_64;
 
        /* setup the private structure */
        err = atl1_sw_init(adapter);
@@ -2301,9 +2301,6 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
         */
        /* netdev->features |= NETIF_F_TSO; */
 
-       if (pci_using_64)
-               netdev->features |= NETIF_F_HIGHDMA;
-
        netdev->features |= NETIF_F_LLTX;
 
        /*