IB/ipath: set up 32-bit DMA mask if 64-bit setup fails
authorBryan O'Sullivan <bos@pathscale.com>
Mon, 24 Apr 2006 21:22:58 +0000 (14:22 -0700)
committerRoland Dreier <rolandd@cisco.com>
Mon, 1 May 2006 19:14:12 +0000 (12:14 -0700)
Some systems do not set up 64-bit maps on systems with 2GB or less of
memory installed, so we have to fall back to trying a 32-bit setup.

Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ipath/ipath_driver.c

index e7617c3982ea6c18641d9a6be9aee2120e566d6b..7ff95b72d1fc93e97ab6083f1be09bcbd97cd835 100644 (file)
@@ -418,9 +418,19 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
 
        ret = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
        if (ret) {
-               dev_info(&pdev->dev, "pci_set_dma_mask unit %u "
-                        "fails: %d\n", dd->ipath_unit, ret);
-               goto bail_regions;
+               /*
+                * if the 64 bit setup fails, try 32 bit.  Some systems
+                * do not setup 64 bit maps on systems with 2GB or less
+                * memory installed.
+                */
+               ret = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
+               if (ret) {
+                       dev_info(&pdev->dev, "pci_set_dma_mask unit %u "
+                                "fails: %d\n", dd->ipath_unit, ret);
+                       goto bail_regions;
+               }
+               else
+                       ipath_dbg("No 64bit DMA mask, used 32 bit mask\n");
        }
 
        pci_set_master(pdev);