IB/mthca: Remove useless DMA-32 fallback configuration
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 15 Jan 2022 07:45:05 +0000 (08:45 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 28 Jan 2022 14:49:03 +0000 (10:49 -0400)
As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.

So, if it fails, the 32 bits case will also fail for the same reason.

Simplify code and remove some dead code accordingly.

[1]: https://lore.kernel.org/r/YL3vSPK5DXTNvgdx@infradead.org

Link: https://lore.kernel.org/r/03c66fe5c2a81dbb29349ebf9af631e5ea216ec4.1642232675.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mthca/mthca_main.c

index f507c4c..b54bc88 100644 (file)
@@ -939,12 +939,8 @@ static int __mthca_init_one(struct pci_dev *pdev, int hca_type)
 
        err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
        if (err) {
-               dev_warn(&pdev->dev, "Warning: couldn't set 64-bit PCI DMA mask.\n");
-               err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
-               if (err) {
-                       dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting.\n");
-                       goto err_free_res;
-               }
+               dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting.\n");
+               goto err_free_res;
        }
 
        /* We can handle large RDMA requests, so allow larger segments. */